I have a secure service that's secured by arcgis tokens (ArcGIS for Server 10.2.2). When I start my Android application and load the layer, everything's fine:

ArcGISDynamicMapServiceLayer mapServiceLayer = new ArcGISDynamicMapServiceLayer(
                                                       mapServiceUrl, null, cred);

The credentials are entered by the user in a login activity and then kept in memory (I need to be able to generate tokens myself to access a server object extension). Problem is when the token expires, the map just vanishes. I guess it's something to do with the layer not being able to authenticate itself again, but I have no idea why.

I tried playing around with the UserCredentials, only setting username & password, only setting usertoken & tokenserviceurl or setting everything. Nothing helps. Listening to OnStatusChanged of the layer doesn't tell me anything either, it doesn't fire.

I'd be grateful if anybody could tell me what I'm missing.

  • Is this happening in the app session? If a layers token expires and the app session still has credentials it should go and generate a new token. Layer status changed is only for loading the layer, so once it has loaded it won't change after that. – jdONeill Mar 31 '15 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.