Info to display in a list in Android

I will try to make this as clear as I can. Please let me know if there is anything I can clarify.

I am downloading information from an SQL table in a database online to the phone. In the LogCat, I have been able to go through the table and see all the information I want. I am wondering about how best to save the information on the phone. I do not think that is necessary to create a new local database. Should I create a cursor with the information from the online database or store it in some kind of structure?

  1. The data does not need to be stored for a long time and when the application is closed it is ok to lose it.
  2. I want to be able to see information from one of the columns from the SQL table in a list format and then click on it and see all the information from the row of that item in another activity. I have done this in another part of the app but it is using data from a local database on the phone.

Here is some code to help clarify:

Log.d("Provider Tester", "Result printed is: " + result);     

    JSONArray jArray = new JSONArray(result);
       for(int i=0;i<jArray.length();i++){

                JSONObject json_data = jArray.getJSONObject(i);
                Log.i("log_tag","Name: "+json_data.getString("Name")+
                        ", DateTime: "+json_data.getString("DateTime")
                );

I want to be able to show a list of names and then click on a name and see the corresponding date.

Answers


If you are ok with loosing the data, you can keep it in memory as long as it is not too big.

As for the ListActivity, you would use an ArrayAdapter if your data is in memory.


Need Your Help

Android center view in FrameLayout doesn't work

android layout gravity

I have a FrameLayout in which I have 2 controls:

Laravel generate models, views and controllers from database or migration script

laravel controller views models reverse-engineering

I am new to Laravel 4. I wanted to know if it is possible to generate Models , Views and Controllers from existing database? I Googled and found

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.