×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    52

    Unhappy Latitude and Longitude find problem in device

    Hello everyone

    i have problem with finding latitude and longitude in Nokia N97 device , i get the Latitude and Longitude in Nokia N97 Emulator only,

    please help me anybody to get latitude and Longitude in Nokia N97 Device ,

    what type of setting is necessary for Device,

    please help me , it is really urgent


    i use following code to find latitude and Longitude
    String string;

    Location l;

    LocationProvider lp;

    Coordinates c;

    // Set criteria for selecting a location provider:

    // accurate to 500 meters horizontally

    Criteria cr= new Criteria();

    cr.setHorizontalAccuracy(500);


    // Get an instance of the provider

    lp= LocationProvider.getInstance(cr);



    // Request the location, setting a one-minute timeout

    l = lp.getLocation(60);

    c = l.getQualifiedCoordinates();
    if(c != null ) {

    // Use coordinate information

    double lat = c.getLatitude();

    double lon = c.getLongitude();

    string = "\nLatitude : " + lat + "\nLongitude : " + lon;
    Last edited by yatin_indianic; 2010-03-10 at 10:46.

  2. #2
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: Latitude and Longitude find problem in device

    GPS needs around 15 - 20 min for the first time and their are also other factor that affect GPS data like your location and whether condition
    Regards,
    Saurabh

  3. #3
    Registered User
    Join Date
    Mar 2010
    Posts
    4

    Re: Latitude and Longitude find problem in device

    Hi,

    perhaps u would like to try this variant?

    Code:
    class MyGpsTimerTask implements TimerTask, LocationListener {
    
    	private LocationProvider locProvider;
    				
    	public void run() {			
    			
    		Criteria criteria = new Criteria();
    		criteria.setHorizontalAccuracy(700);
    		criteria.setCostAllowed(true);
    		
    		locProvider = LocationProvider.getInstance(criteria);
    		locProvider.setLocationListener(this, 5, -1, -1);//<------------------------starts GPS
    			
    	}
            public void locationUpdated(LocationProvider locProv, Location loc) {
            // TODO
            }
            public void providerStateChanged(LocationProvider arg0, int newState) {
            // TODO
            }
    }

  4. #4
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,430

    Re: Latitude and Longitude find problem in device

    If you still have the issue and trying to get fix with the Java app; I would suggest to first try with the native location app in N97. It will be available through Applications > Location > GPS Data. Once you get a fix there; you can try with the Java app.

    Regards
    Gopal

  5. #5
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Latitude and Longitude find problem in device

    I guess most problems are solved when the setCostAllowed(true) method is called
    the fix can take some while, but should never ever take more than 13 minutes, then all possible data packets should have been received by the receiver... On the wikipedia article regarding GPS you can find out how that works...

  6. #6
    Registered User
    Join Date
    Mar 2010
    Posts
    4

    Re: Latitude and Longitude find problem in device

    difficulties with finding coordinates can have multiple reasons - some are:
    1. Low battery
      GPS chips still need a lot of power - if battery is low it may prevent finding coordinates
    2. Bad or no connection
      most devices use assisted GPS (AGPS) - that means the device is getting actual data concerning satellite positions from the internet. this speeds up searching for satellites - however if you have no connection this means it will take a while
    3. Bad SIM card
      in some devices it is possible to insert SIM card in a wrong way - then u have no connection and cant use AGPS
    4. Wrong time
      if your device has the wrong time this can also have great influence on finding coordinates - especially if u try to use AGPS
    5. GPS chip not integrated
      some devices have menus for supplying GPS but no integrated GPS chip - u have to connect to an external GPS mouse first in order to find coordinates
    6. Code / device specific criteria
      Not all Criteria run at all devices
    7. No Permission
      On the device the MIDlet has no GPS permission or the MIDlet is not registered at all
    8. Location/satellite constellation
      last not least the location u are trying to find coordinates can have bad influence (cellar, forest, big walls) or you are trying at a moment, when there are just very few satellites high above you
    Last edited by newPassword; 2010-03-10 at 17:18.

Similar Threads

  1. Displaying Latitude & Longitude: 2 problems
    By nstapleton in forum Symbian
    Replies: 10
    Last Post: 2009-05-26, 15:15
  2. How to get the addressInfo for a given latitude and longitude
    By m.manojkumar in forum Mobile Java General
    Replies: 2
    Last Post: 2009-04-18, 11:24
  3. Open google map site with current Longitude and Latitude
    By videoFx in forum [Archived] Flash Lite on Nokia Devices
    Replies: 3
    Last Post: 2009-04-06, 18:11
  4. Find longitude and latitude
    By kkrish in forum Symbian Tools & SDKs
    Replies: 12
    Last Post: 2008-08-21, 22:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •