AnsweredAssumed Answered

Android Runtime SDK 100 - License with a Named User Account

Question asked by btlmrf on Jan 24, 2018
Latest reply on Jan 24, 2018 by ebader-esristaff

Hello, we would like to licence our application with a named user account. When we run the code below we get "portal.portalInfo must not be null" error. Is there a special setting in portal-side for this? Thanks.

 

//license
val credential = UserCredential("username", "pass")
val portal = Portal("PortalURL")
portal.credential = credential
portal.loadAsync()
portal.addDoneLoadingListener({
    try{
        // get license info from the portal
        val licenseInfo = portal.portalInfo.licenseInfo
        // Apply the license at Standard level
        ArcGISRuntimeEnvironment.setLicense(licenseInfo)
        //do something...

    } catch (e: Exception){
        Log.d("ERROR:", e.message)
    }
})

Outcomes