1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question Check the source where an app was installed from

Discussion in 'Android Questions' started by KMatle, Aug 19, 2019.

  1. KMatle

    KMatle Expert Licensed User

    Is it possible to check (within the app by code) which the source was the app was installed from? (Google Play or other)
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Code:
    Sub GetInstallerPackageName As String
       
    Dim jo As JavaObject
       jo.InitializeContext
       jo = jo.RunMethod(
    "getPackageManager"Null)
       
    Dim o As Object = jo.RunMethod("getInstallerPackageName"Array(Application.PackageName))
       
    If o = Null Then Return "N/A" Else Return o
    End Sub
     
    KMatle likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice