我想開發一個應用程序,其中有分支(計算機科學,機械,公民等),並在那裏各有一個學期。我想要一個選擇菜單,在申請某個分支和學期的第一次啓動時,根據選擇下載該學期和分支的不同科目的問題。根據用戶選擇獲取數據
我想這個代碼,檢查的天氣應用程序首次啓動:
public class MyActivity extends Activity {
SharedPreferences prefs = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Perhaps set content view here
prefs = getSharedPreferences("com.mycompany.myAppName", MODE_PRIVATE);
}
@Override
protected void onResume() {
super.onResume();
if (prefs.getBoolean("firstrun", true)) {
// Do first run stuff here then set 'firstrun' as false
// using the following line to edit/commit prefs
prefs.edit().putBoolean("firstrun", false).commit();
}
}
}
現在我怎麼可以下載基於使用的選擇數據?
我想要的是,當應用程序啓動時,它要求用戶的分支和學期,基於雲的所有數據下載到應用程序,並將顯示在列表視圖中...... JSON將做到這一點但是如何? – 2015-02-23 12:23:18
你想知道如何提出請求?或者我錯了? – Shrey 2015-02-23 12:36:41
這是我的應用程序https://play.google.com/store/apps/details?id=com.pKLabs.RgpvDigest,它目前用於計算機科學我想爲其他分支機構,我不知道如何編寫JSON我有通過這個鏈接http://www.androidhive.info/2012/01/android-json-parsing-tutorial/所以如何開始? – 2015-02-23 12:40:33