How to do some init operation immediately after install

by zhiyazw » Wed, 30 Sep 2009 01:37:14 GMT

Sponsored Links
 There is a big database(15M) in my application,
it is too big to download the apk if I publish the source database in
So I encode the db to binary files(300k).

But the new problem is I should decode binary files and create the
database(with data), this procedure take about several minutes, so I
can NOT do this in SQLiteOpenHelper.onCreate(), this is too slow for
user experience(though it is a one time procedure, it is still

My application has NO main activity entry in launcher, the main entry
is BroadcastReceiver.onReceive, the infomation should display to user
immediately when receiving the broadcast, so I have no chance to
display a several minutes "Initializing, please waiting..." UI.

The best chance to create database and init data immediately after
install, but how to do this, is there any broadcast? or is there any
AndroidManifest attribute?

pls help!


How to do some init operation immediately after install

by zhiyazw » Sat, 03 Oct 2009 12:44:14 GMT

 Anybody help?

Sponsored Links

How to do some init operation immediately after install

by Beowolve » Sat, 03 Oct 2009 16:47:52 GMT

 You could add an extra activity to your apk that does the init stuff
if the database does not exist and otherwise closes without showing
It might be a good idea to inform the user that you are going to
create a 15mb db on his device. Telling the user why this is needed
might be a
good thing anyway *g*


Other Threads

1. paging in android view


not sure if this is possible, in .Net there is paging for a data
can we do the same thing for a ListView/GridView in android?   what i
want to do is to have either of the following:

1) in the view i want to have an image, a line of text, and then
programmatically switch to the "next page" with a different image and
line of text.

2) in the GridView/ListView, each item will contain an image and line
of text.  at a certain time interval, i want to programmatically
highlight the next item (kind of like scrolling down)

the time interval will be determined by a timer. can someone help me?


2. Launching the correct activity on resume

I'm currently working with a two-activity application. The first
activity allows the user to choose options for their upload, and the
second activity displays a ListView of their results once processed.

I have code in place that performs the uploads/downloads in the
background, regardless of whether the application is currently in
focus or not (thanks to Matthias Kaeppler's Droid-Fu).

I would like to have my application Resume into my second (results)
activity when a user clicks on the icon from the top-level launcher,
regardless of how long they have been away from the app. I thought
that the 'alwaysRetainTaskState' flag in the Manifest would do it, but
I've not had success with that. Can anyone tell me how I need to set
up my Manifest to get this functionality?

Thank you for your help! :)


3. How to use Hibernate and MySQL Server in NetBeans IDE

4. How to show view with choices when clicking

5. Lots of questions and no answers: upgrading <my device> from Android 1.6 to 2.0

6. Call data

7. Open input method automatically on showing Dialog