google-places-api

java.lang.IllegalStateException: Places must be initialized

巧了我就是萌 提交于 2019-12-01 18:21:39
问题 I was using the old Place SDK which was working fine But it is going to be depreciated and I move to new place SDK. I got keep the crashing report from a few devices. Crashes Report: Fatal Exception: java.lang.RuntimeException Unable to start activity ComponentInfo{com.islamuna.ramadan/com.google.android.libraries.places.widget.AutocompleteActivity}: java.lang.IllegalStateException: Places must be initialized. SDK version: implementation 'com.google.android.libraries.places:places:1.1.0' Even

java.lang.IllegalStateException: Places must be initialized

微笑、不失礼 提交于 2019-12-01 17:55:13
I was using the old Place SDK which was working fine But it is going to be depreciated and I move to new place SDK. I got keep the crashing report from a few devices. Crashes Report: Fatal Exception: java.lang.RuntimeException Unable to start activity ComponentInfo{com.islamuna.ramadan/com.google.android.libraries.places.widget.AutocompleteActivity}: java.lang.IllegalStateException: Places must be initialized. SDK version: implementation 'com.google.android.libraries.places:places:1.1.0' Even i initialize Place sample code: Places.initialize(getApplicationContext(), "mykey", Locale.US);

Google places API, get user addresses

空扰寡人 提交于 2019-12-01 17:29:10
问题 I have been struggling with Google Places API , I need to use the Address API. I used the autoComplete and the placePicker APIs just fine, for some reason the Address API is not working. I have tried looking through this https://developers.google.com/android/reference/com/google/android/gms/identity/intents/Address but I couldn't figure out how to use the addApi() for the Address API. If someone could provide some example code or something to get me started it would be highly appreciated.

GooglePlaces API “Response That We Couldn't Understand” Error

拈花ヽ惹草 提交于 2019-12-01 17:19:19
Using the standard autocomplete code with a searchbar: placesClient.autocompleteQuery(searchBar.textField.text!, bounds: nil, filter: filter, callback: {(results, error) -> Void in if let error = error { print("Autocomplete error \(error)") return } if let results = results { for result in results { print("Result \(result.attributedFullText) with placeID \(result.placeID)") self.predictions.append(result) } } self.placesTableView.reloadData() }) Has been working for months and tonight it started reporting this error: Autocomplete error Error Domain=com.google.places.ErrorDomain Code=-2 "The

GooglePlaces API “Response That We Couldn't Understand” Error

烂漫一生 提交于 2019-12-01 17:00:38
问题 Using the standard autocomplete code with a searchbar: placesClient.autocompleteQuery(searchBar.textField.text!, bounds: nil, filter: filter, callback: {(results, error) -> Void in if let error = error { print("Autocomplete error \(error)") return } if let results = results { for result in results { print("Result \(result.attributedFullText) with placeID \(result.placeID)") self.predictions.append(result) } } self.placesTableView.reloadData() }) Has been working for months and tonight it

Google Places API : Page Token Errors

人盡茶涼 提交于 2019-12-01 16:48:45
问题 I'm basically querying the google places API for stores in atlanta. https://maps.googleapis.com/maps/api/place/search/json?location=33.7488,-84.3874&radius=50000&sensor=false&key=YOUR_KEY_HERE&types=amusement_park|art_gallery|bakery|bar|beauty_salon|bicycle_store|book_store|bowling_alley|cafe|car_repair|car_wash|clothing_store|florist|furniture_store|gym|hair_care|home_goods_store|jewelry_store|laundry|liquor_store|museum|night_club|pet_store|pharmacy|restaurant|shoe_store|spa|store

Google Places API types functionality..

丶灬走出姿态 提交于 2019-12-01 16:42:38
<html> <head> <title></title> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=true"></script> <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { var input = document.getElementById('location'); var options = { types: ["locality"] }; autocomplete = new google.maps.places.Autocomplete(input, options); }); </script> </head> <body> <div>Location: <input type="text" id="location" style="width:400px;" /></div> </body> </html> There is my code to generate my autocomplete location

Places API for Android: get addres lines from Place.getAddress()

这一生的挚爱 提交于 2019-12-01 15:30:10
In my android app, I find the address of locations using Geocoder.getFromLocation() . I can get an Address object and get the address lines of an address with Address.getAddressLine() . I am only interested in the first address line, which I can get easily with Address.getAddressLine(0) . Also, app allows user to choose locations using PlaceAutocomplete . When user chooses a location, I receive a Place object and I can get the address by Place.getAddress() . The problem is, Place.getAddress() returns a string instead of an Address object. This string contains the full address, so I cannot

Paging on Google Places API returns status INVALID_REQUEST

♀尐吖头ヾ 提交于 2019-12-01 14:50:45
问题 I'm using the Google Place API for place search: https://developers.google.com/places/documentation/search After the first query of the api, I'm getting the next page by setting the pagetoken. If I wait 2 seconds between requests, it works, but I notice that if I make the next query right after the previous one, it returns the status INVALID_REQUEST. Is this some kind of rate limiting? I don't see this anywhere in the documentation. https://developers.google.com/places/usage Since each

ANDROID PLACE_PICKER (builder.build(context)

狂风中的少年 提交于 2019-12-01 13:53:11
Basically I am trying to implement a PLACE_PICKER for Android and I am getting this confusing error here: int PLACE_PICKER_REQUEST = 1; PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder(); Context context = getApplicationContext(); startActivityForResult(builder.build(context), PLACE_PICKER_REQUEST); The error is coming in line 4:" (builder.build(context), " and I have no idea why, I am getting this down below it as an error: Unhandled exception: com.google.android.gms.common.GooglePlayServicesRepairableException, com.google.android.gms.common