Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Cannot get location like google maps on Phone

Cannot get location like google maps on Phone

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Cannot get location like google maps on Phone

Postby nguyenhonglam » Fri Apr 02, 2010 4:41 am

I use SamSung i5700, (sdk 3)
my code to get location by GPS

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public GeoPoint get_GeoPoint_Phone() {
  3.  
  4.                 locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
  5.  
  6.                 Criteria criteria = new Criteria();
  7.  
  8.                 criteria.setAccuracy(Criteria.ACCURACY_FINE);
  9.  
  10.                 criteria.setAltitudeRequired(false);
  11.  
  12.                 criteria.setBearingRequired(false);
  13.  
  14.                 criteria.setCostAllowed(true);
  15.  
  16.                 criteria.setPowerRequirement(Criteria.POWER_LOW);
  17.  
  18.  
  19.  
  20.                
  21.  
  22.                 if (locationManager == null)
  23.  
  24.                         return null;
  25.  
  26.                
  27.  
  28.                 String provider = locationManager.getBestProvider(criteria, true);
  29.  
  30.                 Double latPoint = locationManager.getLastKnownLocation(provider).getLatitude();
  31.  
  32.                 Double lngPoint = locationManager.getLastKnownLocation(provider)
  33.  
  34.                                 .getLongitude();
  35.  
  36.                 locationManager.requestLocationUpdates(provider,MapControler.minTime, MapControler.minDistance, this);
  37.  
  38.                 GeoPoint gp = new GeoPoint((int) (latPoint * 1E6),
  39.  
  40.                                 (int) (lngPoint * 1E6));
  41.  
  42.  
  43.  
  44.                 return gp;
  45.  
  46.         }
  47.  
  48.  
Parsed in 0.011 seconds, using GeSHi 1.0.8.4

my code usually get old location (same "cache"), how to solve above problem?, thanks
nguyenhonglam
Freshman
Freshman
 
Posts: 7
Joined: Wed Feb 24, 2010 2:39 am

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 6 guests