×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    May 2014
    Posts
    11

    how to get current latitude and longitude without net/wifi

    Hello,i am working on nokia asha sdk1.0 with using lwuit 1.5.So i need current latitude and longitude in my app.so my problem is that when wifi enable my code gives correct value of both but when i disable wifi it give zero values so please tell me what is reason .My code is given below
    Code:
    			 //double dis1,dis2,dis3,dis4,dis5,dis6;
    			  
    			  Criteria criteria;
    				Location location = null;
    				LocationProvider locationProvider;
    				QualifiedCoordinates coordinates;
    	        	System.out.println("in try block.............");
    	        	criteria = new Criteria();
    	        	criteria.setHorizontalAccuracy(500);
    		      locationProvider = LocationProvider.getInstance(criteria);
    	              try
    	            {
    	          	
    					location = locationProvider.getLocation(60);
    				}
    	            catch (InterruptedException e)
    	            {
    	            	
    					// TODO Auto-generated catch block
    	            	System.out.println("exception in location provider.."+e);
    				
    				}
    	            
    	            coordinates = location.getQualifiedCoordinates();
    	            if (coordinates != null) 
    	            {
    	               System.out.println("value of cordinates are...."+coordinates);
    	            	
    	                currentlat = coordinates.getLatitude();
    	            	   currentlong = coordinates.getLongitude();
    	                latlong = "\nLat" + currentlat + "\nLong" + currentlong;
    	                
    	            } 
    	            else
    	            {
    	            	System.out.println("Location API failed.................");
    	            	latlong = "Location API failed";
    	            }
    So please tell me how i can get current latitude and longitude without using Wifi.
    Thanks

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: how to get current latitude and longitude without net/wifi

    What device are you testing with?

  3. #3
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,569

    Re: how to get current latitude and longitude without net/wifi

    A thing to note is that if network-based location services are not available, then the device must have a GPS (or other satellite-technology) hardware, and the software/APIs must support use of it. It is, then hardware/platform dependent. Without knowing the actual hardware used, it is hard to say much more (i.e., as wizard_hu said: What device are you testing with?)

  4. #4
    Registered User
    Join Date
    May 2014
    Posts
    11

    Re: how to get current latitude and longitude without net/wifi

    Thanks for reply,I am using nokia ahsa 502.

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: how to get current latitude and longitude without net/wifi

    The specification page, http://developer.nokia.com/devices/d...nokia-asha-502 indeed tells that the device has CellID and WiFi positioning only.
    (Positioning methods are listed in the "Extra Features" category)

  6. #6
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,569

    Re: how to get current latitude and longitude without net/wifi

    And note that with CellID-based positioning, the network operator (carrier) must cooperate; i.e., the network operator must provide service APIs to use the network based location information to provide location coordinates, and the phone software/runtime must know how to call those operator services. Just obtaining the CellID number doesn't specify a location, as it is just an identifier for the cellular network basestation the phone is connected to (only the network operator knows where, exactly, the basestation resides physically, and can also based on the CellID and other information available to it, determine an approximate location.

    To some extent, if Nokia Maps/HERE has collected/crowdsourced automatically more accurate information in their databases, then just by having the CellID and perhaps signal-strength, the the Nokia Maps/HERE service might approximate the location on its own without direct cooperation by the network operator. Of course, still, the phone's Java location API runtime would have to be written so that it knows how to talk to the Nokia Maps/HERE service. I'm not sure if Nokia has done such a thing in the phone firmware, or reserved such support (if any) just to their own Maps/HERE software.

    In other words, I guess you have to live with: If you need the location info in your app on the phone model in question, keep WiFi on (instruct the phone user to keep it on), and if WiFi is off, accept the fact that no location info will then be available (and write your app so that it reports this correctly to the phone user, too). Note also that even with WiFi, the positioning won't be as accurate as with GPS.

Similar Threads

  1. Exception in getting current latitude and longitude in nokia sdk2.0
    By vikranttanwar@ in forum Mobile Java General
    Replies: 0
    Last Post: 2014-04-08, 06:59
  2. Set Latitude and Set Longitude
    By sridharbandi in forum Mobile Java General
    Replies: 6
    Last Post: 2010-12-15, 13:21
  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. Latitude/Longitude on map
    By piterr1410 in forum Mobile Java General
    Replies: 10
    Last Post: 2008-07-08, 16:55

Posting Permissions

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