Solved

android database design and i18n

Posted on 2011-02-24
3
1,006 Views
Last Modified: 2012-08-13
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
Comment
Question by:Peter Kwan
  • 2
3 Comments
 
LVL 17

Expert Comment

by:Dejan Pažin
ID: 34977265

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
 
LVL 16

Author Comment

by:Peter Kwan
ID: 34991446
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
 
LVL 17

Accepted Solution

by:
Dejan Pažin earned 500 total points
ID: 34991550

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, people trade privacy and security for convenience. However in today's concrete jungle, this is an extremely foolish decision considering the vast amount of technologies being used against consumer interest. First off, I won't waste any time e…
Once again I push the limits of my phone.  An introduction to the Android Google Now Launcher.
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now