Android
Sample project with example integration can be downloaded from: https://github.com/Nefta-io/NeftaSDK-Android:
Requirements
Minimal Android version 4.1 (API level 16)
Include the SDK
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" />
Code integration
For this part, you will need your appId, which you can obtain here: https://docs-adnetwork.nefta.io/docs/configuration
To init the SDK in the code similar as bellow:
import com.nefta.sdk.Placement;
// Init the sdk
NeftaPlugin plugin = NeftaPlugin.Init(getApplicationContext(), "yourAppId");
// Start the actual SDK logic with retrieval of ad placement information
plugin.EnableAds(true);
// Prepares the base layout for caching and rendering of ads in the provided activity
plugin.PrepareRenderer(this);
// call when the application goes into foreground:
plugin.OnResume();
// call when the application goes into background:
plugin.OnPause();
Note that if you provide a null or empty string as the application ID, the SDK will run in demo mode; it will show testing ads, in case you want to test the technical client part, without configuring the backend.
With this, you can start bidding, showing, and earning with Nefta ads.
Updated 6 days ago