Prefill databases

by Jaap » Sat, 10 Jul 2010 04:10:39 GMT


Sponsored Links
 Hi,

I have a program that needs a fixed database to do lookups of some
data. Is there a way to easily fill such a database by just putting
the data in a file or so

Thanks

Jaap

--



Prefill databases

by TreKing » Sat, 10 Jul 2010 06:00:07 GMT


 



Yes, just create the database you need, populate it, and include in your
app. What's the problem?

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
 http://sites.google.com/site/rezmobileapps/treking 

--


Sponsored Links


Prefill databases

by vineet » Sat, 10 Jul 2010 17:07:32 GMT


Prefill databases

by Jaap » Mon, 19 Jul 2010 05:04:21 GMT


 Hi the link you provided does not work. Can you provide the right link
please?

Thanks

Jaap





--



Prefill databases

by DanH » Mon, 19 Jul 2010 10:08:01 GMT


 Again, I say, what's your problem -- do you need to know how to fill
the database, or how to include it in your app?

A SQLite database consists of a single file on the PC or phone, and is
portable between them, so you can use any of a dozen methods to fill
the database file and then install it with your app.




--



Prefill databases

by Jaap » Mon, 19 Jul 2010 14:09:15 GMT


 OK, but where do I need put it in the package?






--



Prefill databases

by Naseer » Mon, 19 Jul 2010 14:46:51 GMT


 Create an assets directory and put it there.
Here is a nice tutorial that explains it -
 http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ 

-Naseer








--



Other Threads

1. Need help with "get field slot from row 0 col 0 failed"

Looking at the stacktrace it seems to me that I issued a requery() on  
a cursor and that failed.

Can I use requery() in a wrong way?
Can I somehow anticipate when a requery would fail?
Anything else I can check for?

-- Time: Mon Jul 06 07:43:40 GMT+02:00 2009-- Android Version: sdk=3,  
release=1.5, inc=148830
-- Memory free: 11,47MB total: 14,51MB max: 16,00MB
-- Stacktrace:
java.lang.IllegalStateException: get field slot from row 0 col 0 failed
at android.database.CursorWindow.getLong_native(Native Method)
at android.database.CursorWindow.getLong(CursorWindow.java:329)
at  
android 
.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java: 
108)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java: 
194)
at android.widget.CursorAdapter.getItemId(CursorAdapter.java:155)
at android.widget.AdapterView.rememberSyncState(AdapterView.java:1085)
at android.widget.AdapterView 
$AdapterDataSetObserver.onChanged(AdapterView.java:784)
at  
android 
.database.DataSetObservable.notifyChanged(DataSetObservable.java:31)
at android.widget.BaseAdapter.notifyDataSetChanged(BaseAdapter.java:50)
at android.widget.CursorAdapter 
$MyDataSetObserver.onChanged(CursorAdapter.java:385)
at  
android 
.database.DataSetObservable.notifyChanged(DataSetObservable.java:31)
at android.database.AbstractCursor.requery(AbstractCursor.java:97)
--> at android.database.sqlite.SQLiteCursor.requery(SQLiteCursor.java: 
549)
at  
com 
.newsrob 
.activities.ArticleListActivity.updateCursor(ArticleListActivity.java: 
124)
at com.newsrob.activities.ArticleListActivity.access 
$3(ArticleListActivity.java:107)
at com.newsrob.activities.ArticleListActivity 
$3.run(ArticleListActivity.java:101)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3948)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit 
$MethodAndArgsCaller.run(ZygoteInit.java:782)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
at dalvik.system.NativeStart.main(Native Method)

--~--~---------~--~----~------------~-------~--~----~

2. SSL VPN client for Android?

Can I connect the Cisco SSL VPN service from the Android phone?  Anyone
knows that?  Any hint is appreciated!  --Hugo

--~--~---------~--~----~------------~-------~--~----~

3. findviewbyid in service?

4. How to get the images from folders and the list of all folders?

5. Internet Access on ANDROID

6. invoke other apk file?

7. error message with MediaPlayer