use of com.esri.android.map.MapView in project android-gps-test-tool by Esri.
the class GPSTesterActivityController method setUI.
private void setUI() {
final Display display = _activity.getWindowManager().getDefaultDisplay();
//WARNING: this method was deprecated at API level 13
final int width = display.getWidth();
//WARNING: this method was deprecated at API level 13
final int height = (int) (display.getHeight() * .3333);
_baseMap = new ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer");
_graphicsLayer = new GraphicsLayer();
String bestAvailableText = "";
String cachedLocationNetworkProviderText = "";
String cachedLocationGPSProviderText = "";
String gpsLocationText = "";
String networkLocationText = "";
final LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(width, height);
final MapView temp = (MapView) _activity.findViewById(R.id.map);
temp.setLayoutParams(layoutParams);
//Keep screen awake
_activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
//Load the map
// if(_map.layerExists(MapType.TOPO)){
// _map.clearAllGraphics();
// }
// else{
_map.addLayer(_baseMap);
_map.addLayer(_graphicsLayer);
// }
bestAvailableText = "<b><font color='yellow'>Best Accuracy = N/A</b></font>" + "<br><b>Lat/Lon:</b> N/A" + "<br><b>Accuracy:</b> N/A";
setBestAvailableImageView(BestAvailableType.NULL);
cachedLocationNetworkProviderText = "<b><font color='yellow'>Cached Network Provider</b></font>" + "<br><b>Lat/Lon:</b> N/A" + "<br><b>Accuracy:</b> N/A";
cachedLocationGPSProviderText = "<b><font color='yellow'>Cached GPS Provider</b></font>" + "<br><b>Lat/Lon:</b> N/A" + "<br><b>Accuracy:</b> N/A";
gpsLocationText = "<b><font color='yellow'>GPS Provider</b></font>" + "<br><b>Lat/Lon:</b> N/A" + "<br><b>Accuracy:</b> N/A";
networkLocationText = "<b><font color='yellow'>Network Provider</b></font>" + "<br><b>Lat/Lon:</b> N/A" + "<br><b>Accuracy:</b> N/A";
_bestAvailableInfoTextView.setText(Html.fromHtml(bestAvailableText));
_cachedLocationNetworkProvider.setText(Html.fromHtml(cachedLocationNetworkProviderText));
_cachedLocationGPSProvider.setText(Html.fromHtml(cachedLocationGPSProviderText));
_gpsLocationTextView.setText(Html.fromHtml(gpsLocationText));
_networkLocationTextView.setText(Html.fromHtml(networkLocationText));
_allLocationProvidersTextView.setText(Html.fromHtml("<b><font color='yellow'>List of available providers</b></font><br><br><br>"));
_bestLocationProviderTextView.setText(Html.fromHtml("<b><font color='yellow'>List of best providers</b></font><br><br><br>"));
}
Aggregations