如何在黑莓中使用谷歌地图与路线。我尝试了黑莓地图与路线,但在我的设备(风暴2)不能显示地图。我不知道是什么问题?
任何人都有想法在黑莓应用程序中使用谷歌地图而不是让我知道。
我试过这个http://maps.google.com/maps?saddr=23.4444,72.44445&daddr=23.55555,72.55555
并在BB浏览器中打开此URL但它无法重定向到地图网站。
如何在BB应用程序中使用路径处理谷歌地图或黑莓地图?
答案 0 :(得分:3)
我已经通过谷歌地图安装应用程序在黑莓手机中实现了谷歌地图路线。
public void invokeGoogleMap() {
int mh = CodeModuleManager.getModuleHandle("GoogleMaps");
if (mh == 0)
{
try
{
throw new ApplicationManagerException("GoogleMaps isn't installed");
}
catch (ApplicationManagerException e)
{
System.out.println(e.getMessage());
}
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
stubDialog.inform("GoogleMaps isn't installed on your device.download it from m.google.com/maps.");
}
});
}
else
{
URLEncodedPostData uepd = new URLEncodedPostData(null, false);
uepd.append("action", "ROUT"); // or LOCN
uepd.append("start", "23.039568,72.566005");
uepd.append("end", "23.02,73.07");
String[] args = { "http://gmm/x?" + uepd.toString() };
ApplicationDescriptor ad = CodeModuleManager.getApplicationDescriptors(mh)[0];
ApplicationDescriptor ad2 = new ApplicationDescriptor(ad, args);
try
{
ApplicationManager.getApplicationManager().runApplication(ad2, true);
}
catch (ApplicationManagerException e)
{
System.out.println(e.getMessage());
}
}
}
答案 1 :(得分:2)
Blackberry浏览器功能不足以让java脚本在浏览器字段中显示路由信息。相反,您必须使用Blackberry地图。为此,以下链接将为您提供帮助。