CnR CnR - 16 days ago 7
Android Question

How can I put a map that was created in google maps, in my application?

I created a map with google maps that has symbols on it : https://www.google.com/maps/d/u/0/viewer?mid=1IOw_y51yt8YaQeTzgRvoEhn5drk&ll=32.11239510425183%2C34.80320922355645&z=17

I would like to put this map in my android application, is there a way to do so? everything I saw online was to create a map and add markers, but if I already have a map how can I put it?

If anything is wrong with the question please tell me and don't down-vote because I'm in danger of being blocked here and just looking for help after searching a lot. thank you

Answer

You can make a WebView in your Layout, and just load the url in it.

public class Main extends Activity {

private WebView mWebview;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mWebview = new WebView(this);
    mWebview.loadUrl("https://www.google.com/maps/d/u/0/viewer?mid=1IOw_y51yt8YaQeTzgRvoEhn5drk&ll=32.11239510425183%2C34.80320922355645&z=17");
    setContentView(mWebview);
}   

}

Comments