This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Location Exception while using GPS(Location API)  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have downloaded google map application on T715 mobile its working fine,its java application.So as per my understanding that is also using Location API.

So I am tried below code in j2me using Location API(JSR-179).Its working fine on emulator.
But when I am trying the same on Sony erisccon T715 mobile its giving below exception:

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


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();

if (c != null) {
// use coordinate information
double lat = c.getLatitude();

latitude = ""+lat;
double lon = c.getLongitude();
longitude =""+lon;
catch (LocationException e) {
alert = new Alert("LocationException");
alert.setString("Unable to retrive location information:" + e);
// not able to retrive location information
} catch (InterruptedException ie) {
alert = new Alert("InterruptedException");
alert.setString("Operation Interrupted:" + ie);



Please suggest me any solution for this...

Thank and regards.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!