Copy link to clipboard
Copied
With all the new hype surrounding native extension support in AIR 3, I haven't found a single thing that confirms or denies it is possible to include and use an external JAR inside the native Android implementation.
All of the examples basically showcase the ability to hook into the built-in Android APIs. But what if someone wants to use one of hundreds of libraries that make it easier? Certainly it seems like this should be possible. I'll try to outline what I've done and maybe someone will spot a flaw:
Any ideas? It seems like it should work this way.
One thing I have noticed is that when I blow apart the APK and Dex from a pure Java Android app of mine (that also has 3rd party android libraries), it appears that the classes from the 3rd party have been included inside it (not just a jar reference).
When I do the same thing with my Flex APK, I find only my own Java classes plus Adobe's, and the 3rd party ones are nowhere to be found that I can see.
Copy link to clipboard
Copied
Ran the exact same test as you described and came to the exact same conclusion.
It's maybe an other problem, but I even can't have ressources embbed inside the resulting apk! : http://forums.adobe.com/thread/922917
I guess there's an option in the command line to add libraries and the ressources that me missed. I mean there have to be one...
Is there anybody in there who can help us? If the ANE are just for one class java programs, it lowers the interest a bit.
Copy link to clipboard
Copied
dlbromen, I'm also looking for the same thing!
I have many libraries that I want to integrate with, but can't with the same reason...
do you have a solution?
I know that it is possible! you can google for AdMob extension from milkmangames, they integrated with the Google library (Jar) and it's working for them....
anyone, anything would do!
Thanks
Copy link to clipboard
Copied
Hello,
The solution is pretty simple.
Just extract the jar and bundle the extracted files with your compiled classes. You will have one final .jar file which will contain the library's content and all your classes.
You can check our version of AdMob ANE here - http://lancelotmobile.com/blog/admob-ane
The whole code is public so you can see the whole 'magic'.
Best regards,
Emil
Lancelotmobile Ltd.
Copy link to clipboard
Copied
Just extract the jar and bundle the extracted files with your compiled classes.
i want to ask how to do this.
i met with the same problem.
Copy link to clipboard
Copied
http://code.google.com/p/flash-for-mobile/
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");}
Copy link to clipboard
Copied
have u found the workaround?
i met with the same problem
Copy link to clipboard
Copied
Extracting it - rename the jar file file to .zip and then use your favorite
tool to excitat the content of the zip. Then you should copy and past the
content of the zip on ton of your binary classes (they are usually located
in bin directory).
Final step create jar file from your binary classes, but include the newly
added files too.
I hope this will help.
Sent from my iPad
Copy link to clipboard
Copied
thank u,i get it
Find more inspiration, events, and resources on the new Adobe Community
Explore Now