Skip to main content

Add Admob Interstitial Ads To Your Sketchware Project Using AIDE

Add Admob Interstitial Ads To Your Sketchware Project Using AIDE

1) Export your Project from Sketchware. The project will be in the format of zip file.Extract it.Check whether any files are missing.In my case the build.gradle file was missing.So I copied the build.gradle file of my previous project and pasted it .
Note : After pasting , change the application id in the build.gradle file to the package name of the project in which you want to add Ads




Skip the Above steps if your project file contains build.gradle

2) Open the project in AIDE . Navigate to build.gradle which is in the app directory

Add the following code 

compile ''


3)Navigate to AndroidManifest.xml and add the following Code

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


Also add the activity

<activity android:name=""
android:theme="@android:style/Theme.Translucent" />


4)Open .Add the following Code.



private InterstitialAd mInterstitialAd;


mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.loadAd(new AdRequest.Builder().build());


Set Up adListener

mInterstitialAd.setAdListener(new AdListener() {
public void onAdLoaded() {
// Code to be executed when an ad finishes loading.
Log.i("Ads", "onAdLoaded");

public void onAdFailedToLoad(int errorCode) {
// Code to be executed when an ad request fails.
Log.i("Ads", "onAdFailedToLoad");

public void onAdOpened() {
// Code to be executed when the ad is displayed.
Log.i("Ads", "onAdOpened");

public void onAdLeftApplication() {
// Code to be executed when the user has left the app.
Log.i("Ads", "onAdLeftApplication");

public void onAdClosed() {
// Code to be executed when when the interstitial ad is closed.
Log.i("Ads", "onAdClosed");
mInterstitialAd.loadAd(new AdRequest.Builder().build());


Use this code to display Ads

if (mInterstitialAd.isLoaded()) {
        } else {
           Log.d("TAG", "The interstitial wasn't loaded yet.");



Video Link

If you have any doubts you can comment below


Post a comment

Did you like this tutorial ?

Popular posts from this blog

Add Edittext Inside Dialog Box

Add Edittext Inside Dialog Box

If you haven`t yet watched the video...Watch it right now!!!

The code used in the above video is available here.
final EditText edittext1= new EditText(MainActivity.this); LinearLayout.LayoutParams lpar = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); edittext1.setLayoutParams(lpar); dialog.setView(edittext1);


Create Custom Popup Window using Sketchware

Create Custom Popup Window using Sketchware

Refer the video below if  you get stuck. 

1) Add a custom view named window.You can name it according to your wish. 
2)Design your popup window. 
2) Now, In the logic section,In OnCLick event of button.Add the following  code
Create a view
View popupView = getLayoutInflater().inflate(R.layout.window, null);
Popup window 

final PopupWindow popup = new PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
Button b1 = popupView.findViewById(; Button b2 = popupView.findViewById(;
b1.setOnClickListener(new OnClickListener() { public void onClick(View view) { //below code will dismiss the popup window popup.dismiss(); } });
b2.setOnClickListener(new OnClickListener() { public void onClick(View view) {
popup.dismiss(); } });
Show the popup window 
popup.showAtLocation(popupView, Gravity.CENTER, 0, 0);

Add Swipe To Refresh Feature To Your App using Android Studio

Add Swipe To Refresh Feature To Your App Using Android Studio

If you haven't watched the video watch it now!

Source Code
Android Manifest.xml

<manifest xmlns:android=""package=""> <uses-permission android:name="android.permission.INTERNET" /> <applicationandroid:allowBackup="true"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"android:roundIcon="@mipmap/ic_launcher_round"android:supportsRtl="true"android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>…