I am working on nokia asha skd1.1 with lwuit 1.5.I get the current latitude and longitude in my project which is working well in nokia 502.But when i use this same code in nokia sdk2.0 and nokia 310 cell phone it give an exception which is given below
Code:
 javax.microedition.location.LocationException
My complete code is given below
Code:
try 
	        {
			  
	        1.	System.out.println("in try block.............");
	        2.	criteria = new Criteria();
	        3.	System.out.println("first lineeeeeeeeeeeeeeeeeeeeeeeee");
		4.       criteria.setHorizontalAccuracy(500);
		5.        System.out.println("second lineeeeeeeeeeeeeeeeeeeeeeeee");
	        6.   locationProvider = LocationProvider.getInstance(criteria);
	        7.    System.out.println("third lineeeeeeeeeeeeeeeeeeeeeeeee");
	                    
	            try
	            {
	          	System.out.println("tryyyyyyyyyyyyyyyyy");
					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) 
	            {
	                // Use coordinate information 
	            	System.out.println("value of cordinates are...."+coordinates);
	            	
	                currentlat = coordinates.getLatitude();
	            	
	                System.out.println("currentlat 888888    "+currentlat);
	             
	                 currentlong = coordinates.getLongitude();
	            
	                 System.out.println("currentlong 888888    "+currentlong);
	            
	                latlong = "\nLatitude : " + currentlat + "\nLongitude : " + currentlong;
	            } 
	            else
	            {
	            	System.out.println("Location API failed.................");
	            	latlong = "Location API failed";
	            }
	        } 
		  
	        catch (LocationException e)
	        {
	            //TODO: Handle location exception.
	        	System.out.println("exception in getloaction method.."+e);
	           
	        }
My code is running upto 5th line in nokia sdk2.0 but when control comes to 6 lines it give exception as i discussed.