Step 1: Move <a href=”http://goo.gl/mniJCV”>acircirlelab jar file</a> into app/libs
Step 2: add the following dependency to your build.gradle file
compile ‘com.squareup.okhttp3:okhttp:3.5.0’
compile ‘com.google.code.gson:gson:2.7’
compile ‘com.google.android.gms:play-services-ads:11.0.4’
Step 3: Implement codes (sample)
AcirclelabAd nativeAd = new AcirclelabAd(this, /*Your space id*/); nativeAd.setListener(new AcirclelabAd.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 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()); // text1.setText(ad.getDescription()); // text1.setText(ad.getPrice()); // 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();