News Breaking
Live
wb_sunny

Breaking News

Cara memasang iklan mobilecore di aplikasi/APK android

Cara memasang iklan mobilecore di aplikasi/APK android

langkah pertama start eclipse / android studio kemudian  buat project baru


buka AndroidManifest.xml edit dan masukan script code dibawah ini



<!--will make sure the screen doesn’t turn off while the user is watching a video ad (only). -->

<uses-permission android:name="android.permission.INTERNET" />

<!--mobileCore SDK will fetch ads only if network connection is available. -->

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<!--will make sure the screen doesn’t turn off while the user is watching a video ad (only). -->

<uses-permission android:name="android.permission.WAKE_LOCK" />

<service
              android:name="com.ironsource.mobilcore.MobileCoreReport"
              android:enabled="true"
              android:exported="false" android:process=":mcServiceProcess">
</service>
<receiver
              android:name="com.ironsource.mobilcore.InstallationTracker"
              android:enabled="true"
              android:process=":installationTracker">
</receiver>
<activity
           android:name="com.ironsource.mobilcore.InterstitialVideoActivity"
           android:configChanges="keyboardHidden|orientation|screenSize"
           android:keepScreenOn="true"/>



kemudian buka MyActivity.java file ... edit dan masukan script code dibawah ini


public  class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MobileCore.init(this,"ISI DENGAN HASHCODE ANDA", LOG_TYPE.DEBUG,AD_UNITS.STICKEEZ,AD_UNITS.INTERSTITIAL,AD_UNITS.DIRECT_TO_MARKET,AD_UNITS.NATIVE_ADS);
if (MobileCore.isStickeeReady()) {
MobileCore.showStickee(MainActivity.this);
}
else if (MobileCore.isStickeeShowing() || MobileCore.isStickeeShowingOffers()) {
Toast.makeText(MainActivity.this, "Stickeez is currently showing.", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(MainActivity.this, "Stickeez isn't ready yet", Toast.LENGTH_SHORT).show();
}


});
}




jalankan aplikasi...

tara iklan anda sudah keluar


dan yang terakhir jangan sampai lupa untuk memasukan SDK ke dalam folder Libs


Tags

Newsletter Signup

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque.

Posting Komentar