• 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

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic