• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Is SQLite the best option here?

samop

Lurker
Hi

I'm reasonably new to Android (although I've been developing in other languages for years) and I'd like opinions if this this is the best way to handle this.

I have a search activity that will go to a web service and retrieve possibly a very large amount of data. Once that's returned I want to open another activity (lets call this "activity2") to display it as a list, then the user can select any item and that will open an other activity ("activity3") to show additional details.

The way I'm planning to do this is to get the data and put it in an SQLite database table which "activity2" can then read and display (some of the columns of the data). On selecting it then passes the additional data to "activity".

In this scenario is the use of SQLite for (temporarily) persisting the data the best move or is there a better way?

Cheers

Samo
 
Well you could do that, but why not combine the search and display function? The way I've done this in the past is to have a search criteria panel, with an attached ListView panel to display the results of the search. You can hide, or remove the search panel if you're concerned about losing screen space.
You can pass data between Activities in an Intent, but your approach of using the database is probably ok.
 
Hey, thanks for that answer, that's a really good solution...

I was a bit worried about all the additional overhead of creating, opening and closing a database and table just for the convenience of passing the data between to activities, but having it all in one activity makes it so much simpler. . . I guess I was still thinking along the "desktop app" lines where resources aren't an issue and you can have multiple forms open at the same time.

So, I'm going to dump the SQLite idea and keep it simple.

Thanks again

Samop
 
Back
Top Bottom