• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Location Exception while using GPS(Location API)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:

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

Code:

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

}

}

Please suggest me any solution for this...

Thank and regards.
 
Looky! I'm being abducted by space aliens! Me and this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic