Unofficial Content

Android Utilities is an External object that lets you check if an application is installed on the device, its code and version number and even allows you to launch the application. It also let you obtain the downloads directory location of the device and the IMEI number.

Using Android Utilities in GeneXus X Evolution 3

Event 'isAppInstalled'
    Composite
        &AppId = 'com.genexusconsulting.example'
        If not &AppId.IsEmpty()
            &isAppInstalled= &AndroidUtilities.IsAppInstalled(&AppId)
        EndIf
        If &isAppInstalled = 1
            msg("app installed")
        Else
            msg("app not installed")
        EndIf
    EndComposite
EndEvent

 

Event 'Launch'
    Composite
        &AppId = 'com.genexusconsulting.example'
        If not &AppId.IsEmpty()
            &AndroidUtilities.LaunchApplication(&AppId.Trim())
        EndIf
    EndComposite
EndEvent

 

Event 'Version'
    Composite
        &AppId = 'com.genexusconsulting.example'
        If not &AppId.IsEmpty()
            &Version = &AndroidUtilities.GetApplicationVersionCode(&AppId.Trim())
        EndIf
    EndComposite
EndEvent

 

Event 'VerName'
    Composite
        &AppId = 'com.genexusconsulting.example'
        If not &AppId.IsEmpty()
            &VersionName = &AndroidUtilities.GetApplicationVersionName(&AppId.Trim())
        EndIf
    EndComposite
EndEvent

 

Event 'GetDownloadsDirectory'
    &DownloadsDirectory = &AndroidUtilities.GetDownloadsDirectory()
EndEvent

 

Event 'getIMEI'
    &imei = &AndroidUtilities.GetPhoneIMEI()
EndEvent

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant