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
myapp.apk.
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
unacceptable).

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
anything.
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. [WTI] Video chat officially coming to Nexus S in Android 2.3.4

manteps video chat gtalk
http://www.androidcentral.com/video-chat-officially-coming-nexus-s-android-234

-- 
"

2. Calling menu from an item in a ListView

Hi,
I have a ListView, that exibits data from my database.
What I want to do, is to click on the item from the ListView and call
the Menu.

The Menu is called normally if I click on the menu button in the
phone.
But I couldnt find a way to call the menu since I click on one item
from the ListView.

 final ListView listProfile =
((ListView)findViewById(R.id.lvListView));
                listProfile.setOnItemClickListener(new OnItemClickListener()
{
                                public void onItemClick(AdapterView<?> adapter, 
View view,      int
position, long id){
                                idRow = position; //t
                                 WHAT  I WOULD LIKE TO DO IS CALL THE
onCreateOptionsMenu  HERE!!!!
THAT MEANS, WHEN o CLICK ON THE ITEM IN THE ListView
                                }
                        });

 @Override
         public boolean onCreateOptionsMenu(Menu menu) {
                 super.onCreateOptionsMenu(menu);
                getMenuInflater().inflate(R.menu.menu, menu);
                        return true;
         }

Any idea how to do that?
thanks

P.s. - using api 2.2 level 8

-- 

3. WTUneg2 : Skema pemotongan Pulsa XL Internet

4. For user G5

5. Ini penipuan (lagi)?

6. sim tool kit for nexus

7. WTReview LG Vortex: Optimus one versi CDMA