Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8317349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:34:20+00:00 2026-06-08T21:34:20+00:00

i am getting data from gps provider using mylocation class. code is this: MyLocation.LocationResult

  • 0

i am getting data from gps provider using mylocation class. code is this:

MyLocation.LocationResult locationResult = new MyLocation.LocationResult() {
        @Override
        public void gotLocation(Location location) {
            //Got the location!

            // for phone
            //currentLocation = new GeoPoint((int) (location.getLatitude() * 1000000),
            //   (int) (location.getLongitude() * 1000000));

            // for emulator
            currentLocation = new GeoPoint((int) (location.getLatitude()),
                    (int) (location.getLongitude()));

            doSomething();

        }
    };
    MyLocation myLocation = new MyLocation();
    myLocation.getLocation(this, locationResult);

when i use the app in emulator(2.3.3) it shows the correct location without multiplying anything.

but when i use it in a device(4.0) lat and lon need to multiplied with 1000000. i couldn’t find why. i don’t think its because of the version of android. anyone have any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:34:21+00:00Added an answer on June 8, 2026 at 9:34 pm

    Because the MapView uses microdegress for its units so you need to multiply by 1e6. Otherwise you show up off the coast of Africa – basically lat long of approximately 0,0

    From the documentation on GeoPoint:

    An immutable class representing a pair of latitude and longitude, stored as integer numbers of microdegrees.

    Don’t know why the emulator is working – it shouldn’t.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im getting data from a server by executing this code: - (void) sendGeneral:(NSString *)
I have problems getting data from grails using extjs. My Grails controller code is:
I am getting data from iphone using php but when i insert post data
I have the following two methods for getting data from my database: - (void)
What are the differences between using SqlDataAdapter vs SqlDataReader for getting data from a
This is a basically gps application where i am getting the latitude information from
There is an example of getting data from form using mapper in official quickstart
It is like continue getting data from mysql using PHP and simultaneously stream out
I need some help getting data from several tables. This is the tables I
Setup: I'm looking for insight into using a ABPersonViewContoller without getting data from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.