Admob implementation in Phonegap for Android app

2019-05-11 03:14发布

问题:

I converted one jquery script into Android app , Now i want to add admob into it , is this possible ???

回答1:

Google have since updated their documentation to forbid using AdSense in a mobile application:

"The use of AdSense for mobile in a mobile application is a violation of AdSense policies. A mobile application constitutes any downloadable application, even if a WebView is used to display the ad. Any AdSense for mobile ad units found in mobile applications will be disabled. If you’re looking for an advertising solution for your mobile application, please sign up for AdMob, Google’s leading mobile advertising display product."

The solution is to use the dedicated PhoneGap plugin.



回答2:

You can do this with the android native code (I could recommend doing this instead of using mobile site code). There is a great explanation on how to do it on on phonegap.wiki.com, see this

Also check out this answer on stackoverflow, it prevents a bug where your local storage gets deleted: Android + HTML5(LocalStorage) + Admob: Bug?