Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android AdMob and Maven

I have an Android Project where I need to build multiple versions of the same application from the same sources.

To do this, I use the android plugin for Maven

Each version must be able to include ads from admob. So in my POM I added this dependancy

<dependency>
   <groupId>com.admob.android</groupId>
   <artifactId>ads</artifactId>
   <version>20101109-ANDROID-3312276cc1406347</version>
   <scope>system</scope>
   <systemPath>THE_PATH\libs\admob-sdk-android.jar</systemPath>
 </dependency>

I don't get any errors at build time but, when I execute the application I get this exception

java.lang.ClassNotFoundException: com.admob.android.ads.AdView

So apparently the package is not properly included ?

like image 972
yann.debonnel Avatar asked Feb 10 '11 18:02

yann.debonnel


People also ask

How much does AdMob pay per ad?

CPM is around $1, or $1 per 1000 Ad impressions. Clicks I have seen as high as $0.25, but its going to vary on the Ad shown obviously.

Does AdMob use advertising ID?

The advertising ID works like cookies in a web browser, is only meant for advertising purposes and enables users to reset or opt out of targeted ads within apps. In admob, the advertising ID is available via the google play services library and not the deprecated GoogleAdmobADSSdk-6. X.X.

How do I see interstitial ads on Android?

Show the ad Interstitial ads should be displayed during natural pauses in the flow of an app. Between levels of a game is a good example, or after the user completes a task. To show an interstitial, use the show() method. Log.


1 Answers

You can NOT use system scope for runtime required libraries. Deploy the jar into your local repository or your repository server (using e.g. mvn install:installFile ..) and remove scope and systemPath from the dependency declaration.

Update: As of the latest releases my Maven Android SDK Deployer can do the install of the AdMob jar from the SDK into your local Maven repository or repository server for you.

like image 95
Manfred Moser Avatar answered Sep 28 '22 19:09

Manfred Moser