×

Discussion Board

Results 1 to 3 of 3

Threaded View

  1. #1
    Regular Contributor
    Join Date
    Sep 2012
    Location
    Morocco
    Posts
    298

    Fast way to get User's Location (and city name)

    Hello,

    I'd like to know if there is a faster way to get users' location I'm using the code below, and I find it a little slow about 2-5 seconds to get a location
    Code:
            public async Task<Geoposition> UserLocation()
            {
                Geolocator geolocator = new Geolocator();
                geolocator.DesiredAccuracyInMeters = 50;
    
                try
                {
                    Geoposition geoposition = await geolocator.GetGeopositionAsync(
                        maximumAge: TimeSpan.FromMinutes(5),
                        timeout: TimeSpan.FromSeconds(10)
                        );
                    return geoposition;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
    
            }
    And also is there a way to get the location's city name in offline mode, ("Microsoft.Phone.Maps.Services" needs internet connexion.)

    Thank you,
    Last edited by Loukt; 2013-02-26 at 04:47. Reason: Corrected a code error

Similar Threads

  1. Replies: 2
    Last Post: 2011-05-06, 13:50
  2. Fast Tapping in 5800 -> user 130
    By Kaz32 in forum Symbian
    Replies: 3
    Last Post: 2009-12-07, 11:10
  3. City and Country - User Profile
    By antonio5982 in forum Mobile Java General
    Replies: 7
    Last Post: 2009-02-13, 13:23
  4. Show location/City information while application launch.
    By gangaraju in forum Symbian Tools & SDKs
    Replies: 4
    Last Post: 2008-09-19, 12:24

Posting Permissions

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