开发者

Where to write JavaScript in my android Program

From last 2 weeks I am searching for an answer but not getting a bit of success. My scenario is, I am using Eclipse for developing Android apps. I want to display route directions (Driving, Walking, Bicycling) between two dynamically entered addresses on Google Maps... I want to make use of Google Maps JavaScript API V3 Services, because of all its awesome functionalities... http://code.google.com/apis/maps/documentation/javascript/services.html#Directions开发者_JS百科

I was suggested by some developers on Stack Overflow and they gave this link http://code.google.com/intl/en/apis/maps/articles/android_v3.html#why But this site has code that uses some JavaScripts in the code, if this site is having the correct stuff, where am I supposed to write JavaScript in my eclipse android app because AFAIK code written in eclipse uses only Java framework.. If that site is not a good bet give me some other links that demonstrates with examples...


I am not sure I follow you. On the link provided earlier on SO, I see the Java code: http://code.google.com/intl/en/apis/maps/articles/android_v3.html#why

That actually uses Android SDK support for Google Maps. If you still want to use the Javascript, you will have to go through WebView. I would otherwise recomment the way it is followed here: http://code.google.com/intl/en/android/add-ons/google-apis/maps-overview.html

This page was linked to the previous link mentioned above and it uses Java not Javascript.


You do not need to worry about javascript. The MAP_URL (http://gmaps-samples.googlecode.com/svn/trunk/articles-android-webmap/simple-android-map.html) in WebMapActivity has this javascript in the page. So Either you can write your own html page with that javascript (hosted on your server) or you can simply load the MAP_URL into your webview without worrying about javascript.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜