Skip to main content
February 25, 2012
Question

how can I add advertisement in android app

  • February 25, 2012
  • 4 replies
  • 3992 views

Hi,

I have an account on AdMob site. I made an android app and I will upload on vodafone store. So,  when I have select  app type, I need to write an Android Package and I haven't. Also, Is it possible to tell me what can I do to add advertisement on android app? I have adobe flash cs 5.5 AIR 3.0

This topic has been closed for replies.

4 replies

Known Participant
October 28, 2012

qq讨论群:56892018

version for android http://code.google.com/p/flash-for-mobile/

version for iphone and ipad https://github.com/lilili87222/admob-for-flash

this is a actionscript native extension for developer to ad advertisement to their air mobile application run on iphone or android.it very easy to use

admob for flash android this lib enable you to add admob ad to your flash air application to add native advertisement to your actionscript3 application you just need to do four step

1.replace D:\Program Files\Adobe\Adobe Flash Builder 4.6\sdks\4.6.1\lib\android\lib\resources\android-res.jar with android-res.jar

2. add this config to -app.xml

<android>
<manifestadditions>
<![CDATA[
<manifest android:installLocation="auto"> 
<uses-sdk android:targetSdkVersion="11"/> <uses-sdk android:minSdkVersion="8"/> 
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application>
<!-- <activity android:name="com.google.ads.AdActivity?" android:configChanges="keyboard|keyboardHidden|orientation"/> --> <activity android:name="com.google.ads.AdActivity?" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>

Unknown end tag for </manifest>

]]>
</manifestadditions>
</android>

3.add this config to -app.xml

<extensions>
<extensionid>
so.cuo.ane.Admob
</extensionid>
</extensions>

4. add code to your android air application like follow 

test1(); private function test1():void { 
var admob:Admob=Admob.getInstance(); if(admob.isSupported){ 
admob.setUnitId(gid); admob.dispatcher.addEventListener(AdEvent?.onReceiveAd,this.adHandler); admob.dispatcher.addEventListener(AdEvent?.onFailedToReceiveAd,this.adHandler);

// admob.showRelation(AdMobAlignment?.ALIGN_BOTTOM,AdType?.BANNER); 

admob.show(50,100,AdType?.BANNER);
}else{ 
trace("not support");
}
}

protected function adHandler(event:AdEvent?):void { 
trace("receive ad");
}
Known Participant
October 28, 2012

http://code.google.com/p/flash-for-mobile/  i find a lib it enable you add google ads in flash android application. and work well

Participant
March 2, 2012

To start from the very beginning.

1) Contact an ad network and get signed up

2) Once you're live, you'll recieve the code that needs to be implemented.

If successfully done, you'll then see your ad immediately. Or at least the banner without the ad.

Choose an ad network that has good Support so you can call them or expect promt replies to emails. Questions like these sometimes require to be walked through and good support in this case is very important.

Hope that helps.

Cheers - Bill

*DISCLOSURE - I work at Tapit Advertising*

Projectitis
Inspiring
March 2, 2012

Bill, it sounds like johnpaok has already signed up to an ad service company and created an ad. he now has a java (.jar) file, presumable for native android, that he wants to integerate in his AIR/Flash app.

March 2, 2012

thank,

I'm from Greece and I think my country supported from  the adMob and Google only. So, I have not choises and support from adMob. this I test it from android phone in few days because I haven't one of this and I hope to work  . Now I  test my app in my pc and I am taking a wite rectangular on top of screen of  my app

February 25, 2012

I think there are a few work arounds for this but no clear solution, its one of the biggest gripes for developers looking to make money with ads.

February 25, 2012

There is java file (.jar) which I must add in my app. But I use actionscript, how can I add this code-file?

February 25, 2012

Best thing you can do is to buy this native extension:

Have a look at it:

http://www.milkmangames.com/blog/2011/11/10/announcing-native-android-admob-support-for-adobe-air/