We're developing an android app which uses ArcGIS SDK for Android. In order to connect to secure layers we're using token based authorization.
When the requested token has expired we'd like to refresh it but I cannot find a way how to catch this moment. What actually the ArcGIS library does is just writes error messages into log when a user pans or zooms:
com.esri.core.io.EsriSecurityException: Invalid request <br>Usage: https://arcgis.example.com/arcgis/tokens?request=gettoken&username=username&password=password&<br>Usage: https://arcgis.example.com/arcgis/tokens/generateToken?username=username&password=password&<br>Usage: https://arcgis.example.com/arcgis/tokens/gettoken.html<br>
I know that I may refresh the token when expiration time comes but I think its better to handle this error because it more reliable and simple.
Thanks in advance!