aspose file tools*
The moose likes Java Micro Edition and the fly likes Problem with accessing the build-in GPS on nokia (N95) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Problem with accessing the build-in GPS on nokia (N95) " Watch "Problem with accessing the build-in GPS on nokia (N95) " New topic
Author

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

crJava
Greenhorn

Joined: Mar 11, 2008
Posts: 1
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

Joined: Jun 25, 2001
Posts: 16250
    
  21

"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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with accessing the build-in GPS on nokia (N95)