ESRI Android Runtime SDK Response Cashe 100.9

573
8
10-02-2020 12:00 AM
Muhammet_İkbalYaşar
New Contributor II

Hello,
After adding the vector map in Esri 100.9 Android runtime SDK, it pulls the request from the server each time it touches the map. iOS runtime SDK also does not have this problem. Fetching data from cache. Flickering when panning the map in Android SDK, a sign of reloading. The map is not fluid.

When shouldCacheResponse feature is True in iOS Runtime SDK, this problem is solved. What is the Android Runtime SDK equivalent of this?

Best Regards,

8 Replies
MarkBaird
Esri Regular Contributor

Can you share any code or data which would reproduce this issue?

I've been running the sample code this morning from this sample code and it is fluid and not flashing.  Does this sample work for you without any issues?

0 Kudos
Muhammet_İkbalYaşar
New Contributor II

Hi Mark,

When we converted the code we developed from Kotlin to Java, the problem was resolved. There may be a code error.
Problem solved.
Thanks.

0 Kudos
MarkBaird
Esri Regular Contributor

That is very curious.  I'd be interested to compare the Kotlin code which doesn't work with the Java code which does.  

If you want to share this code, I'd be happy to comment on why the Kotlin code didn't work.  

0 Kudos
Muhammet_İkbalYaşar
New Contributor II

Hi Mark,

I said it was fixed, but it didn't. In practice, when we pan on the map, it gets stuck. We also tested the gloabal vector maps you have published, there is a stuttering in the same way.

I am sharing the sample java code.
SKD 100.9

I have a guess like this;
In the ios Runtime SDK for vector map requests, the "shouldCacheResponse" property is set to True. It is as if the Android SDK is like this False and the map tries to capture data again in every action. Therefore, there is a slowdown.


I expect your return.

public static void setUpBaseMap(MapView mapView, String url, int mapSitutation) {
ArcGISRuntimeEnvironment.setLicense("runtimelite,1000,bla,bla,3bla");
ArcGISVectorTiledLayer tiledVectorLayer;
ArcGISTiledLayer tiledImageLayer;
Basemap basemap;

if (mapSitutation == 0 || mapSitutation == 1) {
tiledVectorLayer = new ArcGISVectorTiledLayer(url);
basemap = new Basemap(tiledVectorLayer);
} else {
tiledImageLayer = new ArcGISTiledLayer(url);
basemap = new Basemap(tiledImageLayer);
}

if (mapView != null) {
ArcGISMap map = mapView.getMap();
if (map == null) {
map = new ArcGISMap(basemap);
} else {
map.setBasemap(basemap);
}
Viewpoint viewpoint = new Viewpoint(getEnvelope());
map.setInitialViewpoint(viewpoint);
mapView.setMap(map);
}
}

0 Kudos
GayleYoung
Esri Contributor

Hi Muhammet,

are you able to this sample code that Mark mentioned is fluid and not flashing.  Does this sample work for you without any issues?

Thanks,

Gayle.

0 Kudos
SalihYalcin
New Contributor III

Hello, 

Actually I have same problem while developing my app. The real problem is on android side, when I pan the map, every vector tile come from server properly. I don't want this behaviour, I would like to use cache policy for exampl, when vector map is not changed, I would like to show user cached version. How could I catch this behaviour ? We catched this behaviour on iOS side like Muhammet İkbal Yaşar‌ mentioned but Android side we couldn't able to get it. 

Any help would make us appreciated. 

Thanks at all

0 Kudos
Muhammet_İkbalYaşar
New Contributor II

Gayle,

I will try.
What is the equivalent of the following feature in iOS Runtime SDK on Android?

if let rc = AGSRequestConfiguration.global().copy() as? AGSRequestConfiguration {     rc.requestCachePolicy = .reloadIgnoringLocalAndRemoteCacheData     rc.shouldCacheResponse = false     myVectorLayer?.requestConfiguration = rc }
0 Kudos
Muhammet_İkbalYaşar
New Contributor II

Hi,
We tried the example, there is stuttering.

0 Kudos