Is is possible to pass a custom argument to android market so my app receives it on first launch?

weakwire picture weakwire · Sep 10, 2011 · Viewed 7.7k times · Source

Is there a way to pass a custom argument to android market (or any other way) so my app receives the argument after it gets installed (and run for the first time).

Let me explain.

  1. Start an intent with argument1="Hello world1" (custom argument every time)
  2. Install the app from android market.
  3. Open the app for the first time.
  4. App shows the msg "Hello world1"

Any case will do, not just intent to android market.

Most of the time the app will be installed via Barcode scanner with a binded http schema. So a browser workaround is possible too, HTML5 Client Side Storage, (store argument to browser and get it from there the first time my app runs)

Update

A solution would be to create a cookie,or something to the browser and then access it from the application i installed. Is that possible? If so can you provide some information about that? Can browsers share data with applications?

Answer

Fedor picture Fedor · Sep 28, 2011

You can publish a link like that
http://market.android.com/details?id=your.package.name&referrer=your_referrer_parameter
After user clicks this link and installs the application your broadcast receiver will receive a broadcast com.android.vending.INSTALL_REFERRER with "your_referrer_parameter" value.

More info:
http://code.google.com/mobile/analytics/docs/android/#android-market-tracking
Get referrer after installing app from Android Market
Get Android Google Analytics referrer tag