Android
Requirements
Minimal Android version 4.4 (API level 19)
Include the SDK
Nefta SDK can be included as either a Gradle dependency or a manual download:
-
Gradle
Add the following repository to your repositories in project build.gradle:buildscript { repositories { google() mavenCentral() maven { url 'https://maven.nefta.app/android-sdk' } }
And then the following dependency in dependency section of your module build.gradle:
dependencies { implementation 'com.nefta:nefta-sdk:4.1.1' }
-
Manually
Or you can download the latest NeftaPlugin module from: https://github.com/Nefta-io/NeftaSDK-Android/releases.
Extract the NeftaPugin-release.aar file and include it in your Android project in /libs folder, so that it will look something like this:
Then include this module as a dependency in your project build.gradle:
implementation files('libs/NeftaPlugin-release.aar')
Permissions
For the SDK to work it requires permissions for the network which you need to add to your project AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Configuration
First configure your app on the platform to obtain the app id.
Code integration
You initialize the SDK with the following code:
import com.nefta.sdk.NeftaPlugin;
NeftaPlugin plugin = NeftaPlugin.Init(getApplicationContext(), "[[your_app_id]]");
Do this as soon as possible in the application startup! If you leave the appId parameter null or empty the SDK will run in demo mode. This means that it'll always show dummy ads. To test the native integration without dashboard configuration.
Updated 2 days ago