Hi everybody,
i'm using ArcGIS SDK 100.0.0 for Android.
I found some guide to access to private layer but only with the old version.
I need to show a private layer using the last version 100.0.0.
This is my simple code:
private static final String CVWLayersTEST = "https://XXXX/arcgis/rest/services/XXX/XXX/FeatureServer/0";
[...] mMapView = (MapView) findViewById(R.id.mapView); ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 34.056295, -117.195800, 1); mServiceFeatureTable = new ServiceFeatureTable(CVWLayersTEST); mStreetsLayer = new FeatureLayer(mServiceFeatureTable); map.getOperationalLayers().add(mStreetsLayer); mMapView.setMap(map);
[...]
Ih the layer is public the application shows the layer.
If the application is private the system doesn't show nothing because need a credential.
How ca i pass the credential in my code?
Some example found on forum use different classes used in the Old version about SDK.
Thanks in Advance.
Antonio
Seem the equivalent for the new version should be the following:
ArcGISMapImageLayer mapImageLayer = new ArcGISMapImageLayer(MALSATLayers); mapImageLayer.setCredential(mycredentials);
Sorry guys but is not clear.
I tried with the only solution that i discovered that use the credentials, so the ArcGISMapImageLayer:
ArcGISMapImageLayer mapImageLayer = new ArcGISMapImageLayer("https://XXXX/arcgis/rest/services/XXX/XXX/MapServer"); mapImageLayer.setCredential(mycredentials); map.getOperationalLayers().add(mapImageLayer);
but the system shows onle the first layer.
The MapServer haves 10 layers
no help?
Hi Antonio - you might want to look at using the AuthenticationManager - this can take care of authenticating at runtime - it's pretty simple to set up and described here - Access the ArcGIS platform: Authentication Manager—ArcGIS Runtime SDK for Android | ArcGIS for Devel... .