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

  • SEARCH
  • Home
  • 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 7848241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:07:57+00:00 2026-06-02T18:07:57+00:00

I am and Android/Java newbie and am having trouble creating a GeoPoint when I

  • 0

I am and Android/Java newbie and am having trouble creating a GeoPoint when I try to send it a variable, but it woks fine when I send it a literal value.

In the below code block, The toast message displays the correct latitude (retrieved from the strings.xml

How can I set the Latitude using a variable?

Integer intLat = Integer.valueOf(R.string.MexCityLat);
Toast.makeText(HelloGoogleMapsActivity.this, intLat, Toast.LENGTH_SHORT).show();

GeoPoint point = new GeoPoint(intLat , -99120000);  //this puts my point near North Pole
//GeoPoint point = new GeoPoint(19240000, -99120000);  //this puts my point in Mexico City

OverlayItem overlayitem = new OverlayItem(point, "Hola, Mundo!", "I'm in Mexico City!");
  • 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-02T18:07:59+00:00Added an answer on June 2, 2026 at 6:07 pm

    GeoPoint

    public GeoPoint(int latitudeE6,int longitudeE6)
    

    Constructs a GeoPoint with the given latitude and longitude, measured in microdegrees (degrees * 1E6).

    Parameters:

     latitudeE6 - The point's latitude. This will be clamped to between -80 degrees and +80 degrees inclusive, in order to maintain accuracy in the Mercator projection.
     longitudeE6 - The point's longitude. This will be normalized to be greater than -180 degrees and less than or equal to +180 degrees.
    

    Also refer this link for how to convert double,float to geopoint. and be sure you are getting right value for intLat

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

Sidebar

Related Questions

I'm a completely newbie to android programming, having done some java for my computing
I am newbie in android development. I am good at Java, but not Android
I am a newbie to Android and Java and want to write a function
So in Android/Java, I need to access a global variable that is an EditText[]
I am newbie in java/android. I am a c/c++ developer. May i know how
I am a newbie to java and android world, and I want to use
I'm a newbie in both Java and Android and I'm trying to figure out
I am a total newbie when it comes to both java and android coding.
I am a newbie to android and java. I am trying to make an
I know Java apps can be run in Android. But what I want to

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.