integrate admob into android twa app generated using bubblewrap

485 Views Asked by At

Following the below google codelabs tutorial, i am trying to add admob code into the android project source/app generated by bubblewrap.

on step 3, as per instruction, it is adding framelayout to show bannerad to mainactivity.xml. However i am not finding this xml file in the project. Which file/place is the right to add this banner ad within the app generated by bubblewrap?

1

There are 1 best solutions below

1
On

You can't mix Android native elements with Trusted Web Activity.

A Trusted Web Activity (TWA) is just a special state of the Chrome for Android browser similar to Custom Tabs. The TWA takes up the full screen.

See: Taking Chrome Full Screen with Trusted Web Activities (Google I/O ’19). As mentioned in the video, you can't draw the example native toolbar at the bottom of the screen with a TWA, and AdMob for Android uses native mobile views.

So native mobile views like AdMob's banner view isn't possible.