public class Suggest
extends java.lang.Object
The Suggest service encapsulates suggest queries to cercalia API. The Suggest works with an APIKEY. Use the following call to configure it:
Cercalia.getInstance().setCercaliaApiKey(API_KEY)
Resolution of the queries is done asyncronously, so a callback must be defined as in this example overriding the method:
Suggest.getInstance().suggest(text, new Suggest.SuggestCallback() {
@Override
public void response(@NonNull List <Address > result, @Nullable String nativeResponse, boolean error) {
...
}
});
Copyright (c) 2017 Nexusgeographics All rights reserved.
Cercalia
Modifier and Type | Class and Description |
---|---|
static interface |
Suggest.SuggestCallback
The interface Suggest callback.
|
static class |
Suggest.Type
The enum Type Address.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel the current query
|
static Suggest |
getInstance()
Gets instance.
|
Suggest.Type[] |
getTypes()
Gets types.
|
void |
setTypes(Suggest.Type[] types)
Sets types.
|
void |
suggest(java.lang.String t,
Suggest.SuggestCallback callback)
Suggest.
|
public static Suggest getInstance()
public void suggest(@NonNull java.lang.String t, @NonNull Suggest.SuggestCallback callback)
t
- the tcallback
- the callbackpublic void cancel()
public void setTypes(Suggest.Type[] types)
types
- the typespublic Suggest.Type[] getTypes()