Hi all
I am trying to develop an android extension for air, but I have a problem with resources.
According to this : Official adobe doc - FREContext
and this Extending AIR by Oliver Goldman
We simply have to add the resources we need in the res file of the Native part, then they are added inside the .ane file and passed to the final apk. In order to access them though we have to use getResourceId( "drawable.background_image" ) instead of R.drawable.background_image
But when I generate my extension, the res file is actually not even included anywhere inside the .ane file and also not inside the final apk. And I have found not a single extension on the net using resources (not even in the adobe samples)
For this test I simply use the basic Hello world Vibrate test, but I added a new png in the drawable folder.
As you can see while unziping the .ane file, then going to META-INF/ANE/Android-ARM
the res file is absent.
As a result, the program crashes when I try to access my resource FREContext.getResourceId("drawable.ppy_accessory_manage.png")
Has anyone managed to make resources work with ANE in android? Is there something I should change in my command line while compiling the ane?
Thanks :-)
PS, here is my batch to compile the ANE :
set adt_directory=C:\Program Files\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0\bin
set root_directory=C:\Users\hugo\Adobe Flash Builder 4.6
set library_directory=%root_directory%\HelloANELibrary
set native_directory=%root_directory%\HelloANENative
set signing_options= -storetype pkcs12 -keystore "C:\Users\hugo\Adobe Flash Builder 4.6\certificat.p12"
set dest_ANE=HelloANE.ane
set extension_XML=%library_directory%\src\extension.xml
set library_SWC=%library_directory%\bin\HelloANELibrary.swc
"%adt_directory%"/adt -package %signing_options% -target ane "%dest_ANE%" "%extension_XML%" -swc "%library_SWC%" -platform Android-ARM -C "%native_directory%" library.swf HelloANENative.jar