1
我有一個地址,希望找到該地址的緯度和經度...有人知道怎麼樣能Lat Long網從Android的地址...我們如何才能從android中的地址找到lat?
我使用這個代碼
Geocoder coder = new Geocoder(getApplicationContext(), Locale
.getDefault());
List<Address> address;
address = coder.getFromLocationName(
"Pallekele International Cricket Stadium,Kandy, 1);
if (address == null) {
}
Address location = address.get(0);
location.getLatitude();
location.getLongitude();
GeoPoint point = new GeoPoint((int) (location.getLatitude() * 1E6),
(int) (location.getLongitude() * 1E6));
但我得到了這個例外
09-02 17:46:56.086: ERROR/Exception(1724): Service not Available
09-02 17:46:56.086: ERROR/Exception(1724): java.io.IOException: Service not Available
09-02 17:46:56.086: ERROR/Exception(1724): at android.location.Geocoder.getFromLocationName(Geocoder.java:159)
09-02 17:46:56.086: ERROR/Exception(1724): at pack.sample.map.SampleMapApplication.onCreate(SampleMapApplication.java:38)
09-02 17:46:56.086: ERROR/Exception(1724): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-02 17:46:56.086: ERROR/Exception(1724): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
09-02 17:46:56.086: ERROR/Exception(1724): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
09-02 17:46:56.086: ERROR/Exception(1724): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
09-02 17:46:56.086: ERROR/Exception(1724): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
09-02 17:46:56.086: ERROR/Exception(1724): at android.os.Handler.dispatchMessage(Handler.java:99)
09-02 17:46:56.086: ERROR/Exception(1724): at android.os.Looper.loop(Looper.java:123)
09-02 17:46:56.086: ERROR/Exception(1724): at android.app.ActivityThread.main(ActivityThread.java:4627)
09-02 17:46:56.086: ERROR/Exception(1724): at java.lang.reflect.Method.invokeNative(Native Method)
09-02 17:46:56.086: ERROR/Exception(1724): at java.lang.reflect.Method.invoke(Method.java:521)
09-02 17:46:56.086: ERROR/Exception(1724): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-02 17:46:56.086: ERROR/Exception(1724): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-02 17:46:56.086: ERROR/Exception(1724): at dalvik.system.NativeStart.main(Native Method)
我做錯了什麼?
什麼是CyanogenMod 6 alfa?它應該安裝在我的系統中嗎? – Kandha 2010-09-02 12:44:59
它現在在發佈。我感覺很幸運「CyanogenMod」:P – ankitjaininfo 2010-09-02 12:48:01
我們該如何安裝? – Kandha 2010-09-02 12:55:01