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 6123933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:04:29+00:00 2026-05-23T16:04:29+00:00

I have an issue using the Location Api. I’m trying to get the Location

  • 0

I have an issue using the Location Api. I’m trying to get the Location from any of the provider available, using this code:

//Définir ma localisation
final LocationManager manag = (LocationManager) ActivityRechercheConcession.this.getSystemService(Context.LOCATION_SERVICE);
//Choix du service de localisation en fonction de critères
Criteria crit = new Criteria();
crit.setCostAllowed(false);
crit.setAccuracy(1000); //précis à au moins 1km pret
final String choix_source = manag.getBestProvider(crit, true);
//demander la position courante
manag.requestLocationUpdates(choix_source, 10000, 0, new LocationListener(){
    //Lors de la capture de la position
    public void onLocationChanged(Location location) {
    Log.i("LocationListener","New position from "+choix_source+": ("+location.getLatitude()+","+location.getLongitude()+")");
    }
}

But when I’m sending coordinate with the Emulator Control (like long: 7.745304, lat : 48.589326)
I’m only getting the integer part in my Location data (like long 7.0, lat 48.0)
So calculation method on those value are totally false.

Why do I lose the fractional part of those data?

  • 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-05-23T16:04:29+00:00Added an answer on May 23, 2026 at 4:04 pm

    The problem was coming from Eclipse’s Emulator Control and not from the code.

    Some to resolve it I have to rightly configure the eclipse.ini by adding this line:

    -Duser.language=en
    

    corresponding to my locale so I used :

    -Duser.language=fr
    

    and afterwards I had to use “coma” instead of “dot” in value I sended.
    That way the code is running well 😀

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

Sidebar

Related Questions

We have an issue using the PEAR libraries on Windows from PHP . Pear
I have an issue with using AWK to simply remove a field from a
I have this strange issue with my web app. You see, I'm using jQuery
I'm new to the facebook api, and i have a small issue. I'm trying
I have an issue using the GPS emulator provided by microsoft. This is my
I have the following issue using java 1.4 I try to display a very
I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but
I have an issue that is driving me a bit nuts: Using a UserProfileManager
From Java, I'm extracting an executable into a location specified using File.createTempFile(). When I
I have a RESTful API set up and working with CakePHP using mapResources() and

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.