SDK Documentation

Step 1: Move umno jar file into app/libs

Step 2: add the following dependency to your build.gradle file

implementation ‘com.squareup.okhttp3:okhttp:3.10.0’
implementation ‘com.google.code.gson:gson:2.8.2’
implementation ‘com.google.android.gms:play-services-ads:15.0.1’

Step 3: Implemenet codes (sample)

public class TestActivity extends Activity {
private final static String TAG = "test";

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.test);
UmnoAd nativeAd = new UmnoAd(this, /*Your space id*/);
nativeAd.setListener(new UmnoAd.Listener() {
/**
@param ad - int ad_id = ad unique id
- String title = ad title
- String category = ad category
- String tracking_link - use tracking link when user interaction link click the ad container/button
- String description - ad description
- String price - ad play store price
*/
@Override
public void onAdLoaded(final Ad ad) {
// Use for display
Log.e("onAdLoaded", ad.getTitle());
runOnUiThread(new Runnable() {
@Override
public void run() {
TextView text1 = (TextView) findViewById(R.id.title);
TextView text2 = (TextView) findViewById(R.id.subtitle);
text1.setText(ad.getTitle());
text2.setText(ad.getCategory());

// Use for user interaction
Button button = (Button) findViewById(R.id.donwload_btn);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(ad.getTrackingLink())));
}
});
}
});
}

@Override
public void onAdError(String err) {
Log.e("onAdError", err);
}
});
nativeAd.loadAd();
}
}