Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raczo/smarty-streets-autocompletetextview
Gradle library. Android AutocompleteTextView that receives and displays address suggestions from Smarty Streets.
https://github.com/raczo/smarty-streets-autocompletetextview
android autocompletetextview gradle library smartystreets
Last synced: about 1 month ago
JSON representation
Gradle library. Android AutocompleteTextView that receives and displays address suggestions from Smarty Streets.
- Host: GitHub
- URL: https://github.com/raczo/smarty-streets-autocompletetextview
- Owner: RacZo
- License: apache-2.0
- Created: 2017-02-19T00:27:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-30T20:11:57.000Z (over 7 years ago)
- Last Synced: 2024-11-11T09:48:34.674Z (3 months ago)
- Topics: android, autocompletetextview, gradle, library, smartystreets
- Language: Java
- Homepage:
- Size: 142 KB
- Stars: 21
- Watchers: 2
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Smarty Streets AutoCompleteTextView
[ ](https://bintray.com/raczo/maven/smartystreetsautocomplete/1.0.1/link) [](https://android-arsenal.com/details/1/5338) [](http://mvnrepository.com/artifact/com.oscarsalguero/smartystreetsautocomplete/1.0.1)
Gradle library. Android AutoCompleteTextView that receives and displays US address suggestions from SmartyStreets's [US Autocomplete API](https://smartystreets.com/docs/cloud/us-autocomplete-api "US Autocomplete API").
[SmartyStreet's Android SDK](https://smartystreets.com/docs/sdk/android "SmartyStreet's Android SDK") does not offer address suggestions, it only offers address verification and zip code lookup.
## Demo
Yes, there is a demo app!
Demo app repository: https://github.com/RacZo/SmartyStreets-AutoComplete-Demo
## Dependencies
If your app is already using the following SUPER AWESOME libraries:
1. Google's Gson version 2.8.0 https://github.com/google/gson
2. Square's okhttp version 3.6.0 https://github.com/square/okhttp
3. Square's okhttp-logging-interceptor version 3.6.0 https://github.com/square/okhttp/tree/master/okhttp-logging-interceptoryou are set! If not, add the following to your app's build.gradle:
```groovy
compile 'com.google.code.gson:gson:2.8.'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
```## Installation
Via Gradle, by putting the following in your build.gradle:
```groovy
compile 'com.oscarsalguero:smartystreetsautocomplete:1.0.1'
```Or Maven:
```xml
com.oscarsalguero
smartystreetsautocomplete
1.0.1
pom```
## Usage
1. Sign up for an account on https://smartystreets.com and create a Website key (API key).
2. Do not forget to add `````` to your app's Manifest.xml.
3. Create an adapter class called "AddressAutocompleteAdapter" and make it extend "AbstractAddressAutocompleteAdapter", implement the required methods and define a layout for the dropdown item (R.layout.dropdown_text_item).
4. You will need your API key and a "referer" (host you entered when you created your key). The referer in your app must have "https://" as prefix or the API won't work.
```xml
```5. To capture the address selection (when the user taps a suggestion) you'll use the provided listener:
```java
autoCompleteTextView.setOnAddressSelectedListener(new OnAddressSelectedListener() {
@Override
public void onAddressSelected(@NonNull Address address) {
}
});
```And... voilà!
### Contributing
1. Fork this repo and clone your fork. Create an empty file called "bintray.gradle" in the root of your project.
2. Make your desired changes
3. Add tests for your new feature and ensure all tests are passing
4. Commit and push
5. Submit a Pull Request through Github's interface and I'll review your changes to see if they make it to the next release.### Issues
Use this repo's github issues.
### Based On
SeatGeek's autocomplete library for Google Places https://github.com/seatgeek/android-PlacesAutocompleteTextView and the fact SmartyStreet's Android SDK does not offer address suggestions.
License
=======Copyright 2017 Oscar Salguero
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.