Skip to content

Android SDK quick start

Get started with the Pushwoosh Android SDK using this quick and simple example

To integrate the Pushwoosh Android SDK into your app, you will need the following:

Clone the example project from GitHub:

Terminal window
git clone https://github.com/Pushwoosh/pushwoosh-android-sample
  1. Place your google-services.json file in the pushwoosh-demoapp/app directory.

  2. In your build.gradle (Module: app), update the applicationId to match your package name.

  3. In res/values/strings.xml, replace the placeholder values with your specific details:

  • pushwoosh_app_id: Use your Pushwoosh App Code.
  • fcm_sender_id: Use your Firebase Project Number.
  • pushwoosh_api_token: Use your Pushwoosh Device API Token
strings.xml
<resources>
<string name="app_name">demoapp</string>
<string name="title_home">Actions</string>
<string name="title_notifications">Settings</string>
<string name="pushwoosh_app_id">_YOUR_PUSHWOOSH_APP_ID_</string>
<string name="fcm_sender_id">_YOUR_FIREBASE_PROJECT_ID_</string>
<string name="pushwoosh_api_token">_YOUR_PUSHWOOSH_DEVICE_API_TOKEN_</string>
</resources>
  1. Build and run the project.
  2. The app will have two tabs: “Actions” and “Settings”. Navigate to the Settings tab.
  3. Tap the Register for Pushes button.
  4. Grant permission for push notifications. The device will be registered with Pushwoosh.

You should see a log entry like this:

Logcat
Log level: INFO
[RequestPermissionHelper] Requesting permissions
Pushwoosh SDK initialized successfully
HWID: __HWID_OF_YOUR_DEVICE__
APP_CODE: __YOUR_PUSHWOOSH_APP_ID__
PUSHWOOSH_SDK_VERSION: __PUSHWOOSH_SDK_VERSION_INSTALLED__
FIREBASE_PROJECT_ID: __YOUR_FIREBASE_PROJECT_ID__
PUSH_TOKEN:
User ID "__USER_ID_OF_THE_DEVICE__" successfully set
[NotificationManager] Registered for push notifications: __DEVICE_PUSH_TOKEN__

Go back to the Pushwoosh Control Panel and send a push notification to your registered device.

To learn more, please refer to the basic integration guide