Step 1 - Enable Push Notifications for your application
Follow the instructions in Appoxee's Android Push Notifications Guide.
Step 2 - Download the Appoxee Android SDK
Go to the Android SDK Downloads page, download the Appoxee Android SDK and extract it to the designated Eclipse folder.
NOTE |
Using the Appoxee SDK for Android requires Eclipse installation with Android SDK Tools Revision 20 and above. |
- Choose your Eclipse workspace.
- Create a new Eclipse folder from an existing project.
- On the top menu choose "file" > "New" > "Other."
4. Select the "Android Project From Existing Code" option
...
- .Choose the Appoxee resources project and click "Finish".
...
Step 3 - Include the Appoxee Resources
...
NOTE |
Make sure that the file android-support-v4.jar is used only once inside your project. If you have a duplication error, remove the duplication from Appoxee Resources libs if exists. |
Step 4 - Integration
This section uses the following typographic conventions:
- Regular text = existing code you should already have in your project by default.
- Bold text = new code you should copy & paste / add to your application.
- Green text = comments about the function, what it does and what you can do with it including special notices. We recommend you read them thoroughly as well.
- Blue text - comments within XML files (i.e. AndroidManifest.xml)
...
{
//"Application Appoxee SDK Key" from your Application Settings
SetAppSDKKey("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
//"Application Appoxee Secret Key" from your Application Settings
SetAppSecretKey("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
//If your app have an inbox, use true, if not, use false
SetAppoxeeInboxEnable(true);
//This is the activity which will be launched after your receive push notification or after the inbox is closed.
SetAppDefaultActivityClass("com.myApp.DefaultActivity");
...
{
public void onCreate()
{
Appoxee.Setup(this, new AppoxeeConfiguration());
If prompted with an error, add this import command to enable Appoxee SDK usage:
...
NOTE |
Step b is not required if you are targeting your application to android version 4.1 or above (i.e. minSdkVersion 16). Please proceed to step c. |
...
You need to replace com.appoxee.example with the package name of your app as defined by the manifest tag, otherwise it will not work.
...
android:icon="@drawable/ic_launcher"
android:allowClearUserData="true"
android:enabled="true" android:name="MyApplication"/>
...
<receiver android:name="com.appoxee.gcm.GCMBroadcastReceiver"
<!-- Receive the actual message -->
<intent-filter>
<category android:name="com.appoxee.example" />
<!-- Receive the registration id -->
<intent-filter>
<category android:name="com.appoxee.example" />
NOTE |
If you are using Appoxee's SDK as a Push Only solution (without using the Inbox) this completes the integration procedure within the AndroidManifest.xml file. Please continue to step 4 to complete the rest of the integration by adding your java code. |
...
<activity android:name="com.appoxee.MoreApps"/>
<activity android:name="com.appoxee.Feedback"/>
<activity android:name ="com.appoxee.InboxMessage"/>
NOTE |
The Inbox feature guarantees your ability to engage the user with rich messages (note that the Inbox cannot be disabled by users, as opposed to Push Notifications) and gives you the option to access features such as Feedback and More Apps . The Inbox must be used in your application's code in order to show it and utilise its features (see Android SDK integration Instructions Step 5). |
...
<category android:name="android.intent.category.LAUNCHER" />
...
<!-- Receive the actual message -->
<intent-filter>
<category android:name="com.appoxee.example" />
<!-- Receive the registration id -->
<intent-filter>
<category android:name="com.appoxee.example" />
...
- The application needs to notify the Appoxee server when it starts/ends in order to allow the analytics functionality to work. The functions Appoxee.onStart() and Appoxee.onStop() needs to be called from the appropriate places (most likely from within your main activity)://Your Main Activity Code...
{
...@Override
public void onResume()
{super.onResume();}
Appoxee.onStart();@Override
public void onPause()
{super.onPause();}
Appoxee.onStop(); - If you enabled the Appoxee Inbox feature, it can be opened from any activity. In the example code below it will be opened from the main activity layout using openInbox():public void openInbox(View view){Intent intent = new Intent(this, Inbox.class);}
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
this.startActivity(intent); - It is recommended that in the activity layout you should add a button to open the inbox:<Button
android:id="@+id/open_inbox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="openInbox"
android:text="Open Appoxee Inbox" /> - In case you would like to show the number of unread message to the user, you can fetch them by using the following command:Appoxee.getUnreadMessages();
Step 5 - Push Icon Customization
To change the icon on the Android Push Notification panel:
- In the "Appoxee resources/res/drawable" replace "appoxee_default_icon.png" with another icon file.
- In the application project create a “drawable” resource by the name "appoxee_custom_icon.png". It will be used instead of the default one.
Step 6 - Inbox Customization
Appoxee Pro accounts can also change the Inbox design and customize its environment (this section is relevant for Appoxee Pro clients only. If you wish to upgrade to Pro please contact info@appoxee.com).
Step 7 -Try our feedback module
If you are using the Appoxee Inbox, all you have to do is enable it in your Appoxee app settings and hooray! check your inbox for our feedback module.
Step 8 - Testing your Application
After completing the steps above, try to build and run your application on your device. You can see in your debug console (LogCAT for Eclipse users) the logging process.
Step 9 - Validate your integration
- Test a push notification - if you have any problems, please read our Android Q&A section, it might be something common.
- If you have utilized the Appoxee In-App inbox – Please test the combination of Message + Push.
- Setup the push sending rate (in case you want to throttle incoming traffic when users click on your push notifications).
- Create your first Welcome Message using “Persistent” Message Type.
NOTE |
When encountering an issue or a question, please contact our support support@appoxee.com with the extracted log file. |
...