Creating An Android App With Static Content
Solution 1:
I will try to give you an overview of the app you are trying to create.
First, you would have an activity, say CategoryListActivity
, which list out all categories (i.e. Historical sites, Cultural sites, for example) using ListView
.
When the user clicks on Historical sites, it launches another activity called PlaceListActivity
. You pass an additional param to this activity using Intent
, telling it that you want to show places in historical sites only. It will show all available places that fits your criteria, using ListView
again.
Now when the user clicks on one of the places, it launches third activity called PlaceDetailsActivity
, which shows all information related to this place. It is up to you to determine how to show these information.
So you just need min. 3 activities in total (of course you will need a bit more). Regarding your data, storing all text inside SQLite database would be a great choice. You can assign each place and category with an id, so you can tell CategoryListActivity
and PlaceListActivity
to load data dynamically. The only hard-coded data, is when you trying to populate the database on first launch. However, you can always prepare the database first, pack it with your app, and ask your app to load and use it immediately.
Solution 2:
I would store all the text in an embedded SQLite database, and all the media in the assets folder.
Post a Comment for "Creating An Android App With Static Content"