How to open WMS layer into android studio app to show GEO map?

Description

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import com.esri.arcgisruntime.layers.WmsLayer;
import com.esri.arcgisruntime.mapping.ArcGISMap;
import com.esri.arcgisruntime.mapping.Basemap;
import com.esri.arcgisruntime.mapping.view.MapView;

public class MainActivity extends Activity {
MapView mMapView;
WMSLayer wmsLayer;
String wmsURL, wmsURL1;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// after the content of this activity is set
// the map can be accessed from the layout
mMapView = (MapView)findViewById(R.id.map);

wmsURL = "http://10.1.1.100:8090/geoserver/cyobjet/wms";
wmsURL1 = "http://mmcnav.com:8084/geoserver/Tigri/wms";
wmsLayer = new WMSLayer(wmsURL);
wmsLayer.setImageFormat("image/png");
// available layers
String[] visibleLayers = {"cyobjet:object"};
wmsLayer.setVisibleLayer(visibleLayers);
wmsLayer.setOpacity(0.5f);
mMapView.addLayer(wmsLayer);

mMapView.setEsriLogoVisible(false);
mMapView.enableWrapAround(true);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}

return super.onOptionsItemSelected(item);
}
}

Environment

Below is my code

Status

Assignee

Unassigned

Reporter

Kamal Dubey

Priority

High
Configure