Select to view content in your preferred language

Slow dynamic map service at times, how to show spinning wheel?

3416
3
06-19-2016 05:07 PM
VishApte
Esri Contributor

Hi,

We are developing an ArcGIS Android SDK app that will show Esri Basemap and dynamic map services from onsite server showing telco network. The app will be used by technicians while fixing network problems.

At times, user experiences slow rendering of the map on zoom/pan etc. At times, it can take up to 12 seconds for map refresh to complete. Our analysis shows it is either speed of 3G/4G network or slow export operation at ArcGIS Server end due to heavy load. However, field users tend to believe the application is broken and tend to not use the app.

I would like to know if there is any callback in Android SDK that can be used to notify the user that network communication is in progress, by means of spinning wheel or something similar. I could not find any handler or callback in MapView that denotes rendering of map or network/http communication is in progress. Are there any?

If there is nothing in ArcGIS Android SDK, are there any core classes in Android that can detect network access is in progress?

Any help is much appreciated.

Cheers,

Vish

0 Kudos
3 Replies
AlexanderNohe1
Honored Contributor

This would need to be implemented on your end via pure Android.  What you could do is show a toast or a notification in the notification bar while the app is loading.  Then when it has loaded, remove the toast or remove the notfication/show a check mark instead.  You can set the OnStatusChangedListener of your MapView to show the Toast or notification while OnStatusChangedListener.STATUS != INITIALIZED.

You should check the following documentation for more information:

MapView | ArcGIS Android 10.2.8 API

https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html

Toasts | Android Developers

0 Kudos
VishApte
Esri Contributor

Hi Alexander,

Thanks for your response. As far as I know OnStatusChangedListener will happen only during layers’ initialization.

The issue is not about while MapView or layers are initializing. It is more while zooming and panning once all layers are initialized. It happens occasionally but users seem to think the app is broken. We just need something to indicate the user it is working but a little slow.

Cheers,

Vish

0 Kudos
AlexanderNohe1
Honored Contributor

Hello Vish Apte​,

Although I have yet to test this, I do have a hunch that this may be available in the Quartz API.  If you look under the ArcGISMap Object in Quartz, there is a method called AddStatusChangedListener on the map object.  This object is independent of the MapView, so I believe this would be better used to actually monitor the map loading status itself.  Here is the documentation for that method:

ArcGISMap| arcgis-android

Maybe later today, I can explore this option and let you know the results.

DISCLAIMER: The Quartz API is in Beta and is subject to change.  This may not be a suitable for production.

0 Kudos