title: AIR 3 Native Extensions for Android - Can I/How to include 3rd party libraries?
body: <p>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.</p>
  
  <p>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:</p>
  
  <ol>
  <li>Successfully created native Android library, using compiled-in imports from 3rd party Android library XYZ.</li>
  <li>Exported Android project as JAR file.
   <em>Note: The referenced 3rd party JAR is in /lib inside the jar.</em></li>
  <li>Successfully created ActionScript library (SWC) to interface with native Android library.</li>
  <li>Created ANE package from SWC, extension.xml, Android JAR, and library.swc (for platform Android-ARM, extracted from SWC).<br>
  Note: Have also tried putting the 3rd party library in file structure outlined here: <a href="http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-24823354" rel="noreferrer">http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-24823354</a> 12ffea65006-8000.html#WSf268776665d7970d-6be13ace1308aaebeca-7fff.  I think this is more geared to runtime type execution with JNI or whatever, so that article has left me a little confused.</li>
  <li>Used ANE in example Flex Mobile project.</li>
  <li>Built and installed APK file on test DroidX device.</li>
  <li>Can successfully see AIR application loading (and trace statements) in LogCat <code>"ActivityManager: Displayed com.me.androidapp/.AppEntry"</code></li>
  <li>Can successfully see native Android Java code being invoked via runtime by AIR app to instantiate extension &amp; context. <code>"mye_native: MyExtension.initialize", "mye_native: MyExtensionContext.createContext"</code></li>
  <li>As soon as AIR app tries to call native function, it blows up, not able to find the classes from 3rd party Android library: <code>E dalvikvm: Could not find class 'com.thirdparty.SomeClass', referenced from method com.me.nativeExtentions.MyExtensionFunction.call</code></li>
  </ol>
  
  <p>Any ideas?  It seems like it should work this way. </p>
  
  <p>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.</p>
  
  <p>I posted this on the Adobe forums, but I thought I'd give the SO think-tank a try. Thank you.</p>