Java 使用GPS时发生位置异常(位置API)

Java 使用GPS时发生位置异常(位置API),java,java-me,geolocation,Java,Java Me,Geolocation,我已经在SonyerricsomT700手机上下载了谷歌地图应用程序,它的工作很好,它的java应用程序。据我所知,它也在使用定位API。 这表明它没有GPS。 但它正在显示地图,甚至在谷歌地图上定位照片被点击的设备 所以我尝试了以下j2me中使用Location API(JSR-179)的代码。它在emulator上运行良好。 但当我在索尼erisccon T700手机上尝试相同的功能时,它给出了以下例外: 例外情况: javax.microedition.location.LocationE

我已经在SonyerricsomT700手机上下载了谷歌地图应用程序,它的工作很好,它的java应用程序。据我所知,它也在使用定位API。 这表明它没有GPS。 但它正在显示地图,甚至在谷歌地图上定位照片被点击的设备

所以我尝试了以下j2me中使用Location API(JSR-179)的代码。它在emulator上运行良好。 但当我在索尼erisccon T700手机上尝试相同的功能时,它给出了以下例外:

例外情况:

javax.microedition.location.LocationException:All service providers are out of service.
代码:

请给我建议任何解决这个问题的方法

谢谢和问候

是的,我打赌这不是你从全球定位系统得到的准确位置


谷歌有其他方法来找到你的位置。。。很可能是使用了手机ID。幸运的是,索尼爱立信手机很容易从中找到手机ID,请参阅。一旦你有了它,你就可以在地图上查找它以找到位置。

是的,它没有给出GPS中的准确位置。它只是在地图上显示城市。那么我如何才能获得设备的对数lat。我通常想为诺基亚、三星、,LG等。请帮助我。感谢回复。我已经解释了如何使用手机ID为索尼爱立信实现这一点。不幸的是,没有通用方法可以从所有手机中获取此信息。
try {

// Create a Criteria object for defining desired selection criteria
Criteria cr = new Criteria();
LocationProvider lp = LocationProvider.getInstance(cr);    
l = lp.getLocation(60);    
c = l.getQualifiedCoordinates();    
//cityMap.setCategories(selectedCategories);
if (c != null) {
// use coordinate information
double lat = c.getLatitude();    
//latitude="";
latitude = ""+lat;
Latitude.setString(latitude);
double lon = c.getLongitude();
longitude =""+lon;
Longitude.setString(longitude);
}
}
catch (LocationException e) {
alert = new Alert("LocationException");
alert.setString("Unable to retrive location information:" + e);
alert.setTimeout(2000);
display.setCurrent(alert);
// not able to retrive location information
//e.printStackTrace();
} catch (InterruptedException ie) {
alert = new Alert("InterruptedException");
alert.setString("Operation Interrupted:" + ie);
alert.setTimeout(2000);
display.setCurrent(alert);    
}    
}