Android SDK quick start
Get started with the Pushwoosh Android SDK using this quick and simple example
Prerequisites
To integrate the Pushwoosh Android SDK into your app, you will need the following:
Download the example project
Clone the example project from GitHub:
git clone https://github.com/Pushwoosh/pushwoosh-android-sample
Configure the project
Place your google-services.json file in the pushwoosh-demoapp/app directory.
In your build.gradle (Module: app), update the
applicationId
to match your package name.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
<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>
Run the project
- Build and run the project.
- The app will have two tabs: “Actions” and “Settings”. Navigate to the Settings tab.
- Tap the Register for Pushes button.
- Grant permission for push notifications. The device will be registered with Pushwoosh.
You should see a log entry like this:
FirebaseApp initialization successfulLog level: INFOPushwoosh SDK initialized successfullyHWID: acf11f23-170d-4e65-8575-319b2795f8c3APP_CODE: _YOUR_PUSHWOOSH_APP_ID_PUSHWOOSH_SDK_VERSION: 6.7.18FIREBASE_PROJECT_ID: _YOUR_FIREBASE_PROJECT_ID_PUSH_TOKEN: cjdy....rk0Q
[DeviceRegistrar] Registered for push notifications: cjdy....rk0Q
Send a push notification
Go back to the Pushwoosh Control Panel and send a push notification to your registered device.
What’s next
To learn more, please refer to the basic integration guide