Initial Configuration for Android App

杀马特。学长 韩版系。学妹 提交于 2020-01-04 12:46:14

问题


Is it possible to have some piece of data passed in to the app on the very first app run through via the Google Play link (maybe as an Intent).

The scenario I envision is this:

  1. I share a special url to my app in the market for special clients (promotion, etc)
  2. They download the app, install the app.
  3. On the first run, I can pull off the data I put on the url somehow
  4. Magic happens

Current Solution

My current solution to this problem is sending out a generic link to the market, and have a second url that they click that my app has an intent-filter. I'd really like to have only one url for people to click.

Thoughts

An alternative I've considered, is having the link go to my server, save some unique information about the HTTP Request, then try to correlate that information with a web request on the first app run, but that seems very error prone (IP isn't unique on Wi-Fi behind a NAT, User Agents don't match...).

Any advice would be greatly appreciated.


回答1:


Have a search for the com.android.vending.INSTALL_REFERRER Intent. This source, for example, says:

Starting with Android 1.6, the Android Market's emits a broadcast Intent named com.android.vending.INSTALL_REFERRER whenever certain parameters are added to the market url. Note that web version of the Market also passes these parameters to your devices upon install.

I have no idea how up-to-date or well-supported that is, but it sounds like what you want.




回答2:


I think you can do it with an APK expasition file:

http://developer.android.com/google/play/expansion-files.html



来源:https://stackoverflow.com/questions/14857070/initial-configuration-for-android-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!