GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - arbitur/Geocoding-Android: Java wrapper for Google's Geocoding API for Android

This repository was archived by the owner on Apr 2, 2025. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
app
app
 
 
geocoding
geocoding
 
 
gradle/wrapper
gradle/wrapper
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Geocoding-Android

This is a Java wrapper for Google's Geocoding Web API

Install

Root build.gradle

allprojects {
	repositories {
		maven { url 'https://jitpack.io' }
	}
}

Module build.gradle

dependencies {
	implementation 'com.github.arbitur:Geocoding-Android:<version>'
}

Usage

Geocoding (Query search)

new Geocoding(query, apiKey /* or null */)
    .setLanguage(language)
    .setBounds(new Bounds(sw, ne))
    .setRegion(region)
    .addComponent(type, value)
    ...
    .fetch(...);

Reverse Geocoding (Coordinate search)

new ReverseGeocoding(coordinate, apiKey /* or null */)
    .setLanguage(language)
    .setResultTypes(resultType1, resultType2 ...)
    .setLocationTypes(locationType1, locationType2 ...)
    .isSensor(isSensor)
    .fetch(...);

Reverse Geocoding (Place ID search)

new ReverseGeocoding(placeId, apiKey /* or null */)
    .setLanguage(language)
    .fetch(...);

Examples

new Geocoding("Stockholm", key) // City
    .setLanguage("sv")
    .setRegion("se")
    .addComponent(AddressTypes.COUNTRY, "Sweden")
    .fetch(...);
    

new Geocoding("Humlegården", key) // Park
    .setLanguage("sv")
    .addComponent(AddressTypes.ADMINISTRATIVE_AREA_LEVEL_1, "Stockholm")
    .fetch(...);
    

new Geocoding("Östermalmstorg 1, Stockholm, Sweden", key) // Street Address
    .setLanguage("sv")
    .setBounds(new Bounds(59.3, 18.01, 59.354, 18.116))
    .fetch(...);


new ReverseGeocoding(59.336, 18.079, apiKey)
    .setLanguage("sv")
    .setResultTypes(AdressTypes.STREET_ADDRESS)
    .setLocationTypes(LocationTypes.ROOF_TOP)
    .isSensor(true)
    .fetch(...);

Fetching

...
.fetch(new Callback() {
    @Override
    public void onResponse(Response response) {
        for (Result result : response.getResults()) {
            Log.d(TAG, result.getFormattedAddress());
            
            addMarkerTo(result.getGeometry().getLocation())
        }
        
        Result[] addresses = response.getResults(AddressTypes.STREET_ADDRESS);
        Result[] routes = response.getResults(AddressTypes.ROUTE);
        
        ...
    }
        
    @Override
    public void onFailed(Response response, IOException exception) {
        Log.d(TAG, "Something went wrong");
    }
})

About

Java wrapper for Google's Geocoding API for Android

Topics

androidgeocodinggoogle-maps-apigradlejavajava-wrapper

Resources

Readme
Activity

Stars

34 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.