BuzzScreen SDK Basic Usage
Please refer to the sample code before implementing into your application. - Github Link
BuzzScreen SDK Workflow
Index
Getting Started
1) Introduction
BuzzScreen SDK is Buzzvil's library for integrating BuzzScreen with Android lockscreen apps. Please check the notes below before proceeding integration.
Make sure to discuss with your account manager before start integrating.
It is required to submit the integrated APK file to your account manager for review before going live.
Following GDPR(General Data Protection Regulation), Buzzvil has implemented additional functions for user consent and updated privacy policy. For publishers who have EU users where GDPR applies, please refer to https://buzzvil.atlassian.net/wiki/spaces/BDG/pages/409764056 for integration modification.
2) Requirements
Content | Details | Note | |
---|---|---|---|
1 | Android version |
| If |
2 | In BuzzScreen SDK 2.0.2.0 or higher:
| The policy goes into effect in
| |
3 | If |
|
|
3) Prerequisites
Content | Details | Note | |
---|---|---|---|
1 | Login API | Media API server for login to lockscreen app |
|
2 | Reward API | Media API server that will actually process the request and provide rewards for the user. | For more information, please refer to https://buzzvil.atlassian.net/wiki/spaces/BDG/pages/396394955 doc. |
3 | Key values necessary for the integration |
|
|
1. build.gradle
Setting
If buzzscreen-multiprocess SDK was previously implemented, switching the SDK to the regular version without any changes may cause some issues. Please refer to the related document(link) and remove android:process=":locker
attribute in AndroidMafniest.xml
.
Add the following codes to build.gradle
in your app module.
repositories {
maven { url "https://dl.buzzvil.com/public/maven" }
}
dependencies {
implementation 'com.buzzvil:buzzscreen:2.0.6.3'
}
dependencies {
// For global publishers only
implementation 'com.buzzvil.mediation:sdk-outbrain:2.5.3.1'
}
2. AdNetwork Integration
Technical account manager may provide information regarding additional adnetwork integration. If so, please add corresponding information to AndroidManifest.xml
by referring to this document.
3. Call Methods
In order to integrate BuzzScreen into Android apps, please follow the 3 steps below: 1) Initialization → 2) Set User Profile → 3) Turn on/off the Lock Screen
1) Initialization : call init()
and launch()
Content | Code | Place | Details |
---|---|---|---|
Initialize BuzzScreen |
| Place this code in the
|
|
Launch BuzzScreen |
| Call this method in the very first activity of your app. |
|
Sample Code
2) Set User Profile
Content | Code | Place | Details |
---|---|---|---|
Object for setting user profile information |
| Keep in mind that you must set user information before calling | Returns |
User ID Required |
|
| |
User age recommended |
|
| |
User genderrecommended |
|
| |
User region optional |
|
| |
Else optional | Please refer to doc. | You can target with specific user information you want. |
3) Turn on/off the Lock Screen
Content | Code | Place | Details |
---|---|---|---|
BuzzScreen Activation required |
| Turn on BuzzScreen.
| Activates BuzzScreen; BuzzScreen appears on the first screen after this method is called. |
BuzzScreen Deactivation required |
| Turn off BuzzScreen. | BuzzScreen will no longer appear on the first screen after this method is called. |
User logout required |
| Call this when the user has logged-out. | This method calls |
Dismiss BuzzScreen activity when there’s no user activity recommended |
| Call this method after | Set time (in seconds) for which BuzzScreen disappears when there is no user activity.
|
Get callback when BuzzScreen is ready to be shown optional |
|
| You can get a callback when the lock screen is ready. Implement and provide the following interface and pass it as the parameter for the |
Customize Service Notification optional | Please refer to doc. |
| If un-removable ongoing notification is created at Notification area after calling this method and you want to change it, please follow the guide. The guide shows you how to make use of the notification. |
4. Security Lock UI Customization
UI customization for ‘Security Lock’ is done after BuzzScreen.init()
using the following methods:
backgroundResourceId(int resourceId):
Sets background image for 'Swipe' modebackgroundImageScaleType(enum ImageView.ScaleType)
: Sets alignment of background image for 'Swipe' mode (default: FIT_XY, Reference: link)backgroundColor(int Color)
: Sets background color for 'Swipe' mode (default: Color.WHITE, Reference: link)backgroundDimAlpha(float):
Adjusts alpha value of black background for readability of clock and description (default: 0.7)showClock(boolean):
Determines whether to show clock feature or not (default: true)showDescription(boolean)
: Determines whether to show description or not (default: true)
<Sample code>
5. Gaining “Draw Over Other Apps” permission
Due to the restrictions in Android 10, enabling “Draw Over Other Apps” permission has become inevitable for using the lockscreen. Thus, we provide facile methods to gain the permission from users.
1) Lockscreen notification
Automatically added feature
Not shown to users with Android 7 (Nougat) or below
Displayed every 6 hours until the permission has been enabled
2) In-App notification
boolean BuzzScreen#showOverlayPermissionGuideDialogIfNeeded(Activity)
:Displays a popup dialog to gain the permission
Recommended to be used when the app’s main UI is created (
MainActivity#OnCreate()
) or when the lockscreen has been enabledreturns a boolean to show whether the popup dialog has been exposed or not
Clicking
Yes
leads the user to settings menu where the permission can be enabled. Once enabled, the user is redirected back to the previous UI.Not shown to users with Android 7 (Nougat) or below and also if the permission has been already enabled.
6. Reward Accumulation (via Postback) - Server to Server Integration
When a reward accumulation event occurs from a user, BuzzScreen does not handle this in the client side. Instead the BuzzScreen server will make a reward accumulation request to the publisher's server and the publisher's server should process the request and provide rewards for the user.
Procedure
Build a postback end-point server according to the guide.
Send the endpoint url to Buzzvil BD manager.
Point accumulation request flow