Menu

GeoDB Cities API

Integrating with Java (Android)

GraphQL

Here are some options for executing GraphQL queries from Android:

REST

GeoDB Java SDK

The easiest way to integrate the GeoDB service into your Java application or Android app is by using the available client SDK. 

  1. Add the following compile-time dependency to your Maven pom.xml:
    <dependency>
        <groupId>com.wirefreethought.geodb</groupId>
        <artifactId>geodb-java-client</artifactId>
        <version>1.1.4</version>
    </dependency>
    
  2. Use the client:
    // Setup
    GeoDbApiClient apiClient = new GeoDbApiClient();
    apiClient.setApiKey(YOUR_MASHAPE_KEY);
    
    GeoDbApi geoDbApi = new GeoDbApi(apiClient);
    
    // Execute service calls.
    geoDbApi.findCities(FindCitiesRequest.builder()...build());
  3. Explore the client SDK, including source code and a cookbook of examples.

RapidAPI Java SDK

In addition to our homegrown (and recommended) SDK, you may also opt to use the RapidAPI version.

The advantage of using RapidAPI's variant is you can use it to consume any API available on that platform.

The main disadvantage is that, because it serves as a lowest common denominator to all possible APIs, it's not tailored to the GeoDB domain and is not as user-friendly.