• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with accessing the build-in GPS on nokia (N95)

 
crJava
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi;

i bought nokia N95 which has JSR-179 support;

however i couldn't communicate with the GPS receiver to get the location;

this is the code:

Criteria cr = new Criteria();
cr.setCostAllowed(false);
cr.setSpeedAndCourseRequired(true);
cr.setHorizontalAccuracy(500);
cr.setAltitudeRequired(true);
LocationProvider provider = LocationProvider.getInstance(cr);
Location location = provider.getLocation(30);
System.out.println("Method : " + location.getLocationMethod());
QualifiedCoordinates co = location.getQualifiedCoordinates();
if (co != null) {
System.out.println("Long: " + co.getLongitude());
System.out.println("Lat : " + co.getLatitude());
System.out.println("Alt : " + co.getAltitude());

Result:

Method : 0
Long: 0.0
Lat : 0.0
Alt : 0.0

i keep on getting zeros in the coordinates?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"crJava",

Welcome to the JavaRanch. We don't have many rules around here, but there is one rule we insist on. Despite what you might think when you see the moth-eaten moose head at the top of our forums, we like to pretend we're all professionals here. So we must insist that you follow our our naming policy (http://www.javaranch.com/name.jsp). Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic