api - Google Earth Plugin for Android -
i trying add map of moon on phonegap / android app.
when try use google earth api on app, receive following error:
the google earth plugin available on windows , mac os x 10.6+.
is there alternative way, maybe api, create map of moon on mobile device.
there not current published api's google earth android version. current version handle search intents. can launch google earth in android , fly location following intent: please keep in mind google change @ time , following code might not work.
// new intent launch intent myintent = new intent(); // send intent directly google earth activity can handle search myintent.setclassname("com.google.earth", "com.google.earth.earthactivity"); // doing search query myintent.setaction(intent.action_search); // change address address want fly myintent.putextra(searchmanager.query, "2900 frenchmen street, new orleans, la"); // trap activitynotfound in case google earth not on device try { // launch google earth , fly location this.startactivity(myscanintent); } catch (activitynotfoundexception e) { showgoogleearthdialog(); } ... // if user not have google earth prompt download private void showgoogleearthdialog() { alertdialog.builder downloaddialog = new alertdialog.builder(this); downloaddialog.settitle("install google earth?"); downloaddialog.setmessage("this application requires google earth. install it?"); downloaddialog.setpositivebutton("yes", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialoginterface, int i) { uri uri = uri.parse("market://search? q=pname:com.google.earth"); intent intent = new intent(intent.action_view, uri); mainactivity.this.startactivity(intent); } }); downloaddialog.setnegativebutton("no", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialoginterface, int i) {} }); downloaddialog.show(); }
Comments
Post a Comment