How to Insert AdMob Ads to an App Inventor 2 (AI2) App

Ever wondered how to integrate Google AdMob ads to your App Inventor 2 app? Until recently, it was impossible to do so free of charge since AI2 does not permit the inclusion of AdMob and the other available possibilities are all paid options through third-party tools.

This has changed – finally – with a website called Thunkable.

Follow these steps to include AdMob ads to your AI2 app:

1) visit the beta version of Thunkable (AdMob is only integrated to their beta version for now) at beta.thunkable.com;

2) Login with your Google account (gmail / the same used for your AI2 account);

3) Import your AI2 app by clicking on Apps -> Upload legacy app project (.aia) from my computer. It is important to use the legacy uploading option to retain AI2’s original package name. If you don’t, the package name will be thunkable’s and when you’ll try to update your published app on Google Play, it will show an error message.

N.B.: If using the legacy uploading method and if
AI2’s original package name includes uppercase letters
(i.e.: appinventor.ai_NYAppMaster.GuitarTabs),
Thunkable’s legacy method will probably transform it to lowercase
letters only (i.e.: appinventor.ai_nyappmaster.guitartabs) and this will
also be a problem when you try to update your app on
Google Play afterward.

So, here’s what to do in such a case:
download Notepad++ (available here: https://notepad-plus-plus.org/).
This free software will allow you to batch edit your apk file once it is
unzipped (if necessary, read another article of mine on how to
unzip and rezip an apk file: https://articles.imperialtometric.com/how-to-overcome-mit-app-inventors-5-meg-limit-for-your-apk-files/).

Open Notepad++, press on ctrl-F and select the “Find in Files” tab.
Fill in the “Find what” (your original AI2’s package name, for example)
and “Replace with” (your lowercase-only package name) fields;
then, select the directory where your unzipped apk file is located and
click on “Replace all Files”. That’s it.
Even if thousands of entries are replaced, it takes only a few seconds.

4) Still in Thunkable’s main menu, click on your uploaded app project; once in, you shall see under the “Experimental” tab on the left side of the screen “AdMob Banner” and “AdMob Interstitial”. Drag and drop your preferred type of ad directly in your app designer section (middle of the screen).

5) Click on the AdMob component you just added and, on the right side of your screen, under “Properties”, you’ll be able to include your Ad Unit ID (you must be registered with AdMob; it’s free) and check the “Visible” option.  There’s also a “Test Mode” that can be checked (don’t click on your own app’s ads if the test mode is unchecked!).

6) In the blocks’ section, include a “call AdMob_Banner1.Load Ad” trigger under the “when Screen1.Initialize do” component. Moreover, you’ll need to create this component (three blocks): “when AdMob_Banner1.Ad Loaded do” -> “set AdMob_Banner1.Visible  to” -> “true”.

Done!

Kudos to Thunkable’s team by the way!

Canadian Provinces and Regions as Nation-States: Comparative Statistics

RegionGDP (million CAD$, 2014)Average income
(CAD$, 2014)
Population (2014)Place in the World
(Population, 2014)
National Equivalent
(Population)
Place in the World
(GDP, IMF, 2014)
National Equivalent
(GDP)

Western Canada vs
Eastern Canada

Western Canada769 62244 21611 278 90078Belgium19Saudi Arabia
Eastern Canada1 202 68437 98224 264 90052Australia16Mexico

Québec vs
Rest of Canada

Québec370 06436 4918 214 90099Switzerland33South Africa
Rest of Canada1 602 97942 02027 328 90046Ghana12Australia

Five nation states

Newfoundland / Labrador33 51435 345529 100168Suriname96Bolivia
NB / NS / PEI77 13634 6351 843 200148Kosovo66Belarus
Québec370 06436 4918 214 90099Switzerland33South Africa
Western / Northern Canada769 62244 21611 278 90078Belgium19Saudi Arabia
Ontario721 97042 64313 677 70072Senegal20Switzerland

Six nation states
(Alternative A)

Yukon - NWT - Nunavut9 82148 739117 100181Kiribati137Malta
Atlantic provinces110 65034 8122 372 300142Qatar61Morocco
British Columbia237 18840 1964 638 400121New Zealand45Greece
Prairies522 61343 7126 523 400106Laos27Taiwan
Québec370 06436 4918 214 90099Switzerland33South Africa
Ontario721 97042 64313 677 70072Senegal20Switzerland

Six nation states
(Alternative B)

Yukon - NWT - Nunavut9 82148 739117 100181Kiribati137Malta
Newfoundland / Labrador33 51435 345529 100168Suriname96Bolivia
NB / NS / PEI77 13634 6351 843 200148Kosovo66Belarus
Québec370 06436 4918 214 90099Switzerland33South Africa
Western Canada759 80141 95411 161 80080Tunisia19Saudi Arabia
Ontario721 97042 64313 677 70072Senegal20Switzerland

Eleven nation states

Yukon - NWT - Nunavut9 82148 739117 100181Kiribati137Malta
Prince Edward Island6 00333 632146 200180Nagorno-Karabakh Republic148Malawi
Newfoundland / Labrador33 51435 345529 100168Suriname96Bolivia
New Brunswick32 05634 164754 600163Guyana97Latvia
Nova Scotia39 07736 108942 400158Djibouti91Ghana
Saskatchewan82 78040 9331 122 300157Swaziland64Oman
Manitoba64 07736 7951 280 200154Mauritius71Dominican Republic
Alberta375 75653 4084 120 900129Lebanon33Colombia
British Columbia237 18840 1964 638 400121New Zealand45Greece
Québec370 06436 4918 214 90099Switzerland33South Africa
Ontario721 97042 64313 677 70072Senegal20Switzerland

Canada as Six Nation-States (Alternative A)
Canada as Six Nation-States (Alternative A)

 

 

Canada as Six Nation-States (Alternative B)
Canada as Six Nation-States (Alternative B)

 

 

Western Canada vs Eastern Canada
Western Canada and Eastern Canada as Two Nation-States

 

 

Sovereign Québec vs Rest of Canada
Québec and Rest of Canada as Two Nation-States

 

 

CanadaMap_5Nations
Canada as Five Nation-States

 

 

Canada as Eleven Nation-States
Canada as Eleven Nation-States

 

 


 

Sources:

Wikipedia, List of Canadian provinces and territories by gross domestic product, December 10, 2015.

Wikipedia, List of countries and dependencies by population, December 10, 2015.

Wikipedia, List of countries by GDP (nominal), December 10, 2015.