I'm still getting my head around the API and can use a check if I'm understanding this right.

On 3/15/2012 6:48 AM, Mark Murphy wrote:
On Thu, Mar 15, 2012 at 4:06 AM, giles ian<gilesian....@gmail.com>  wrote:
I need to execute some code on app install event. How do i do it.
You don't.

Ok, I understand that ACTION_PACKAGE_INSTALL wasn't implemented. There is no broadcast to the app when its package is installed. Doesn't the installer from Market^H^H^H^H^H^H Play start the app as the default? I haven't published an app as yet so I'm not sure if it's configurable from the deployment console.

After some googleing i found there is no direct way. So which is the best
work around for that.
You do the work when the user first runs your app.

API 12 gave us ACTION_PACKAGE_FIRST_LAUNCH and ACTION_MY_PACKAGE_REPLACED. I've been writing to 8 and piggybacked my first run code to the DB helper, since what I'm doing needs a DB. I suppose it's easy enough to store an already ran flag in preferences and check that.

What are the techniques people have been using to manage this? Storing static versioning and checking it? Using the manifest versioning data? This may seem like a lame question, but curiosity has gotten the better of me. I guess what I'm asking is there are a lot of ways to skin this cat, what are people doing?

Is it worth using the broadcasts and maintaining your own state to provide backward compatibility or is everyone saying bag that and just rolling their own?


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to