General On-boarding Steps for ALL Android SDKs
Step 1: Add the Phunware Maven remote repository
Insert this block into allprojects -> repositories: Add the following to your
repositories tag in your top level
Step 2: Add Needed Permissions
In the Android manifest, the following permissions are needed:
NOTE: BLE and Android SDK version 4.3 (API 18) or above are required if Bluetooth is actually is going to be used. If your users only are going to use Bluetooth for positioning, you should change the android:required attribute to true (this will filter out non-BLE devices at Google Play). Observe that the WAKE_LOCK permission can be removed, but background navigation performance might become worse.
Step 3 - Retrieve App ID, Access Key and Signature Key from MaaS Portal
Add your app to Mass Portal.
- Login with your Org credentials
- Click Apps in the left nav
- Click New at the top right
- Enter your App Name
- Select the App Platform
- Select the App Category (for app store)
- Click Save
- In the App list find you app and click the ellipsis.
- Select Show Keys in the action menu
- The keys are exposed that you need to enter in the Manifest.
The App UUID is required if you are using Phunware's App Builder to create your apps.
Step 4: Add Phunware key resources to strings.xml for App Id, Access Key, Signature Key
Add the keys obtained in step 4 to strings.xml.
Step 5: Add Phunware keys for App Id, Access Key, and Signature Key to Manifest
Add the keys obtained in step 4 to Manifest.
On-boarding Steps for Android Mapping/Location SDKs
Step 1: Add the Mapping SDK as a dependency in your app's build.gradle file
These two lines includes all dependencies necessary to use the Phunware Mapping and Location SDKs.
The Core SDK (and all of its parts) is automatically integrated with the Mapping SKD.false
NOTE: The SDK version number in should always reflect the most recent build from the GitHub repository.
Step 3: Add your Google Maps Api Key to AndroidManifest.xml
Create a string resource that contains your Google Maps API Key.
If you need help getting a Google Maps API Key, please find instructions here: Get a Google Maps API key
On-boarding Steps for Android Engagement SDK
Step 1: Setup GCM Service in MaaS
If you are planning on sending Alerts and Notifications (Broadcast Campaigns), you have obtained Android and iOS keys needed to push notifications from your app.
Navigate to Phunware's MaaS portal to find your App.
After you have obtained your keys:
Go to the MaaS portal Accounts -> Apps and find the desired App in the alphabetical list
Click on the ellipsis to reveal the Action Menu
Enter your keys under Marketing Automation Options
Step 2: Add the Mobile Engagement SDK as a dependency in your app's
The Core SDK is automatically imported with the Mobile Engagement SDK.
Step 3: (Optional) Add beacon support if you are using beacons
If you would like to take advantage of the Mobile Engagement SDK's beacon support, simply add the
With properly configured beacons in your environments, no other code changes are required to take advantage of beacon-based messaging.
Step 4: Add Location and Storage permissions to Manifest
This allows you to utilize location-based messages and beacon messaging.NOTE: Background location notifications currently cannot work with runtime permissions required for apps targeting Android SDK level 23 and higher, so your targetSdkVersion in your build.gradle file must be 22 or lower.
Step 5: Configure the Mobile Engagement SDK with your environment
You should only initialize the Mobile Engagement SDK once, after you initialize PwCoreSession. Once it's complete, you can access the Location, Message and Attribute managers directly.
Once initialization is complete, users will be automatically notified with your custom broadcast messages. If you have location and storage permissions they will also be able to receive messages for location events, like entering a retail store.
Step 6: Designate an Activity to launch from notifications
Notifications can be customized by extending the
This launches your activity from a notification with message and promo information.
Step 7: Show Messages
Using the NOTE: Calls to the MessageManager are asynchronous, and may require loading data from the network.
MessageManager you can easily show a list of available messages.
Step 8: Customizing Notifications
This service allows app developers to customize notifications. It must be implemented initially even if the user would like to just use standard out of the box notifications.
Step 9: Enable Push Notifications
New in Version 3.1.2 is the ability to use the SDK with or without push notifications as a feature. Enabling push notifications is as easy as enabling them through a simple call to the Engagement API