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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:14:25+00:00 2026-05-26T22:14:25+00:00

I am doing a location search from my android app. User enter an address

  • 0

I am doing a location search from my android app. User enter an address and I do a lookup with the following code,

 private void doSearch(String query){
    FNMApplication.logInfo("Searching:"+query);
    //create a geocoder
    Geocoder gc = new Geocoder(this,Locale.getDefault());
    try{
        //lookup locations which match the query input by the user
        List<Address> addresses = gc.getFromLocationName(query, 5, -44.00, 111.00, -12.0, 155.0);
        //if there are any results save them in an ivar for re-use
        locationSearchResults=addresses;
        promptSearch();          
    }
    catch (Exception e){
        ;
    }
}

The bounding box above is for australia but if I search for “Los Angelos” it returns results in the US. Is there something I have missed? As I see it, it should only return addresses within the bounding box as per the reference document

  • 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-26T22:14:26+00:00Added an answer on May 26, 2026 at 10:14 pm

    From the Question I tried this and the results I got are shown below.

    18.55, 72.54 = Mumbai
    22.18, 70.56 = Rajkot
    

    1)

    When I pass lower latitude vaue as left lower and search for the string I got this

    Geocoder gc = new Geocoder(this, Locale.getDefault());
            try {
    
                List<Address> addresses = gc.getFromLocationName("akshardham", 5,
                        18.55, 72.54, 22.18, 70.56);
    
                Log.i("Address", "=========0----------------------"
                        + addresses.get(0).getAddressLine(0)
                        + addresses.get(0).getAddressLine(1));
                Log.i("Address", "=========0----------------------"
                        + addresses.get(1).getAddressLine(0)
                        + addresses.get(1).getAddressLine(1));
                Log.i("Address", "=========0----------------------"
                        + addresses.get(2).getAddressLine(0));
                Log.i("Address", "=========0----------------------"
                        + addresses.get(3).getAddressLine(0));
                Log.i("Address", "=========0----------------------"
                        + addresses.get(4).getAddressLine(0));
            } catch (Exception e) {
                ;
            }
    

    Logcat of this

    11-17 12:42:32.419: INFO/Address(802): =========0----------------------AkshardhamNH 8C, Sector 20
    11-17 12:42:32.429: INFO/Address(802): =========0----------------------AkshardhamRajkot, Gujarat 360005
    11-17 12:42:32.429: INFO/Address(802): =========0----------------------Akshardham
    

    2)

    When I pass higher latitude vaue as left lower and search for the string I got this

    List<Address> addresses = gc.getFromLocationName("akshardham",5, 22.18, 70.56,18.55, 72.54 );
    

    Logcat of this

    11-17 12:43:53.170: INFO/Address(837): =========0----------------------HardhamPulborough, West Sussex RH20 1
    

    3)

    The doc here itself says “The addresses matching inside the bounding box is given higher rank.” , I think they mean to say, Its not necessary that If search string is address between this box only will be return,if they found the address they will return even if its out of bounding box.
    I Suppose;Bounding Box is just for setting the priority of result while getting means result from the box wil be first and and then other like in get(0),get(1) of the list. but the result will be given even if they are not in bounding box.

    4)

    In the Geocoder.java here they are just calling the method to get addresses with passing double values as argument simple..no any checking for the result is used there else to check the lowest and highest value

    => So final answer to you problem you just call the function as you are calling and you can check the second address line that does they matches to yours means the state or country is same. to find the country,state name of your bounding box value use getFromLocation(latitude, longitude, maxResults), I still Didn’t Find A Perfect Solution For this,So me too Searching

    => More on this can be explained by an expert (That’s I am not) or Developer from Google itself.

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

Sidebar

Related Questions

I'm doing a peer review and I've found people using window.location.search to check what
Doing an ajax get request works as expected using the following code: $.ajax({ type:
I am writing an app that requires the user's current location (lastknownlocation won't be
Right now I'm doing this: SELECT * FROM messages WHERE location_id = 7 AND
Doing my first SL4 MVVM RIA based application and i ran into the following
When I send the following query http://ajax.googleapis.com/ajax/services/search/local?v=1.0&q=coffee%20New%20York%20NY using c# WebClient.DownloadString function or ordinary web
Put this in your location bar in IE javascript:location.href='http://www.google.com/search?q=something&lt=bar' Watch in horror as it
I rewrote my search url from this domain.com/search.php?q=query&search=1 to domain.com/search.php?q=query&select=all query = search term.
I am looking for a minimalistic solution for doing basic geospatial search in Python.
On my search.php page, where users can search things by city/location, the search is

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.