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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:15:19+00:00 2026-06-17T10:15:19+00:00

Possible Duplicate: Android – Get Altitude By Longitude and Latitude? I require altitude for

  • 0

Possible Duplicate:
Android – Get Altitude By Longitude and Latitude?

I require altitude for particular location from latitude and longitude.Any help would be highly appreciated.

  • 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-17T10:15:21+00:00Added an answer on June 17, 2026 at 10:15 am

    I have tried the Below Way in my application for getting Altitude from Lat/Long. you can try it out if it helps you.

    private double getAltitudeFromLatLong(Double lat, Double long) {
        double result = 0.0;
        HttpClient httpClient = new DefaultHttpClient();
        HttpContext Context = new BasicHttpContext();
        String URL = "http://gisdata.usgs.gov/"
                + "xmlwebservices2/elevation_service.asmx/"
                + "getElevation?X_Value=" + String.valueOf(long)
                + "&Y_Value=" + String.valueOf(lat)
                + "&Elevation_Units=METERS&Source_Layer=-1&Elevation_Only=true";
        HttpGet httpGet = new HttpGet(URL);
        try {
            HttpResponse response = httpClient.execute(httpGet, Context);
            HttpEntity entity = response.getEntity();
            if (entity != null) {
                InputStream instream = entity.getContent();
                int r = -1;
                StringBuffer respStr = new StringBuffer();
                while ((r = instream.read()) != -1)
                    respStr.append((char) r);
                String tag1 = "<double>";
                String tag2 = "</double>";
                if (respStr.indexOf(tag1) != -1) {
                    int start = respStr.indexOf(tag1) + tag1.length();
                    int end = respStr.indexOf(tag2);
                    String value = respStr.substring(start, end);
                    result = Double.parseDouble(value);
                }
                instream.close();
            }
        } 
        catch (Exception e) {}
        return result;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Android Launch an application from another application I am having a problem
Possible Duplicate: Dynamic Resource Loading Android In Android, I can load a string from
Possible Duplicate: Android : Location.distanceTo not working correctly? I am trying to calculate the
Possible Duplicate: Android Button Tooltip Is there any way to construct a view where
Possible Duplicate: Android: how to cancel a request of Location update with intent? I
Possible Duplicate: Android Toast started from Service only displays once I'm using Service Android
Possible Duplicate: android reading from a text file So I need to load text,
Possible Duplicate: Android: How to get values in under specific xml tags Hi guys,
Possible Duplicate: Android - get path of resource I need to know the string
Possible Duplicate: android.os.NetworkOnMainThreadException When I try to run my 2nd Activity from a Listener

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.