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. connect forcibly to 3G when wifi is also available

Hi all,

how can i connect forcibly to 3G for accessing the internet when wifi is
also available . pl suggest me with any sample code

Thanks in advace



2. Starting Activity by package Name

Hi All,

I have the code to get the list of packages installed in phone. I have
represented the list in the form of Array List, below is the code
snippet. But upon clicking in  the package name I want to start that
application, but how do I get the respective class name and package
name to run?

Is there any other method which I can try to start an application?

             ArrayList<String> PackageNames = null;
                List<PackageInfo> lis =
                Pkgs = (ListView) findViewById(;

                for (PackageInfo pi : lis)
                        packages.put(pi.packageName, pi);

                PackageNames = new ArrayList<String>(packages.keySet());
                PackageNames.add(0, "All");
                Pkgs.setAdapter(new ArrayAdapter<String>(this,

                Pkgs.setOnItemClickListener(new OnItemClickListener() {

                        public void onItemClick(AdapterView<?> arg0, View v, 
int pos,
                                        long rowId) {
                                Intent i = new Intent();
                                i.setComponent(new ComponentName(class 


I have tried intent to start the activity, but don't know the class
name and package name to pass in the ComponentName() to start

Thanks In Advance,


3. GK: Urgent -- Combine all the multiple apks in one APK file

4. How to change "Enable GPS satellites" default value

5. Problem of Highlight in Webview

6. Understanding Broadcast Receiver

7. Need help: How to disable a view(provided there are 2 views in xml) ??