NAV

Introduction

Welcome to the Proximi.io Android SDK reference. Use our library to hook into the Proximi.io platform.

You can find the iOS reference here.

Code samples can be found on the right side of the page, and a sample Android project can be found here.

You can find our Proximi.io Android Map SDK here.

API Changelog

2.6

  • ProximiioListener is now always removed when ProximiioAPI.destroy is called. Please use BroadcastReceivers on the background. See the Background section for more info.
  • As a result, ProximiioAPI.destroy now takes no parameters, where previously it took a boolean indicating the background status of the ProximiioListener.
  • Removed the deprecated Proximiio class. Please use the ProximiioAPI introduced in 2.5.
  • Removed the deprecated ProximiioListener.push. Please use ProximiioListener.output instead.

Adding the SDK

android {
    ...
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}

repositories {
    ...
    maven {
        url "http://proximi-io.bintray.com/proximiio-android"
    }
    maven {
        url "http://indooratlas-ltd.bintray.com/mvn-public"
    }
    maven {
        url 'https://maven.google.com'
    }
}

dependencies {
    ...
    compile 'io.proximi.proximiiolibrary:proximiiolibrary:2.6.4'
}

Add the following to your module’s build.gradle file.

Here is the latest version: Download

(Just replace the version number in the build.gradle with the latest version.)

If you are using a build system other than Gradle, please see Bintray’s instructions to setting things up. (Big blue “Set me up!” -button). You also need to make the IndoorAtlas dependency available in a similar fashion.

Getting Started

Foreground

public class MainActivity extends AppCompatActivity {
    private ProximiioAPI proximiioAPI;

    private static final String TAG = "MainActivity";
    private static final String AUTH = "AUTH_KEY_HERE"; // TODO: Replace with your own!

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    protected void onStart() {
        super.onStart();

        proximiioAPI = new ProximiioAPI(TAG, this);
        proximiioAPI.setListener(new ProximiioListener() {
            @Override
            public void position(double lat, double lon, double accuracy) {
                // Do something with the positioning system.
                // See ProximiioListener in the docs for all available methods.
            }
        });
        proximiioAPI.setAuth(AUTH);

        proximiioAPI.setActivity(this);
    }

    @Override
    protected void onStop() {
        super.onStop();
        proximiioAPI.destroy();
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        proximiioAPI.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        proximiioAPI.onActivityResult(requestCode, resultCode, data);
    }
}

Your application is on the foreground when you have an Activity open.

Here’s an example of using Proximi.io on the foreground.

First, in the onStart method, we create a new instance of ProximiioAPI, that is used to communicate with Proximi.io.

Next, we add a listener to the API, to get callbacks on events we need. In this example we’ve implemented the position method. All methods of ProximiioListener can be found here.

After setting a listener, we set the auth-key to Proximi.io. This begins the operation of Proximi.io. For more information, check setAuth.

Finally, in the onStop method, we destroy the API object. This also destroys our listener. To use Proximi.io on the background, please see the Background section.

Permissions

Proximi.io requires permission to use the device location, as well as Bluetooth if your application scans for Bluetooth Low Energy devices.

To let Proximi.io automatically ask these permissions when it needs them, you can set an Activity for Proximi.io to use with setActivity, and supply Proximi.io with the results by overriding onRequestPermissionsResult and onActivityResult in your Activity.

This also resolves any Google Play Service errors for you.

If you don’t want Proximi.io interacting with the user, you can exclude setActivity, onRequestPermissionsResult, and onActivityResult.

Background

BroadcastReceiver

public class BackgroundReceiver extends BroadcastReceiver {
    private static final String TAG = "BackgroundReceiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        switch (intent.getAction()) {
            case ProximiioAPI.ACTION_POSITION:
                double lat = intent.getDoubleExtra(ProximiioAPI.EXTRA_LAT, 0);
                double lon = intent.getDoubleExtra(ProximiioAPI.EXTRA_LON, 0);
                Log.d(TAG, "Position! (" + lat + ", " + lon + ")");
                break;
        }
    }
}

AndroidManifest.xml

<application>

    ...

    <receiver android:name=".BackgroundReceiver"  android:exported="false">
        <intent-filter>
            <action android:name="io.proximi.proximiiolibrary.action.POSITION"/>
        </intent-filter>
    </receiver>

</application>

To get callbacks on Proximi.io events in the background, you can use a BroadcastReceiver.

Start by creating a new class, which extends BroadcastReceiver. Then override the onReceive method.

Check the intent’s action to find out what event you’re handling. After that, you can access any extras that are available.

For all of this to work, we need to register the BroadcastReceiver in your module’s AndroidManifest.xml. Add a new receiver under your application, with android:exported set to false. Add an intent-filter with the actions you wish to receive.

All actions and extras available are listed here.

What Next?

ProximiioAPI

proximiioAPI = new ProximiioAPI("MyProximi.io", context);

ProximiioAPI is your entry point to SDK capabilities.

Create a new instance with an ID and Context to get started.

The ID is used to keep track of this particular instance. Please use different IDs for different API objects.

setActivity

proximiioAPI.setActivity(MainActivity.this);

public void setActivity(@Nullable Activity activity)

Enable asking the user for permissions, location and Bluetooth if needed. Please hook your Activity to call ProximiioAPI.onRequestPermissionsResult and ProximiioAPI.onActivityResult to inform Proximi.io about the results.

setListener

public void setListener(@Nullable ProximiioListener listener)

Set a listener for Proximi.io events. Call with a null listener to remove.

setAuth

proximiioAPI.setAuth("exampleauthkey");

public void setAuth(@NonNull String token)

Set the authorization key for Proximi.io. Use this or ProximiioAPI.setLogin to contact Proximi.io servers and begin operation. If this is successful, ProximiioAPI.trySavedLogin can be used in the future instead if desired.

This is only necessary to call once in your application’s lifecycle, but subsequent calls make no harm.

You can find your authorization keys in your web portal (or use the shared portal) under “Manage Applications”. Click the token of the application you want to use and copy paste it to your setAuth method. Please note that application keys are read-only.

setLogin

proximiioAPI.setLogin("example@dev.com", "password");

public void setLogin(@NonNull String email, @NonNull String password)

Login. This or ProximiioAPI.setAuth is needed to contact Proximi.io servers and begin operation. Sets the login information required for ProximiioAPI.trySavedLogin if successful.

This is only necessary to call once in your application’s lifecycle, but subsequent calls make no harm.

trySavedLogin

proximiioAPI.trySavedLogin();

public boolean trySavedLogin()

If this client has logged in successfully in the past, try those same credentials. Note that ProximiioListener.loginFailed can still be called, as this doesn’t guarantee a successful login.

Returns true if previous credentials were found and login was attempted.

register

proximiioAPI.register("new.account@example.com", "password", "Test", "Person", "Testing Company", "Canada", "Freelance developer");

public void register(@NonNull String email, @NonNull String password, @NonNull String firstName, @NonNull String lastName, @NonNull String company, @NonNull String country, @NonNull String background)

Registers a new account to Proximi.io. Fires either ProximiioListener.registered or ProximiioListener.registrationFailed.

destroy

proximiioAPI.destroy();

public void destroy()

Call this when you’re done with this API object.

destroyService

proximiioAPI.destroyService(false);

public void destroyService(boolean eraseData)

Set eraseData to true if you want to delete all data that Proximi.io has saved, including auth keys and offline data. With false, Proximi.io will only stop all operations until a new instance of ProximiioAPI is created.

setApplication

proximiioAPI.setApplication("APP_ID");

public void setApplication(@Nullable String applicationID)

Set the application you would like to use. If null is specified or this method hasn’t been called, the first application available will be used.

getVisitorID

String visitorID = proximiioAPI.getVisitorID();

public String getVisitorID()

Get the visitor ID of the client in the Proximi.io system.

setForceBluetooth

public void setForceBluetooth(boolean forced)

Set this to true to force Bluetooth scanning on regardless of power saving status. Once set to false, normal power saving modes will continue shortly.

customInputPosition

public void customInputPosition(String customInputID, double lat, double lon, double accuracy)

Provide a position update for Proximi.io with a previously added custom input.

onRequestPermissionsResult

public class MainActivity extends AppCompatActivity {
    ...

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        proximiioAPI.onRequestPermissionsResult(requestCode, permissions, grantResults);
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }
}

public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)

Override onRequestPermissionsResult in your Activity and send the results here if you have set an Activity with ProximiioAPI.setActivity.

onActivityResult

public class MainActivity extends AppCompatActivity {
    ...

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        proximiioAPI.onActivityResult(requestCode, resultCode, data);
        super.onActivityResult(requestCode, resultCode, data);
    }
}

public void onActivityResult(int requestCode, int resultCode, Intent data)

Override onActivityResult in your Activity and send the results here if you have set an Activity with ProximiioAPI.setActivity.

addPlace

public boolean addPlace(String name, double lat, double lon, @Nullable String address, @Nullable String indoorAtlasVenueID, @Nullable String[] tags)

Add a new place. Returns true if validation was successful.

addFloor

public boolean addFloor(String name, @Nullable String indoorAtlasFloorPlanID, @Nullable String floorPlanURL, ProximiioPlace place, @Nullable Integer floorNumber)

Add a new floor. Returns true if validation was successful.

addDepartment

public boolean addDepartment(String name, ProximiioFloor floor, String[] tags, @Nullable Boolean exclusiveTrilateration, @Nullable Boolean modifyPositioning, @Nullable Boolean eddystones, @Nullable Boolean iBeacons, @Nullable Boolean indoorAtlas, @Nullable Boolean nativePositioning)

Add a new department. Returns true if validation was successful.

addInput

public boolean addInput(String name, @Nullable ProximiioDepartment department, ProximiioInput.InputType type, double lat, double lon, @Nullable ProximiioBeaconFilter filter)

Add a new input. Returns true if validation was successful.

addGeofence

public boolean addGeofence(String name, @Nullable ProximiioNetworkObject department, double lat, double lon, double radius, @Nullable String address, @Nullable JSONObject metadata)

public boolean addGeofence(String name, @Nullable ProximiioNetworkObject department, double[][] polygon, @Nullable String address, @Nullable JSONObject metadata)

Add a new geofence. Returns true if validation was successful.

addApplication

public boolean addApplication(String name, boolean eddyStones, boolean iBeacons, boolean indoorAtlas, @Nullable String indoorAtlasApiKey, @Nullable String indoorAtlasApiKeySecret, boolean nativePositioning, ProximiioApplication.NativeAccuracy nativeAccuracy, @Nullable Boolean bluetoothTrilateration, @Nullable Boolean remoteMode, @Nullable Boolean isNetworkInterval, @Nullable Integer networkInterval, @Nullable Boolean geofencePositioning, @Nullable Integer nativeActivationTime)

Add a new application. Returns true if validation was successful.

editPlace

public boolean editPlace(String name, double lat, double lon, @Nullable String address, @Nullable String indoorAtlasVenueID, @Nullable String[] tags, @Nullable ArrayList<ProximiioPathfindingNode> nodes, String id)

Edit a place. Returns true if validation was successful.

editFloor

public boolean editFloor(String name, @Nullable String indoorAtlasFloorPlanID, @Nullable String floorPlanURL, ProximiioPlace place, @Nullable Integer floorNumber, String id)

Edit a floor. Returns true if validation was successful.

editDepartment

public boolean editDepartment(String name, ProximiioFloor floor, String[] tags, @Nullable Boolean exclusiveTrilateration, @Nullable Boolean modifyPositioning, @Nullable Boolean eddystones, @Nullable Boolean iBeacons, @Nullable Boolean indoorAtlas, @Nullable Boolean nativePositioning, String id)

Edit a department. Returns true if validation was successful.

editInput

public boolean editInput(String name, @Nullable ProximiioDepartment department, ProximiioInput.InputType type, double lat, double lon, @Nullable ProximiioBeaconFilter filter, String id)

Edit an input. Returns true if validation was successful.

editGeofence

public boolean editGeofence(String name, @Nullable ProximiioNetworkObject department, double lat, double lon, double radius, @Nullable String address, @Nullable JSONObject metadata, String id)

public boolean editGeofence(String name, @Nullable ProximiioNetworkObject department, double[][] polygon, @Nullable String address, @Nullable JSONObject metadata, String id)

Edit a geofence. Returns true if validation was successful.

editApplication

public boolean editApplication(String name, boolean eddyStones, boolean iBeacons, boolean indoorAtlas, @Nullable String indoorAtlasApiKey, @Nullable String indoorAtlasApiKeySecret, boolean nativePositioning, ProximiioApplication.NativeAccuracy nativeAccuracy, @Nullable Boolean bluetoothTrilateration, @Nullable Boolean remoteMode, @Nullable Boolean isNetworkInterval, @Nullable Integer networkInterval, @Nullable Boolean geofencePositioning, @Nullable Integer nativeActivationTime, String id)

Edit an application. Returns true if validation was successful.

deletePlace

public void deletePlace(String id)

Delete a place.

deleteFloor

public void deleteFloor(String id)

Delete a floor.

deleteDepartment

public void deleteDepartment(String id)

Delete a department.

deleteInput

public void deleteInput(String id)

Delete an input.

deleteGeofence

public void deleteGeofence(String id)

Delete a geofence.

deleteApplication

public void deleteApplication(String id)

Delete an application.

ProximiioListener

ProximiioListener is a set of callbacks to inform you about events and updates.

geofenceEnter

@Override
public void geofenceEnter(ProximiioGeofence geofence) {
    Log.d("MainActivity", "Entered geofence: " + geofence.getName());
}

public void geofenceEnter(ProximiioGeofence geofence)

Called when this client enters a geofence.

geofenceExit

@Override
public void geofenceExit(ProximiioGeofence geofence, @Nullable Long dwellTime) {
    Log.d("MainActivity", "Exited geofence: " + geofence.getName() + " (" + dwellTime + "s)");
}

public void geofenceExit(ProximiioGeofence geofence, @Nullable Long dwellTime)

Called when this client exits a geofence. Dwell time is provided in seconds.

loginFailed

@Override
public void loginFailed(LoginError loginError) {
    switch (loginError) {
        case LOGIN_FAILED:
            Log.e("MainActivity", "Incorrect login credentials!");
            break;
        default:
            Log.e("MainActivity", "Please try again later!");
            break;
    }
}

public void loginFailed(LoginError loginError)

This is called if login fails.

enum LoginError

Key Description
LoginError.LOGIN_FAILED Incorrect login credentials.
LoginError.NETWORK_ERROR Network timed out. If you have previously authenticated successfully, you can still log in with the same credentials while offline, and this error won’t be fired.
LoginError.UNKNOWN_ERROR Unknown error.

loggedIn

public void loggedIn(boolean online)

This is called when Proximi.io has successfully logged in. Parameter online is true when online capabilities are enabled. Can be called up to two times per authentication attempt.

registrationFailed

@Override
public void registrationFailed(RegistrationError registrationError) {
    switch (error) {
        case INVALID_EMAIL:
            Log.e("MainActivity", "Email was invalid!");
            break;
        case EMAIL_ALREADY_REGISTERED:
            Log.e("MainActivity", "Email address was already registered!");
            break;
        default:
            Log.e("MainActivity", "Please try again later!");
            break;
    }
}

public void registrationFailed(RegistrationError registrationError)

This is called if registration fails.

enum RegistrationError

Key Description
RegistrationError.INVALID_EMAIL Email was invalid/malformed.
RegistrationError.EMAIL_ALREADY_REGISTERED An account with this email exists.
RegistrationError.NETWORK_ERROR Network timed out.
RegistrationError.UNKNOWN_ERROR Unknown error.

registered

public void registered()

This is called when a new account has been successfully added.

position

public void position(double lat, double lon, double accuracy)

Called when Proximi.io has a new position available. This may come from native positioning, IndoorAtlas, BLE devices, or custom inputs, depending on which features are available in the selected application, as well as what is available in the vicinity.

Latitude and longitude are both in WGS84, and accuracy is the position update’s accuracy in meters.

foundDevice

public void foundDevice(ProximiioBLEDevice device, boolean registered)

Called when Proximi.io scans a Bluetooth Low Energy device. Parameter registered indicates whether this device is registered to be used with Proximi.io. This will be called every time a device is scanned.

lostDevice

public void lostDevice(ProximiioBLEDevice device, boolean registered)

Called when a device is lost, either because of a timeout, or because Proximi.io is shutting down. Parameter registered indicates whether this device is registered to be used with Proximi.io.

changedFloor

public void changedFloor(@Nullable ProximiioFloor floor)

Called when Proximi.io detects that this client has entered a floor.

Parameter floor is the floor entered. Null if the floor was changed to unknown.

changedDepartment

public void changedDepartment(@Nullable ProximiioDepartment department)

Called when Proximi.io detects that this client has entered a department.

Parameter department is the department entered. Null if the department was changed to unknown.

geofenceEventMetadata

@Nullable public JSONObject geofenceEventMetadata(double lat, double lon, @Nullable Double accuracy, ProximiioGeofence geofence, @Nullable Long dwellTime, @Nullable ProximiioInput input, ProximiioGeofence.Event event, ProximiioGeofence.EventType eventType)

You can use this to add your own metadata to geofence events. Simply return a JSONObject you would like to be added to the event. The parameters describe the event. This will be called before each ProximiioListener.geofenceEnter and ProximiioListener.geofenceExit.

dwellTime is available for exit-events.

addedPlace

public void addedPlace(ProximiioPlace place)

Called when a place is added. This is guaranteed to be called for every existing place when you add a listener.

addedFloor

public void addedFloor(ProximiioFloor floor)

Called when a floor is added. This is guaranteed to be called for every existing floor when you add a listener.

addedDepartment

public void addedDepartment(ProximiioDepartment department)

Called when a department is added. This is guaranteed to be called for every existing department when you add a listener.

addedInput

public void addedInput(ProximiioInput input)

Called when an input is added. This is guaranteed to be called for every existing input when you add a listener.

addedGeofence

public void addedGeofence(ProximiioGeofence geofence)

Called when a geofence is added. This is guaranteed to be called for every existing geofence when you add a listener.

addedApplication

public void addedApplication(ProximiioApplication application)

Called when an application is added. This is guaranteed to be called for every existing application when you add a listener.

updatedPlace

public void updatedPlace(ProximiioPlace place)

Called when a place is updated.

updatedFloor

public void updatedFloor(ProximiioFloor floor)

Called when a floor is updated.

updatedDepartment

public void updatedDepartment(ProximiioDepartment department)

Called when a department is updated.

updatedInput

public void updatedInput(ProximiioInput input)

Called when an input is updated.

updatedGeofence

public void updatedGeofence(ProximiioGeofence geofence)

Called when a geofence is updated.

updatedApplication

public void updatedApplication(ProximiioApplication application)

Called when an application is updated.

removedPlace

public void removedPlace(ProximiioPlace place)

Called when a place is removed.

removedFloor

public void removedFloor(ProximiioFloor floor)

Called when a floor is removed.

removedDepartment

public void removedDepartment(ProximiioDepartment department)

Called when a department is removed.

removedInput

public void removedInput(ProximiioInput input)

Called when an input is removed.

removedGeofence

public void removedGeofence(ProximiioGeofence geofence)

Called when a geofence is removed.

removedApplication

public void removedApplication(ProximiioApplication application)

Called when an application is removed.

itemsLoaded

public void itemsLoaded()

Called on listener add, after all items (places, floors, departments, inputs, geofences, applications) have been loaded.

activatedApplication

public void activatedApplication(ProximiioApplication application)

Called when an application is activated.

output

public void output(JSONObject json)

public void output(String json)

Called when Proximi.io receives an output.

Parameter json contains the output’s payload.

BroadcastReceiver

By implementing a BroadcastReceiver and adding it to your AndroidManifest.xml, you can receive callbacks from Proximi.io on the background.

All actions and extras are available as static under ProximiioAPI, and are mirrored from ProximiioListener.

ACTION_GEOFENCE_ENTER

<action android:name="io.proximi.proximiiolibrary.action.GEOFENCE_ENTER"/>

public static final String ACTION_GEOFENCE_ENTER

Matches ProximiioListener.geofenceEnter.

Available extras:

ACTION_GEOFENCE_EXIT

<action android:name="io.proximi.proximiiolibrary.action.GEOFENCE_EXIT"/>

public static final String ACTION_GEOFENCE_EXIT

Matches ProximiioListener.geofenceExit.

Available extras:

ACTION_LOGIN_FAILED

<action android:name="io.proximi.proximiiolibrary.action.LOGIN_FAILED"/>

public static final String ACTION_LOGIN_FAILED

Matches ProximiioListener.loginFailed.

Available extras:

ACTION_LOGGED_IN

<action android:name="io.proximi.proximiiolibrary.action.LOGGED_IN"/>

public static final String ACTION_LOGGED_IN

Matches ProximiioListener.loggedIn.

Available extras:

ACTION_REGISTRATION_FAILED

<action android:name="io.proximi.proximiiolibrary.action.REGISTRATION_FAILED"/>

public static final String ACTION_REGISTRATION_FAILED

Matches ProximiioListener.registrationFailed.

Available extras:

ACTION_REGISTERED

<action android:name="io.proximi.proximiiolibrary.action.REGISTERED"/>

public static final String ACTION_REGISTERED

Matches ProximiioListener.registered.

Available extras:

  • None

ACTION_POSITION

<action android:name="io.proximi.proximiiolibrary.action.POSITION"/>

public static final String ACTION_POSITION

Matches ProximiioListener.position.

Available extras:

ACTION_FOUND_DEVICE

<action android:name="io.proximi.proximiiolibrary.action.FOUND_DEVICE"/>

public static final String ACTION_FOUND_DEVICE

Matches ProximiioListener.foundDevice.

Available extras:

ACTION_LOST_DEVICE

<action android:name="io.proximi.proximiiolibrary.action.LOST_DEVICE"/>

public static final String ACTION_LOST_DEVICE

Matches ProximiioListener.lostDevice.

Available extras:

ACTION_CHANGED_FLOOR

<action android:name="io.proximi.proximiiolibrary.action.CHANGED_FLOOR"/>

public static final String ACTION_CHANGED_FLOOR

Matches ProximiioListener.changedFloor.

Available extras:

ACTION_CHANGED_DEPARTMENT

<action android:name="io.proximi.proximiiolibrary.action.CHANGED_DEPARTMENT"/>

public static final String ACTION_CHANGED_DEPARTMENT

Matches ProximiioListener.changedDepartment.

Available extras:

ACTION_GEOFENCE_EVENT_METADATA

<action android:name="io.proximi.proximiiolibrary.action.GEOFENCE_EVENT_METADATA"/>
@Override
public void onReceive(Context context, Intent intent) {
    switch (intent.getAction()) {
        case ProximiioAPI.ACTION_GEOFENCE_EVENT_METADATA:
            Bundle bundle = getResultExtras(true);
            JSONObject jsonObject = new JSONObject();
            try {
                jsonObject.put("meta", "data");
                bundle.putString(ProximiioAPI.EXTRA_JSON, jsonObject.toString());
            }
            catch (JSONException e) {
                e.printStackTrace();
            }
            break;
    }
}

public static final String ACTION_GEOFENCE_EVENT_METADATA

Matches ProximiioListener.geofenceEventMetadata.

Available extras:

You can supply your metadata JSON as with ProximiioListener.geofenceEventMetadata by supplying a valid JSON string to result extras with the key ProximiioAPI.EXTRA_JSON.

ACTION_ADDED_PLACE

<action android:name="io.proximi.proximiiolibrary.action.ADDED_PLACE"/>

public static final String ACTION_ADDED_PLACE

Matches ProximiioListener.addedPlace

Available extras:

ACTION_ADDED_FLOOR

<action android:name="io.proximi.proximiiolibrary.action.ADDED_FLOOR"/>

public static final String ACTION_ADDED_FLOOR

Matches ProximiioListener.addedFloor

Available extras:

ACTION_ADDED_DEPARTMENT

<action android:name="io.proximi.proximiiolibrary.action.ADDED_DEPARTMENT"/>

public static final String ACTION_ADDED_DEPARTMENT

Matches ProximiioListener.addedDepartment

Available extras:

ACTION_ADDED_INPUT

<action android:name="io.proximi.proximiiolibrary.action.ADDED_INPUT"/>

public static final String ACTION_ADDED_INPUT

Matches ProximiioListener.addedInput

Available extras:

ACTION_ADDED_GEOFENCE

<action android:name="io.proximi.proximiiolibrary.action.ADDED_GEOFENCE"/>

public static final String ACTION_ADDED_GEOFENCE

Matches ProximiioListener.addedGeofence

Available extras:

ACTION_ADDED_APPLICATION

<action android:name="io.proximi.proximiiolibrary.action.ADDED_APPLICATION"/>

public static final String ACTION_ADDED_APPLICATION

Matches ProximiioListener.addedApplication

Available extras:

ACTION_UPDATED_PLACE

<action android:name="io.proximi.proximiiolibrary.action.UPDATED_PLACE"/>

public static final String ACTION_UPDATED_PLACE

Matches ProximiioListener.updatedPlace

Available extras:

ACTION_UPDATED_FLOOR

<action android:name="io.proximi.proximiiolibrary.action.UPDATED_FLOOR"/>

public static final String ACTION_UPDATED_FLOOR

Matches ProximiioListener.updatedFloor

Available extras:

ACTION_UPDATED_DEPARTMENT

<action android:name="io.proximi.proximiiolibrary.action.UPDATED_DEPARTMENT"/>

public static final String ACTION_UPDATED_DEPARTMENT

Matches ProximiioListener.updatedDepartment

Available extras:

ACTION_UPDATED_INPUT

<action android:name="io.proximi.proximiiolibrary.action.UPDATED_INPUT"/>

public static final String ACTION_UPDATED_INPUT

Matches ProximiioListener.updatedInput

Available extras:

ACTION_UPDATED_GEOFENCE

<action android:name="io.proximi.proximiiolibrary.action.UPDATED_GEOFENCE"/>

public static final String ACTION_UPDATED_GEOFENCE

Matches ProximiioListener.updatedGeofence

Available extras:

ACTION_UPDATED_APPLICATION

<action android:name="io.proximi.proximiiolibrary.action.UPDATED_APPLICATION"/>

public static final String ACTION_UPDATED_APPLICATION

Matches ProximiioListener.updatedApplication

Available extras:

ACTION_REMOVED_PLACE

<action android:name="io.proximi.proximiiolibrary.action.REMOVED_PLACE"/>

public static final String ACTION_REMOVED_PLACE

Matches ProximiioListener.removedPlace

Available extras:

ACTION_REMOVED_FLOOR

<action android:name="io.proximi.proximiiolibrary.action.REMOVED_FLOOR"/>

public static final String ACTION_REMOVED_FLOOR

Matches ProximiioListener.removedFloor

Available extras:

ACTION_REMOVED_DEPARTMENT

<action android:name="io.proximi.proximiiolibrary.action.REMOVED_DEPARTMENT"/>

public static final String ACTION_REMOVED_DEPARTMENT

Matches ProximiioListener.removedDepartment

Available extras:

ACTION_REMOVED_INPUT

<action android:name="io.proximi.proximiiolibrary.action.REMOVED_INPUT"/>

public static final String ACTION_REMOVED_INPUT

Matches ProximiioListener.removedInput

Available extras:

ACTION_REMOVED_GEOFENCE

<action android:name="io.proximi.proximiiolibrary.action.REMOVED_GEOFENCE"/>

public static final String ACTION_REMOVED_GEOFENCE

Matches ProximiioListener.removedGeofence

Available extras:

ACTION_REMOVED_APPLICATION

<action android:name="io.proximi.proximiiolibrary.action.REMOVED_APPLICATION"/>

public static final String ACTION_REMOVED_APPLICATION

Matches ProximiioListener.removedApplication

Available extras:

ACTION_ITEMS_LOADED

<action android:name="io.proximi.proximiiolibrary.action.ITEMS_LOADED"/>

public static final String ACTION_ITEMS_LOADED

Matches ProximiioListener.itemsLoaded

Available extras:

  • None

ACTION_ACTIVATED_APPLICATION

<action android:name="io.proximi.proximiiolibrary.action.ACTIVATED_APPLICATION"/>

public static final String ACTION_ACTIVATED_APPLICATION

Matches ProximiioListener.activatedApplication

Available extras:

ACTION_OUTPUT

<action android:name="io.proximi.proximiiolibrary.action.OUTPUT"/>

public static final String ACTION_OUTPUT

Matches ProximiioListener.output

Available extras:

EXTRA_GEOFENCE

ProximiioGeofence geofence = intent.getParcelableExtra(ProximiioAPI.EXTRA_GEOFENCE);

public static final String EXTRA_GEOFENCE

Type: ProximiioGeofence

EXTRA_DWELL_TIME

long dwellTime = intent.getLongExtra(ProximiioAPI.EXTRA_DWELL_TIME, 0);

public static final String EXTRA_DWELL_TIME

Type: long

EXTRA_LOGIN_ERROR

ProximiioListener.LoginError error = (ProximiioListener.LoginError)intent.getSerializableExtra(ProximiioAPI.EXTRA_LOGIN_ERROR);

´public static final String EXTRA_LOGIN_ERROR´

Type: ProximiioListener.LoginError

EXTRA_ONLINE

boolean online = intent.getBooleanExtra(ProximiioAPI.EXTRA_ONLINE, false);

public static final String EXTRA_ONLINE

Type: boolean

EXTRA_REGISTRATION_ERROR

ProximiioListener.RegistrationError error = (ProximiioListener.RegistrationError)intent.getSerializableExtra(ProximiioAPI.EXTRA_REGISTRATION_ERROR);

public static final String EXTRA_REGISTRATION_ERROR

Type: ProximiioListener.RegistrationError

EXTRA_LAT

double lat = intent.getDoubleExtra(ProximiioAPI.EXTRA_LAT, 0);

public static final String EXTRA_LAT

Type: double

EXTRA_LON

double lon = intent.getDoubleExtra(ProximiioAPI.EXTRA_LON, 0);

public static final String EXTRA_LON

Type: double

EXTRA_ACCURACY

double accuracy = intent.getDoubleExtra(ProximiioAPI.EXTRA_ACCURACY, 0);

public static final String EXTRA_ACCURACY

Type: double

EXTRA_DEVICE

ProximiioBLEDevice device = intent.getParcelableExtra(ProximiioAPI.EXTRA_DEVICE);

public static final String EXTRA_DEVICE

Type: ProximiioBLEDevice

EXTRA_REGISTERED

boolean registered = intent.getBooleanExtra(ProximiioAPI.EXTRA_REGISTERED, false);

public static final String EXTRA_REGISTERED

Type: boolean

EXTRA_FLOOR

ProximiioFloor floor = intent.getParcelableExtra(ProximiioAPI.EXTRA_FLOOR);

public static final String EXTRA_FLOOR

Type: ProximiioFloor

EXTRA_DEPARTMENT

ProximiioDepartment department = intent.getParcelableExtra(ProximiioAPI.EXTRA_DEPARTMENT);

public static final String EXTRA_DEPARTMENT

Type: ProximiioDepartment

EXTRA_INPUT

ProximiioInput input = intent.getParcelableExtra(ProximiioAPI.EXTRA_INPUT);

public static final String EXTRA_INPUT

Type: ProximiioInput

EXTRA_EVENT

ProximiioGeofence.Event event = (ProximiioGeofence.Event)intent.getSerializableExtra(ProximiioAPI.EXTRA_EVENT);

public static final String EXTRA_EVENT

Type: ProximiioGeofence.Event

EXTRA_EVENT_TYPE

ProximiioGeofence.EventType eventType = (ProximiioGeofence.EventType)intent.getSerializableExtra(ProximiioAPI.EXTRA_EVENT_TYPE);

public static final String EXTRA_EVENT_TYPE

Type: ProximiioGeofence.EventType

EXTRA_PLACE

ProximiioPlace place = intent.getParcelableExtra(ProximiioAPI.EXTRA_PLACE);

public static final String EXTRA_PLACE

Type: ProximiioPlace

EXTRA_APPLICATION

ProximiioApplication application = intent.getParcelableExtra(ProximiioAPI.EXTRA_APPLICATION);

public static final String EXTRA_APPLICATION

Type: ProximiioApplication

EXTRA_JSON

String json = intent.getStringExtra(ProximiioAPI.EXTRA_JSON);
try {
    JSONObject jsonObject = new JSONObject(json);
}
catch (JSONException e) {
    e.printStackTrace();
}

public static final String EXTRA_JSON

Type: String

Please use this extra as a key when supplying metadata JSON to events.

ProximiioNetworkObject

ProximiioNetworkObject is a base class for ProximiioPlace, ProximiioFloor, ProximiioDepartment, ProximiioInput, and ProximiioGeofence. As such, all the methods here are available on these classes.

getJSON

@Nullable public String getJSON()

Constructs JSON from this object. Returns null if internal parsing fails.

fromJSON

@Nullable public static ProximiioNetworkObject fromJSON(String json, ObjectType type)

Creates a new instance of the specified type based on the provided JSON. Please note, that the object being created doesn’t undergo any normal integrations, meaning that it won’t have references to any other objects, such as its parent or children.

Returns a new instance of the specified type if the JSON is valid, null otherwise.

getType

public ObjectType getType()

Returns the type of this object.

enum ObjectType

Key Can be casted to
ObjectType.PLACES ProximiioPlace
ObjectType.FLOORS ProximiioFloor
ObjectType.DEPARTMENT ProximiioDepartment
ObjectType.INPUTS ProximiioInput
ObjectType.GEOFENCES ProximiioGeofence

getID

public String getID()

Returns a unique ID that represents this object.

getParentID

@Nullable public String getParentID()

Returns this object’s parent’s ID, if this object has or should have a parent.

getParent

@Nullable public ProximiioNetworkObject getParent()

Returns this object’s parent, if available.

getChildren

public ArrayList<ProximiioNetworkObject> getChildren()

Returns a list containing all children of this object.

getParents

public ProximiioNetworkObject[] getParents(int levels)

Returns an array of parents, fetched recursively with getParent. The levels parameter indicates the expected number of parents. If you are unsure about this, you can use ProximiioService.MAX_PARENTS. The returned array’s length will always be levels, but the guaranteed number of found parents is zero.

getAllChildren

public ArrayList<ProximiioNetworkObject> getAllChildren()

Returns a list of all children, as well as all children’s children, and their children, etc, recursively, with getChildren.

getName

public String getName()

Returns this object’s name.

getDescription

@Nullable public String getDescription()

Returns this object’s description.

toString

@Override public String toString()

Returns getName + “, ” + getDescription.

ProximiioPlace

Represents a place.

Parent

  • None

Children

  • ProximiioFloor

getAddress

@Nullable public String getAddress()

Returns the address of this place if available.

getLat

public double getLat()

Returns this place’s latitude, in WGS84.

getLon

public double getLon()

Returns this place’s longitude, in WGS84.

getTags

public String[] getTags()

Returns this place’s tags.

getIndoorAtlasVenueID

@Nullable public String getIndoorAtlasVenueID()

Returns this place’s IndoorAtlas venue, if it exists.

getPath

@Nullable public ProximiioPathfindingResult getPath(double startLat, double startLon, double endLat, double endLon, @Nullable String startFloorID, @Nullable String endFloorID)

Get the shortest path from the specified start location to the specified end location, using the pathfinding data of this place. Returns an instance of ProximiioPathfindingResult if pathfinding data was available and a path was found, null otherwise. Start and end floor IDs are used to make sure the pathfinding starts and ends at the rights floors. With null values, the nearest nodes are used from all floors.

getPathfindingNodes

@Nullable public ArrayList<ProximiioPathfindingNode> getPathfindingNodes()

Get a list of pathfinding nodes. Returns null if none are set.

ProximiioFloor

Represents a floor.

Parent

  • ProximiioPlace

Children

  • ProximiioDepartment

getFloorNumber

@Nullable public Integer getFloorNumber()

Returns this floor’s number. Returns null if it hasn’t been set.

getFloorPlanURL

@Nullable public String getFloorPlanURL()

Returns the URL for the floor plan of this floor, if available.

getIndoorAtlasFloorPlanID

@Nullable public String getIndoorAtlasFloorPlanID()

Returns this floor’s IndoorAtlas floor plan ID, if available.

hasFloorPlan

public boolean hasFloorPlan()

Does this floor have a floor plan? Returns true if this floor has both a floor plan URL and anchors defined.

requestFloorPlanImage

public boolean requestFloorPlanImage(Context context, final ProximiioImageCallback callback)

public boolean requestFloorPlanImage(Context context, final ProximiioImageCallback callback, int maxDimension)

Request the floor plan image of this floor. The image is cached accordingly for future access. This rotates and scales the image according to its anchors. Returns true if the floor plan image is being retrieved. False if this floor doesn’t have a floor plan or a floor plan retrieval is already in progress.

This calls the ProximiioImageCallback#loaded(Bitmap bitmap, float floorPlanWidth, float floorPlanHeight, double[] floorPlanPivot) callback when successful.

Parameter maxDimension is the width and height of the image, to which it will be downscaled if needed. This is to ensure that memory is sufficient. You can omit this to use the default value (750), which should be safe to use on all reasonably modern phones. If you know that your application will only run on high-end devices, you can try to experiment with this value to increase image fidelity.

requestFloorPlanImageNoTransform

public boolean requestFloorPlanImage(Context context, final ProximiioImageCallback callback)

public boolean requestFloorPlanImage(Context context, final ProximiioImageCallback callback, int maxDimension)

Request the floor plan image of this floor. The image is cached accordingly for future access. This only returns the image bitmap, without any rotation or scaling applied. Returns true if the floor plan image is being retrieved. False if this floor doesn’t have a floor plan or a floor plan retrieval is already in progress.

This calls the ProximiioImageCallback#loaded(Bitmap bitmap, double[][] anchors) callback when successful.

Parameter maxDimension is the width and height of the image, to which it will be downscaled if needed. This is to ensure that memory is sufficient. You can omit this to use the default value (750), which should be safe to use on all reasonably modern phones. If you know that your application will only run on high-end devices, you can try to experiment with this value to increase image fidelity.

ProximiioImageCallback

Callback for floor plan image loading.

loaded

void loaded(Bitmap bitmap, float floorPlanWidth, float floorPlanHeight, double[] floorPlanPivot)

void loaded(Bitmap bitmap, double[][] anchors)

This is called when the image loading succeeds.

Parameter Description
bitmap The bitmap containing the floor plan.
floorPlanWidth The width of the floor plan in meters.
floorPlanHeight The height of the floor plan in meters.
floorPlanPivot The center point of the floor plan in latitude and longitude.
anchors The corners of the image, as in ProximiioFloor.getAnchors().

failed

void failed()

Image loading failed for some reason. You may retry here.

getAnchors

@Nullable public double[][] getAnchors()

Get the anchors (a.k.a. the corner points) of this floor. The first one is in the northwest from the center, and the rest follow clockwise. This is an array of four coordinate pairs, defined as latitude and longitude. Returns null if this floor doesn’t specify anchors for the floor plan.

getFloorPlanPivot

@Nullable public double[] getFloorPlanPivot()

Returns the center point of the floor’s floor plan. Returns null if this floor doesn’t have any anchors.

getFloorPlanSideWidth

public float getFloorPlanSideWidth()

Returns the length of the floor plan’s side, that’s the most aligned with the longitunal axis, in meters. Returns zero if this floor doesn’t have any anchors.

getFloorPlanSideHeight

public float getFloorPlanSideHeight()

Returns the length of the floor plan’s side, that’s the most aligned with the latitudinal axis, in meters. Returns zero if this floor doesn’t have any anchors.

getFloorPlanWidth

public float getFloorPlanWidth()

Returns the width of the floor plan’s bounding box in meters. Returns zero if this floor doesn’t have any anchors.

getFloorPlanHeight

public float getFloorPlanHeight()

Returns the height of the floor plan’s bounding box in meters. Returns zero if this floor doesn’t have any anchors.

getFloorPlanHeading

public float getFloorPlanHeading()

Returns the heading/rotation of this floor’s floor plan clockwise in degrees. Returns zero if this floor doesn’t have any anchors.

getFloorPlanFlipped

public boolean getFloorPlanFlipped()

Returns whether or not this floor’s floor plan image is flipped. Returns zero if this floor doesn’t have any anchors.

Comparator

Collections.sort(floors, new ProximiioFloor.Comparator());

This is a class that implements the java.util.Comparator interface, and determines order with floor numbers. This class can be used to sort lists, for example.

ProximiioDepartment

Represents a department.

Parent

  • ProximiioFloor

Children

  • ProximiioInput
  • ProximiioGeofence

getTags

public String[] getTags()

Returns this department’s tags.

isExclusiveTrilateration

public boolean isExclusiveTrilateration()

If the trilateration is happening in this department, do we constrict the trilateration to this department only and drop all other departments’ beacons from trilateration? Defaults to true if it’s not present.

isModifyPositioning

public boolean isModifyPositioning()

Returns true if this department modifies positioning technologies used when the client is in this department. If so, these modifications will persist until another department applies its own modifications. Please note that these modifications do not completely override applications settings; they can’t turn on such technologies that aren’t enabled in the application.

isIBeacons

public boolean isIBeacons()

If this department modifies positioning technologies, do we enable iBeacons?

isEddystones

public boolean isEddystones()

If this department modifies positioning technologies, do we enable Eddystones?

isIndoorAtlas

public boolean isIndoorAtlas

If this department modifies positioning technologies, do we enable IndoorAtlas?

isNativePositioning

public boolean isNativePositioning

If this department modifies positioning technologies, do we enable native positioning?

ProximiioInput

Represents an input.

Parent

  • ProximiioDepartment

Children

  • None

InputType

enum InputType

Key Description
InputType.IBEACON iBeacon-spec BLE device
InputType.EDDYSTONE Eddystone-spec BLE device
InputType.CUSTOM Custom input
InputType.GENERIC_BLE BLE device

getInputType

public InputType getInputType()

Returns the type of this input.

getLat

public double getLat()

Returns this input’s latitude, in WGS84.

getLon

public double getLon()

Returns this input’s longitude, in WGS84.

ProximiioGeofence

Represents a geofence.

Parent

  • ProximiioDepartment

Children

  • None

Event

enum Event

Key Description
Event.ENTER Enter event
Event.EXIT Exit event

EventType

enum EventType

Key Description
EventType.BEACON Single BLE device
EventType.INDOORATLAS IndoorAtlas
EventType.DISCONNECT Shutting down
EventType.NATIVE Native positioning: WiFi, GPS, etc.
EventType.DELETED Geofence deleted
EventType.TRILATERATED Multiple BLE devices
EventType.CUSTOM Custom input

isEntered

public boolean isEntered()

Returns true if this client is inside this geofence.

getAddress

@Nullable public String getAddress()

Returns this geofence’s address if available.

getLat

public double getLat()

Returns this geofence’s latitude, in WGS84.

getLon

public double getLon()

Returns this geofence’s longitude, in WGS84.

getRadius

public double getRadius()

Returns this geofence’s radius, in meters.

getPolygon

@Nullable public double[][] getPolygon()

If this geofence is a polygon, return the polygon. The return value is an array of latitude and longitude pairs, describing the vertices of the polygon in order.

getMetadata

@Nullable public JSONObject getMetadata()

Returns the JSON content set to this geofence.

ProximiioApplication

Settings to be used with mobile devices. You can define multiple applications for different use cases.

NativeAccuracy

enum NativeAccuracy

Key Description
NativeAccuracy.CELLULAR_LOW_POWER Low power, cellular positioning
NativeAccuracy.WIFI_BALANCED_POWER Balanced power, Wifi fingerprint + cellular positioning
NativeAccuracy.GPS_HIGH_POWER GPS + Wifi + cellular, very high power, but accurate.

getStringValues

public static ArrayList<String> getStringValues()

Returns the String representations of all available NativeAccuracy values.

fromString

public static NativeAccuracy fromString(String s)

Construct a NativeAccuracy from a String. If s is not equal to any of getStringValues, this will return NativeAccuracy.GPS_HIGH_POWER.

getID

public String getID()

Returns the ID of this application.

getName

public String getName()

Returns the name of this application.

isRemoteMode

public boolean isRemoteMode()

Does this application load resources based on the current location?

This should be set to enabled when there are lots of items (over a couple hundred places, inputs, geofences, etc.).

isNetworkInterval

isNetworkInterval()

Returns true if this application sends network data in bursts to save battery.

getNetworkInterval

public int getNetworkInterval()

Returns the burst interval in milliseconds.

getNativeActivationTime

public int getNativeActivationTime()

Returns the time it takes for native positioning to take over after no position updates from other sources, in milliseconds.

isGeofencePositioning

public boolean isGeofencePositioning()

Returns true if this application sends position updates over the network only if the client is inside a geofence.

isEddystones

public boolean isEddystones()

Returns true if this application has Eddystone beacons enabled.

isIBeacons

public boolean isIBeacons()

Returns true if this application has iBeacons enabled.

isBluetoothTrilateration

public boolean isBluetoothTrilateration()

Returns true if this application uses advanced Bluetooth positioning.

isIndoorAtlas

public boolean isIndoorAtlas()

Returns true if this application has IndoorAtlas enabled.

isNativePositioning

public boolean isNativePositioning()

Returns true if this application has native positioning enabled.

getNativeAccuracy

public NativeAccuracy getNativeAccuracy()

Returns the accuracy level of the native positioning.

getIndoorAtlasApiKey

@Nullable public String getIndoorAtlasApiKey()

Returns the IndoorAtlas API Key of this application, if it has one.

getIndoorAtlasApiKeySecret

@Nullable public String getIndoorAtlasApiKeySecret()

Returns the IndoorAtlas API Key Secret of this application, if it has one.

getJSON

@Nullable public String getJSON()

Constructs JSON from this object. Returns null if internal parsing fails.

fromJSON

@Nullable public static ProximiioApplication fromJSON(String json)

Create a ProximiioApplication instance from JSON. Returns a new instance of ProximiioApplication if the JSON is valid, null otherwise.

ProximiioBLEDevice

Represents a device found by Bluetooth Low Energy scan.

This is a base class for BLE devices. The type of the device can be found by using ProximiioBLEDevice.getType. If the type is IBEACON, this class can be cast to ProximiioIBeacon. If the type is EDDYSTONE, this class can be cast to ProximiioEddystone.

Proximity

enum Proximity

Key Description
Proximity.UNKNOWN Unknown distance.
Proximity.IMMEDIATE The device is very close by.
Proximity.NEAR The device is near.
Proximity.FAR The device is far.

getMAC

public String getMAC()

Returns the MAC address of this beacon.

getDistance

@Nullable public Double getDistance()

Returns the estimated distance to this device in meters. This value is averaged over the last scan cycle. If no value is available, returns null.

getProximity

public Proximity getProximity()

This returns an estimate of the zone this device is in. This values is based on the accuracy level.

getRSSI

public int getRSSI()

The signal strength of this device. This is used with TxPower to determine accuracy.

getTxPower

@Nullable public Integer getTxPower()

Returns the preconfigured transmit power value of the device. This is used with RSSI to determine accuracy. Null if not available.

getInput

@Nullable public ProximiioInput getInput()

Returns the ProximiioInput linked to this device, if one is available, otherwise null. This means that the device matches the defined input.

getName

@Nullable public String getName()

Returns the name of this device.

getType

public ProximiioInput.InputType getType()

Returns the type of this device.

The following values are possible:

  • IBEACON
  • EDDYSTONE
  • GENERIC_BLE

Comparator

Collections.sort(devices, new ProximiioBLEDevice.Comparator());

This is a class that implements the java.util.Comparator interface, and determines order with distance. This class can be used to sort lists, for example.

ProximiioIBeacon

Represents a device found by Bluetooth Low Energy scan, that matches the iBeacon specification.

getUUID

public String getUUID()

The UUID of this device, as in iBeacon spec.

getMajor

public int getMajor()

The major value of this device.

getMinor

public int getMinor()

The minor value of this device.

ProximiioEddystone

Represents a device found by Bluetooth Low Energy scan, that matches the Eddystone specification.

getNamespace

@Nullable public String getNamespace()

The namespace of this device. Available if this device has the UID feature.

getInstanceID

@Nullable public String getInstanceID()

The instance ID of this device. Available if this device has the UID feature.

getBatteryVoltage

@Nullable public Integer getBatteryVoltage()

The battery voltage in mV. Available if this device has the TLM feature.

getTemperature

@Nullable public Float getTemperature()

The temperature measured by this device in Celsius. Available if this device has the TLM feature.

getUptime

@Nullable public Long getUptime()

The time since boot in milliseconds. Available if this device has the TLM feature.

getAdCount

@Nullable public Long getAdCount()

The advertising count of this device since boot. Available if this device has the TLM feature.

getURL

@Nullable public String getURL()

The URL of this device. Available if this device has the URL feature.

getEID

@Nullable public String getEID()

The EID of this device. Available if this device has the EID feature.

hasFeature

public boolean hasFeature(int feature)

Check what frame types this Eddystone has available. Returns true if one or more of the specified features are available. These will be updated as the device transmits more packets / frame types.

You can submit the following as the feature parameter (or combine them with the | operator):

  • ProximiioEddystone.FEATURE_UID
  • ProximiioEddystone.FEATURE_TLM
  • ProximiioEddystone.FEATURE_URL
  • ProximiioEddystone.FEATURE_EID

ProximiioPathfindingResult

Pathfinding result, representing a path with a list of type ProximiioPathfindingNode.

getPath

public ArrayList<ProximiioPathfindingNode> getPath()

Get the list of nodes this path is made of. First item in the list is the starting point and the last item is the end point. Some of the nodes are generated by the pathfinding algorithm, and don’t have IDs or neighbour IDs.

isFinished

public boolean isFinished(double lat, double lon, double radius, @Nullable String currentFloorID)

Check if you have reached the end of the path. Returns true if the provided location was closer or as far as the supplied radius from the end point of the path, and if the floor ID supplied was the same as the end point’s floor ID. Null floor ID only checks coordinates.

ProximiioPathfindingNode

Pathfinding node, a waypoint, intersection. These are used to represent data for pathfinding. See ProximiioPlace.getPath.

getLat

public double getLat()

This node’s latitude.

getLon

public double getLon()

This node’s longitude.

getID

public String getID()

This node’s ID.

getFloorID

public String getFloorID()

The ID of the floor this node belongs to.

getNeighbourIDs

public String[] getNeighbourIDs()

Get an array of neighbouring nodes’ IDs. These are the nodes that are reachable from this node.

getNeighbours

public ArrayList<ProximiioPathfindingNode> getNeighbours()

Get a list of resolved neighbors, as defined in neighbourIDs. Available after calling ProximiioPlace.getPath for the first time, provided that the place has a list of nodes that this node belongs to. Returns null if this node isn’t initialized by ProximiioPlace.getPath.

getDistance

public float getDistance(ProximiioPathfindingNode node)

Get the distance between two nodes in meters.

ProximiioGoogleMapHelper

private ProximiioMapHelper mapHelper;

@Override
public void onMapReady(GoogleMap googleMap) {
    mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap).build();

    googleMap.setOnMyLocationButtonClickListener(mapHelper);
    googleMap.setOnMapClickListener(mapHelper);
    googleMap.setOnCameraIdleListener(mapHelper);
    googleMap.setOnMarkerClickListener(mapHelper);
    googleMap.setOnCameraMoveStartedListener(mapHelper);
}

@Override
protected void onDestroy() {
    super.onDestroy();
    if (mapHelper != null) {
        mapHelper.destroy();
    }
}

With this, you can integrate Proximi.io with Google Maps easily. You can turn features on and off based on your needs.

Features include:

  • Positioning
  • Floor plan images
  • Markers for inputs and geofences
  • Positioning heat map
  • Pathfinding
  • Auto-rotation with magnetometer
  • Floor changing / multiple floor support

To get started, take a look at the ProximiioGoogleMapHelper.Builder.

All Builder methods are available in the ProximiioGoogleMapHelper object as getters and setters as well, so you can change your features and settings on the fly if you need to.

ClusterState

An enum representing the clustering mode of markers.

Key Description
ClusterState.NEVER_CLUSTER Never cluster markers together.
ClusterState.ALWAYS_CLUSTER Always use clustering where suitable.
ClusterState.USE_APPLICATION Cluster if the ProximiioApplication.isRemoteMode setting of the current application is true.

Listener

This can be used to receive callbacks on map events.

changedFloor

public void changedFloor(@Nullable ProximiioFloor floor)

Called when the displayed floor has changed. This is different from ProximiioListener.changedFloor, if Builder.floorID or ProximiioMapHelper.floorDown methods are used, for example.

pathfindingTo

public void pathfindingTo(double lat, double lon, @Nullable String floorID)

If pathfinding and positioning are enabled, request a path to be displayed to the specified location and floor.

floorUp

mapHelper.floorUp();

public void floorUp()

Go up one floor. Changes the visible floor to be one floor up from the current.

Floor ordering is guaranteed only if floor numbers (ProximiioFloor.getFloorNumber) are available.

floorDown

mapHelper.floorDown();

public void floorDown()

Go down one floor. Changes the visible floor to be one floor down from the current.

Floor ordering is guaranteed only if floor numbers (ProximiioFloor.getFloorNumber) are available.

destroy

@Override
protected void onDestroy() {
    super.onDestroy();
    if (mapHelper != null) {
        mapHelper.destroy();
    }
}

public void destroy()

Call this to clean up.

ProximiioGoogleMapHelper.Builder

public Builder(@NonNull Context context, @NonNull GoogleMap googleMap)

Use this to build a new ProximiioGoogleMapHelper.

Use the methods below to customize the map features. You can chain multiple method calls together before the final call to build.

positioning

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .positioning(true)
        .build();

public Builder positioning(boolean enabled)

Set the current position of the user automatically on the map, as position gets updated with ProximiioListener.position.

  • This is enabled by default.

pathfinding

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .pathfinding(true)
        .build();

public Builder pathfinding(boolean enabled)

Enable or disable pathfinding. A path will be calculated from the current position to the tapped spot on the map.

This requires that you have set up pathfinding for the displayed floor’s place, with the Proximi.io Management Application for example.

  • This is enabled by default.
  • This requires positioning.

autoRotateAndFollow

private ProximiioMapHelper mapHelper;

@Override
public void onMapReady(GoogleMap googleMap) {
    mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .autoRotateAndFollow(true)
        .build();

    googleMap.setOnMyLocationButtonClickListener(mapHelper);
    googleMap.setOnMapClickListener(mapHelper);
    googleMap.setOnCameraIdleListener(mapHelper);
    googleMap.setOnMarkerClickListener(mapHelper);
    googleMap.setOnCameraMoveStartedListener(mapHelper);
}

@Override
protected void onResume() {
    super.onResume();
    if (mapHelper != null) {
        mapHelper.onResume();
    }
}

@Override
protected void onPause() {
    super.onPause();
    if (mapHelper != null) {
        mapHelper.onPause();
    }
}

@Override
protected void onDestroy() {
    super.onDestroy();
    if (mapHelper != null) {
        mapHelper.destroy();
    }
}

public Builder autoRotateAndFollow(boolean enabled)

Set automatic rotation + following of the current position based on the device’s magnetic sensor. If a magnetic sensor is not available, rotation won’t be performed.

If you enable this, it’s necessary to call ProximiioGoogleMapHelper.onPause and ProximiioGoogleMapHelper.onResume to pause and resume the magnetic sensor to save battery.

  • This is disabled by default.
  • This requires positioning.

followPositioning

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .followPositioning(true)
        .build();

public Builder followPositioning(boolean enabled)

Enable or disable the map camera following the current position.

The map camera will stop following the current position if the map is moved around, and will continue following when the “My Location” -button is tapped.

This has no effect if Builder.autoRotateAndFollow is set to true, as it already follows the current position.

  • This is enabled by default.
  • This requires positioning.

floorID

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .floorID("yourFloorIDhere")
        .build();

public Builder floorID(@Nullable String floorID)

Set the floor for the map manually.

  • This is null by default (the current floor from ProximiioListener.changedFloor is used).

showFloorPlan

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .showFloorPlan(true)
        .build();

public Builder showFloorPlan(boolean show)

Show the floor plan of the current floor (from ProximiioListener.changedFloor), or the floor plan of the specified floor ID.

  • This is enabled by default.

showFloorIndicator

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .showFloorIndicator(true)
        .build();

public Builder showFloorIndicator(boolean show)

Show a floor indicator next to the current position, when the floor displayed is different from the actual current floor (but not in a different place).

For example, if the current floor (ProximiioListener.changedFloor) is floor number 2 and the floor visible is number 1, a small arrow up is displayed to indicate that the current position is above the visible floor. This is possible, for example, if Builder.floorID or ProximiioGoogleMapHelper.floorUp is used.

  • This is enabled by default.
  • This requires positioning.

showInputMarkers

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .showInputMarkers(true)
        .build();

public Builder showInputMarkers(boolean show)

Show markers of inputs on the map.

  • This is enabled by default.

showGeofenceMarkers

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .showGeofenceMarkers(true)
        .build();

public Builder showGeofenceMarkers(boolean show)

Show markers of geofences on the map. Radius of the geofence is indicated when the marker is tapped.

  • This is enabled by default.

showPositionHeatMap

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .showPositionHeatMap(true)
        .build();

public Builder showPositionHeatMap(boolean show)

Show a single-color position history heat map.

  • This is enabled by default.
  • This requires positioning.

heatMapEntries

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .heatMapEntries(10)
        .build();

public Builder heatMapEntries(int amount)

Set the maximum number of heat map entries.

  • This is 25 by default.
  • This requires position heat map.

pathWidth

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .pathWidth(10)
        .build();

public Builder pathWidth(int pixels)

Set the width of the pathfinding path in pixels.

  • This is 5 pixels by default.
  • This requires pathfinding.

pathEndDistance

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .pathEndDistance(5)
        .build();

public Builder pathEndDistance(double meters)

Set the distance from the path end point at which the path is completed and erased.

  • This is 2 meters by default.
  • This requires pathfinding.

initialPositioningZoom

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .initialPositioningZoom(20)
        .build();

public Builder initialPositioningZoom(float zoomLevel)

Set the initial zoom level of the map when using positioning. See Google’s documentation about zoom levels.

  • This is 19.5 by default.
  • This requires positioning.

clusterMarkers

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .clusterMarkers(ProximiioGoogleMapHelper.ClusterState.NEVER_CLUSTER)
        .build();

public Builder clusterMarkers(ClusterState clusterState)

Set the cluster mode of markers. See ProximiioGoogleMapHelper.ClusterState.

  • This is ClusterState.USE_APPLICATION by default.
  • This requires input and/or geofence markers.

includeMarkers

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .includeMarkers(new String[] { "firstMarkerID", "secondMarkerID" })
        .build();

public Builder includeMarkers(@Nullable String[] ids)

Set which inputs’ and geofences’ markers are displayed.

  • All markers are displayed by default.
  • This requires input and/or geofence markers.

excludeMarkers

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .excludeMarkers(new String[] { "firstMarkerID", "secondMarkerID" })
        .build();

public Builder excludeMarkers(@Nullable String[] ids)

Set which inputs’ and geofences’ markers are not displayed.

  • All markers are displayed by default.
  • This requires input and/or geofence markers.

pathColor

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .pathColor(Color.BLUE)
        .build();

public Builder pathColor(int argb)

Set the color of the pathfinding path, in ARGB hex (see the Color class).

  • This is Color.RED by default.
  • This requires pathfinding.

heatMapColor

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .heatMapColor(0x0B00FF00)
        .build();

public Builder heatMapColor(int argb)

Set the color of heat map entries, in ARGB hex (see the Color class).

  • This is 0x0D0000FF by default.
  • This requires position heat map.

inputMarkerColor

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .inputMarkerColor(BitmapDescriptorFactory.HUE_BLUE)
        .build();

public Builder inputMarkerColor(float hue)

Set the color of input markers, as a color hue (see BitmapDescriptorFactory for examples).

  • This is BitmapDescriptorFactory.HUE_BLUE by default.
  • This requires input markers.

geofenceMarkerColor

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .geofenceMarkerColor(BitmapDescriptorFactory.HUE_RED)
        .build();

public Builder geofenceMarkerColor(float hue)

Set the color of geofence markers, as a color hue (see BitmapDescriptorFactory for examples).

  • This is BitmapDescriptorFactory.HUE_RED by default.
  • This requires geofence markers.

inputMarkerAreaColor

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .inputMarkerAreaColor(0xFF0000FF)
        .build();

public Builder inputMarkerAreaColor(int argb)

Set the color for input area, in ARGB hex (see the Color class).

  • This is 0xFF0000FF by default.
  • This requires input markers.

geofenceMarkerAreaColor

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .geofenceMarkerAreaColor(0x10FF0000)
        .build();

public Builder geofenceMarkerAreaColor(int argb)

Set the color for geofence area, in ARGB hex (see the Color class).

  • This is 0x33FF0000 by default.
  • This requires geofence markers.

listener

mapHelper = new ProximiioGoogleMapHelper.Builder(this, googleMap)
        .listener(new ProximiioGoogleMapHelper.Listener() {
            @Override
            public void changedFloor(@Nullable ProximiioFloor floor) {
                // Floor changed
            }
        })
        .build();

public Builder listener(Listener listener)

Set the listener for map events.

See Listener.

build

public ProximiioGoogleMapHelper build()

Create a new ProximiioGoogleMapHelper object from this Builder. The new object will begin operation and add specified features to the map.