我想开发一个应用程序,其中有分支(计算机科学,机械,公民等),并在那里各有一个学期。我想要一个选择菜单,在申请某个分支和学期的第一次启动时,根据选择下载该学期和分支的不同科目的问题。根据用户选择获取数据
我想这个代码,检查的天气应用程序首次启动:
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