google play - How to determine which android market was used to download my app -


i plan distribute app not on google play, on several other markets, such opera mobile store, yandex store, amazon app store. "rate" button need link store page. possible find out market used download app?

of course can compile invididual apks every market want make 1 universal apk. different iap apis solved openiab library, stuck problem linking market.

generally if use advertising distribute app can use tools of google:

in short, need insert googgle analitics app (if not use of course), , use tool called:

campaign measurement

then sign receiver of installment :

<receiver         android:name=".system.refferreceiver"         android:exported="true">         <intent-filter>             <action android:name="com.android.vending.install_referrer" />         </intent-filter>     </receiver> 

and handle logic inside receiver:

public class refferreceiver extends broadcastreceiver {  @override public void onreceive(final context context, intent intent) {     string referrer = intent.getstringextra("referrer");     //do logic } 

edited: sorry, didn't read question properly. if want know market source of app can use :

 string installermarket = getpackagemanager().getinstallerpackagename("your_package_name");     if (installermarket == null){         //do default case     }     else if ("com.android.vending".equals(installermarket)) {         //link google play     } else  if ("com.amazon.venezia".equals(installermarket)){         //link amazon     } else if //you got idea, need know name of every market  store installer     } 

Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -