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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:35:15+00:00 2026-05-27T21:35:15+00:00

Hey Guys I have four integer array lists which were created after parsing a

  • 0

Hey Guys I have four integer array lists which were created after parsing a json file:

            JSONObject o = new JSONObject(s);
    JSONObject c = new JSONObject(s);
    JSONArray a = o.getJSONArray("posts");
    o = a.getJSONObject(0);
    c = a.getJSONObject(1);
    lat.add((int) (o.getDouble("Latitude")* 1E6));
    lng.add((int) (o.getDouble("lontitude")* 1E6));
    lat1.add((int) (c.getDouble("Latitude")* 1E6));
    lon1.add((int) (c.getDouble("lontitude")* 1E6));

In the long run I would like to loop through these lists to get all the longitude and latitude values, but for now I am getting the 1st two values. My problem is that the application force closes and I think their is something wrong when I create the geocodes:

            GeoPoint point = new GeoPoint( (int) lat.get(1), (int) lng.get(1));
    OverlayItem overlayitem = new OverlayItem(point, "", "");
    GeoPoint point1 = new GeoPoint((int) lat1.get(1), (int) lon1.get(1));
    OverlayItem overlayitem1 = new OverlayItem(point1, "", "");

If anyone could knows what im doing wrong it would be a great help thanks

  • 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-27T21:35:16+00:00Added an answer on May 27, 2026 at 9:35 pm
    double latiude[] = null;
    double longitude[] = null;
     JSONObject  json=JSONFunction.getJSONfromURL(Url);
     try{ 
        JSONArray  JArray = json.getJSONArray("results");  
          latitude = new double[jArray.length/size()];
          longitude = new double[jArray.length/size()];
          Log.v(TAG, "getting results"); 
        for(int i=0;i<JArray.length();i++)
         {
                JSONObject e = JArray.getJSONObject(i); 
                JSONObject location1=e.getJSONObject("geometry").getJSONObject("location");  
                latitude[i]=location1.getDouble("lat"); 
                longitude[i]=location1.getDouble("lng"); 
          }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys i have created an app which is hosted in my localhost. No
Hey guys, I have created a tree which is not a binary tree. Now,
Hey guys i have the string: /new/krymson/ currently i have the regex: /\/new\// which
Hey guys I have an assigned array from mysql results and I simply want
Hey Guys, i have created the following Menu Structure: <div id=menu> <ul> <li><a href=#>Main
Hey guys! I have this little problem: I have one ViewController which adds 2
Hey guys. I have a method that gets called each second which I want
Hey guys, I have a GridView which is binded to SqlDataSource, everything works fine,
hey guys, i have created a stored procedure, wherein i have datetime field in
Hey guys I have the following while loop which seems not to stop. It's

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.