public class MappedIn
extends java.lang.Object
Constructor and Description |
---|
MappedIn(Application app)
Initialize the SDK.
|
MappedIn(Application app,
boolean antiAliasing)
Initialize the SDK.
|
Modifier and Type | Method and Description |
---|---|
void |
getVenue(Venue venue,
boolean accessible,
LocationGenerator[] locationGenerators,
MappedinCallback<Venue> callback)
Deprecated.
|
void |
getVenue(Venue venue,
LocationGenerator[] locationGenerators,
MappedinCallback<Venue> callback)
Retrieves the full details (map, location, nodes, etc) of a given venue.
|
void |
getVenue(Venue venue,
java.lang.String languageCode,
LocationGenerator[] locationGenerators,
MappedinCallback<Venue> callback)
Retrieves the full details (map, location, nodes, etc) of a given venue.
|
void |
getVenues(MappedinCallback<java.util.List<Venue>> mappedinCallback)
Retrieves a list of all venues your credentials have access to.
|
MappedinSearch |
initiateMappedinSearch(Venue venue) |
SmartSearch |
initiateSearch(Venue venue)
Initiate the search server set the venue
|
public MappedIn(Application app)
app
- user APP's Application.
public class MainActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MappedIn mappedIn = new MappedIn(getApplication());
setContentView(R.layout.activity_main);
}
}
public MappedIn(Application app, boolean antiAliasing)
app
- user APP's Application. antiAliasing
- specify if you want anti-aliasing on for your mapView.
public class MainActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MappedIn mappedIn = new MappedIn(getApplication());
setContentView(R.layout.activity_main);
}
}
public void getVenues(MappedinCallback<java.util.List<Venue>> mappedinCallback)
Retrieves a list of all venues your credentials have access to. It will fill in the name, logo, and cover image. Further details (like the maps and locations) will not be populated until you call getVenue() with a given venue.
Make sure you have set your Mappedin username, secret, and DataSchema in your application's manifest file. If you don't know what your credentials are, please contact your MappedIn representative.
mappedinCallback
- A function that will be called with a list of venues retrieved when
the operation is completed.
public class MainActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MappedIn mappedIn = new MappedIn(getApplication());
mappedIn.getVenues(new MappedinCallback>() {
@Override
public void onCompleted(final List result) {
venues = result;
// TODO: getVenues success, returns a list of Venues
}
@Override
public void onError(Exception e) {
// TODO: getVenues failed
}
});
}
}
@Deprecated public void getVenue(Venue venue, boolean accessible, LocationGenerator[] locationGenerators, MappedinCallback<Venue> callback)
getVenue(Venue, LocationGenerator[], MappedinCallback)
function.
The accessible param moves to
Navigatable.directionsTo(Venue, Navigatable, Location, Location, boolean)
and
Navigatable.directionsFrom(Venue, Navigatable, Location, Location, boolean)
public void getVenue(Venue venue, LocationGenerator[] locationGenerators, MappedinCallback<Venue> callback)
venue
- the specific venue you want to retrieves the full details of
(venue from getVenues(MappedinCallback)
)locationGenerators
- A array of generator function called for each Location. Use this
parameter to implement custom Location Subclasses.callback
- A function that will be called with the full Venue details when Venue data
is ready
public class MainActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
LocationGenerator customerLocation = new LocationGenerator() {
@Override
public Location locationGenerator(ByteBuffer data, int index, Venue venue) {
return new CustomerLocation(data, index, venue);
}
};
LocationGenerator[] locationGenerators = {customerLocation};
final MappedinCallback callback = new MappedinCallback() {
@Override
public void onCompleted(Venue venue) {
// TODO: getVenue success, returns the requested Venue
}
@Override
public void onError(Exception error) {
// TODO: getVenue failed
}
};
MappedIn mappedIn = new MappedIn(getApplication());
mappedIn.getVenue(selectedVenue, locationGenerators, callback);
}
}
public void getVenue(Venue venue, java.lang.String languageCode, LocationGenerator[] locationGenerators, MappedinCallback<Venue> callback)
venue
- the specific venue you want to retrieves the full details of
(venue from getVenues(MappedinCallback)
)languageCode
- the language to use when getting venue data, if available. If the language
code provided is not available for the venue, getVenue will try to find
a suitable language based on the device's language settings, and use the
venue's default language if no suitable match is found.locationGenerators
- A array of generator function called for each Location. Use this
parameter to implement custom Location Subclasses.callback
- A function that will be called with the full Venue details when Venue data
is ready
public class MainActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
LocationGenerator customerLocation = new LocationGenerator() {
@Override
public Location locationGenerator(ByteBuffer data, int index, Venue venue) {
return new CustomerLocation(data, index, venue);
}
};
LocationGenerator[] locationGenerators = {customerLocation};
final MappedinCallback callback = new MappedinCallback() {
@Override
public void onCompleted(Venue venue) {
// TODO: getVenue success, returns the requested Venue
}
@Override
public void onError(Exception error) {
// TODO: getVenue failed
}
};
MappedIn mappedIn = new MappedIn(getApplication());
mappedIn.getVenue(selectedVenue, "en", locationGenerators, callback);
}
}
public SmartSearch initiateSearch(Venue venue)
venue
- the venue you want to searchpublic MappedinSearch initiateMappedinSearch(Venue venue)