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"/>
<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();
}
});
}
@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
This comment has been removed by the author.
ReplyDeletedan yang terakhir jangan sampai lupa untuk memasukan SDK ke dalam folder Libs.
ReplyDeleteTanya mas, Sdk apa yang dimasukkan ?
sudah saya coba, mas tapi gagal.
ada error di
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);
Apa yang kurang mas ?