[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1025
  • Last Modified:

android database design and i18n

I am new to Android app development and would like to try to develop some simple apps for self learning. One of the apps is a simple information app which has only two screens. The flow is as the following:

Home screen - Have a list view to allow users to select a list of bus routes. When clicking one of the items in the list view, it goes to info screen.
Info screen - Displays information about the selected route.

To make thing simple as I am new, I would plan for an offline application and only involves retrieval of data. No update operation is allowed. Besides, I would like to support both English and Japanese display when user selects the language of the phone.

For database design, if I am developing a web application, I would design like the following:

ROUTE (ID, ORIG_EN, ORIG_JP, DEST_EN, DEST_JP, COMPANY_EN, COMPANY_JP, JOURNEY_TIME, REMARK_EN, REMARK_JP)
SCHEDULE (ROUTE_ID, DAY_TYPE_ID, START_TIME, END_TIME, FREQ)
FARE (ROUTE_ID, DAY_TYPE_ID, FARE_TYPE_ID, AMT)
CODE_TABLE (ID, TYPE_ID, DESC_EN, DESC_JP)

CODE_TABLE will store both day_type and fare_type.

I am not sure whether this is appropriate and feasible if we port to android phone. I have read some articles about android programming, but many of them are only involving one table only. If it is feasible, how can we do this in Android?

Can someone please kindly help to resolve my enquiries? Thanks.
0
Peter Kwan
Asked:
Peter Kwan
  • 2
1 Solution
 
Dejan PažinCommented:

Android supports SQLite database, so you can work with as many tables as you need to:

http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html

There are also other types of storage you can use on Android, like db4o:

http://www.db4o.com/android/

But if this is your first app, I recommend SQLite.
0
 
Peter KwanAuthor Commented:
Thanks for your reply.

I have looked at your provided link about SQLite, and would like to learn more in the following area:
1) Can we initialize the tables with initial data without user running our application (just download and install our application and the data is there)? How can we package it?
2) Can users just update the data by downloading a file? If yes, how can we do that?
3) How can we make table joins using SQLite in our application?

Thanks.
0
 
Dejan PažinCommented:

1) Can we initialize the tables with initial data without user running our application (just download and install our application and the data is there)? How can we package it?

You can have that as part of your app and create all the tables and the contents of the tables when you first run the app.

2) Can users just update the data by downloading a file? If yes, how can we do that?

When you upgrade the app you can execute the code which will add data to your database or change its structure. See example here:

http://marakana.com/forums/android/examples/55.html

3) How can we make table joins using SQLite in our application?

Much like in any other database. Here is a list of UNSOPPERTED operatinos:

http://www.sqlite.org/omitted.html

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now