Load local json file with image url in Android -
i using source image loading url. image links stored in json file , json file hosted in server. want json file store locally may in assets or drawable. problem if use asset manager, has use stream manager , stream manager not sit url, realated context load image url. if change url of config_wallpaper_manifest_url loacal asset url, ie. example.json, same never loads. possible solution this? thanks.
public void loaddata (bundle savedinstancestate) { // check network state if (!networkutil.getnetworkstate(this)) { final retryfragment fragment = retryfragment.getfragmentwithmessage("no connection"); this.addfragment(fragment, retryfragment.tag, true); return; } if (savedinstancestate == null || savedinstancestate.get(key_list_data) == null) { final string url = super.getresources().getstring(r.string.config_wallpaper_manifest_url); if (url != null && urlutil.isvalidurl(url)) { // add loading fragment final loadingfragment fragment = new loadingfragment(); this.addfragment(fragment, loadingfragment.tag, true); // load data final restclienthandler handler = new restclienthandler(this); restclient.get(this, url, handler); } } else { log.i(tag, "restored instance"); this.mdata = (arraylist<nodecategory>) savedinstancestate.get(key_list_data); this.mposition = savedinstancestate.getint(key_list_position); if (this.mposition != -1) { mignoreselection = true; } this.configureactionbar(); } }
json text. store in app's internal memory. or in sqlite database. have @ this:
creating folder in internal memory save files , retrieve them later
Comments
Post a Comment