Solved

android database design and i18n

Posted on 2011-02-24
3
1,011 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
A short article about problems I had with the new location API and permissions in Marshmallow
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.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

839 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