2

I just started working on an Android app that should display posts from my site and then a three-column list of some products. The three columns on the list contain the product names, a short description, and then some pricing information. The pricing info should always be up to date.

I am not experienced, but I am thinking of two approaches:

  • Allowing the app to interact with an online database in order to get the most current data. However, this approach means I will also need another web app to manage the database, which seems complicated to me.
  • Hosting an up-to date CSV or XML file in a certain URL. Then, each time the app synchronizes, it gets the file and process it. However, this seems to be a waste of bandwidth.

My questions are:

  1. Of the two options, which one is viable/appropriate? And why.
  2. Is there any other efficient way to handle this?
1

I have the same problem, and i realize that. When we create adapter and set it to listview, listview will point to object somewhere in memory which adapter hold, data in this object will show in listview.

adapter = new CustomAdapter(data);
listview.setadapter(adapter);

if we create an object for adapter with another data again and notifydatasetchanged():

adapter = new CustomAdapter(anotherdata);
adapter.notifyDataSetChanged();

this will do not affect to data in listview because the list is pointing to different object, this object does not know anything about new object in adapter, and notifyDataSetChanged() affect nothing. So we should change data in object and avoid to create a new object again for adapter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.