Using Image Magick within a Native Extension

Hi,
Does anyone know exactly how to incorporate Image Magick into a native extension, and then exactly how to include it and then invoke it in AS3?
My environment is Windows 7/64 bit with FlashBuilder 4.6.
Any advice will be most appreciated, and thanks in anticipation.

Hi, When I posted this question nearly 12 months ago, I did not properly understand how to build an ane incorporating anything.
But I did make some progress and the results can be seen at Air Native Extension - Adobe AIR: Visual QuickPro Guide - Larry Ullman's Book Forums
I hope that it may be of interest.
Regards.

Similar Messages

  • Using OpenCV inside an Adobe Native Extension for IOS

    I'm trying to use OpenCV.framework inside an Adobe Native Extension that I'm developing to use on an IOS application made in Flex.
    The problem is that I get errors while packaging the application:
        Undefined symbols for architecture armv7:
          "__ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv", referenced from:
              __ZNSt3__16vectorIiNS_9allocatorIiEEE8__appendEm in opencv2(smooth.o)
              __ZNSt3__16vectorIN2cv6Point_IiEENS_9allocatorIS3_EEE21__push_back_slow_pathIKS3_EEvRT_ in opencv2(hough.o)
              __ZNSt3__16vectorIN2cv3VecIiLi128EEENS_9allocatorIS3_EEE8__appendEm in opencv2(matrix.o)
              __ZNSt3__16vectorIN2cv3VecIiLi64EEENS_9allocatorIS3_EEE8__appendEm in opencv2(matrix.o)
              __ZNSt3__16vectorIN2cv3VecIiLi32EEENS_9allocatorIS3_EEE8__appendEm in opencv2(matrix.o)
              __ZNSt3__16vectorIN2cv3VecIiLi16EEENS_9allocatorIS3_EEE8__appendEm in opencv2(matrix.o)
              __ZNSt3__16vectorIN2cv3VecIiLi12EEENS_9allocatorIS3_EEE8__appendEm in opencv2(matrix.o)
        ld: symbol(s) not found for architecture armv7
        Compilation failed while executing : ld64
    and this is the platformoptions.xml I use to compile the ANE:
        <platform xmlns="http://ns.adobe.com/air/extension/4.0">
            <sdkVersion>8.0</sdkVersion>
            <linkerOptions>
           <option>-framework opencv2</option>
           <option>-framework UIKit</option>
           <option>-framework Foundation</option>
           <option>-framework CoreGraphics</option>
           <option>-framework Accelerate</option>
           <option>-framework AssetsLibrary</option>
           <option>-framework AVFoundation</option>
           <option>-framework CoreImage</option>
           <option>-framework CoreMedia</option>
           <option>-framework CoreVideo</option>
           <option>-framework QuartzCore</option>
        </linkerOptions>
        </platform>
    Any idea?

    Problem solved. I've added this line
    <option>-lc++</option>
    to the platformOptions.xml.
    Now OpenCV works great in my actionscript native extension.

  • Using OpenGL ES in an AIR native extension on iPad

    Hi,
    I am trying to find out whether I can render images using iPad GPU from a native extension loaded by an AIR application on iPad. The main reason for this is that I need every bit of GPU power in my AIR application and I cannot use Stage3D (see http://forums.adobe.com/thread/1267084 for details).
    The idea is to pass a bitmap from the ActionScript code to the native extension, render it by Objective C code and raw OpenGL ES and send it back to the AIR code.
    Is it technically possible? I am afraid that AIR runtime uses OpenGL ES for its own needs (at least for Stage3D support) so native extension possibly cannot share OpenGL with it.
    Nevertheless I have made a try. Here is some code:
    The first strange thing is that the following initialization code:
    myContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
    [EAGLContext setCurrentContext:myContext];
    does not make much sense for me. Instead of this I can see that EAGLContext already contains some instance previously set up by someone else (maybe AIR runtime did it). And I was able to get an image only when I do not create this context at all. So these two lines are actually commented out in my test app.
    Here is how I initialize framebuffer:
    glGenFramebuffersOES(1, &framebuffer);
    glBindFramebufferOES(GL_FRAMEBUFFER_OES, framebuffer);
    glGenRenderbuffersOES(1, &colorRenderbuffer);
    glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer);
    glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_RGBA8_OES, width, height);
    glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, colorRenderbuffer);
    I do not need 3D so I am not creating depth buffer. Insteat I need to render a lot of 2D polygons and the drawing order is OK for me.
    Then I tried the following code to render a single triangle specified in the vertexData array:
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f);
    glMatrixMode(GL_MODELVIEW);
    glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT);
    // vertexData contains 2d float coordinates followed by 4 bytes of color for each vertex
    glEnableClientState(GL_VERTEX_ARRAY);
    glVertexPointer(2, GL_FLOAT, 12, vertexData);
    // The following two lines cause the whole screen to be filled with random gradient semi-transparent fill.
    // If I comment them out then it renders a black triangle that I really expect to get.
    glEnableClientState(GL_COLOR_ARRAY);
    glColorPointer(4, GL_UNSIGNED_BYTE, 12, (vertexData + 8));
    // Draw the triangle:
    glDrawArrays(GL_TRIANGLES, 0, 3);
    // Get the final image:
    glPixelStorei(GL_PACK_ALIGNMENT, 4);
    NSInteger datalength = width * height * 4;
    GLubyte* rawdata = (GLubyte*)malloc(datalength * sizeof(GLubyte));
    glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, rawdata);
    // In this point the rawdata array contains an image that I am able to convert and send back to my AS code.
    So each time I try to specify color for vertexes then I get the whole iPad screen filled with some random gradient. I have also tried glColor function and it causes such effect too. Disabling lighting and fog did not helped.
    So my main question is the following: is it technically possible to render an offscreen image in the native extension using OpenGL?
    Maybe the black triangle that I was able to get from the rendered image is rendered accidentally and the whole thing should not work at all?

    Hi there,
    I'm a total OpenGL newb but, after quite some struggle I managed to bend OpenGL from AIR extension to do what I wanted in my FlashyWrappers library for iOS (for superfast video capturing from AIR apps).
    Basically you're right in the assumption that the OpenGL context is already initialized by AIR. I'm not sure about your code, because like I said I'm practically a newb in that field, but overall, because you share context with AIR's OpenGL, it's entirely possible you're messing with it's own rendering pipeline if you don't properly unbind / reset stuff and that might cause the screen go crazy.
    Myself I was able to do a little different thing: Create a texture-backed FBO, bind it on every frame and let AIR render into it (instead of screen). I was then able to manipulate the contents of what AIR rendered (you can do glReadPixels on the content too, by the way).
    So I bet if I can let AIR render its stuff into my texture backed FBO you can render your own things into it as well...I just bound it and waited for AIR to finish its rendering into it. Instead you can probably render into it, then bind AIR's original FBO instead of waiting for AIR to render so that AIR renders to screen again on the next frame.
    I partially used this tutorial OpenGL ES 2.0 for iPhone Tutorial Part 2: Textures - Ray Wenderlich .
    Oh and I would like to add that playing with this works only in GPU or Direct mode, not CPU.

  • Air Native Extension - Java Key Listener

    Hello all,
    Firstly I'd like to thank you for creating an excellent and helpful community. I have an issue I have been stuck on for around 2 weeks now.
    I am creating an android native extension to listen to key input from a proprietary remote control device. GameInput does not recognise it as a game controller so we have to create a native extension to get the input. I have it working fully except for one issue; if the game loses context (eg the user gets a phone call or the game goes into the background for any other reason) I do not get any other input.
    The way I am doing it is to attach an onKeyListener to the currently focused View (an AirWindowSurfaceView). This works perfectly, but when the context is lost I'm assuming the AirWindowSurfaceView changes and I cannot find a way to get a reference to the new one. Here is my key listener setup code (from the native Java):
    public void updateListeners()
        if(_view != null)
          _view.setOnKeyListener(null); //remove from the old view
          _view.setOnGenericMotionListener(null);
        _context.dispatchStatusEventAsync(_view.toString(), "view"); //send the current view details
        _view = _context.getActivity().getCurrentFocus();  //set the new view
        _context.dispatchStatusEventAsync(_view.toString(), "view");
       if(_onKeyListener == null)
           _onKeyListener = new NativeGamepadKeyListener(_context, this); //create new key listener
       if(_onGenericMotionListener == null)
           _onGenericMotionListener = new NativeGamepadMotionListener(_context, this); //create a new motion listener
       _view.setOnKeyListener(_onKeyListener);          //set on the new view
       _view.setOnGenericMotionListener(_onGenericMotionListener);
    This updateListeners function is called when I get a focus change event on the current view (attached in a similar way) but this doesn't seem to keep it up to date with the current View.
    Please note I'm a newbie at making extensions like these and might be going about it totally the wrong way - if I am and you have any suggestions as to the best way to use an onKeyListener in a native extension I'd love to hear it.
    Thanks in advance for your help!

    I am not able to solve this yet. Is anybody else facing this this problem.

  • Unable To Build iOS App Using Native Extension

    I’m trying to create a native extension for iOS and use that extension as part of an IPA app for iOS I create from a SWF file using the ADT tool (i.e. the normal use-case for iOS). Note: I have already successfully created the native extension and APK app for Android and now I am trying to build the iOS side.
    I have been primarily using the information found at the following websites:
    http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt3.html
    http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt5.html
    http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac35eb7b4e12cddc5fbbb-8000.html
    I have also searched the Adobe forums for the answer to my question without success.
    The error I receive is:
    ld: warning: ignoring file /var/folders/c3/mpg4frwn2j1f8scw4jctbmv9hfkswj/T/bd3fbd4a-cf56-4fd6-a06d-d69ea92dc620/lib com.mycompany.MyExtension.a, file was built for archive which is not the architecture being linked (armv7): /var/folders/c3/mpg4frwn2j1f8scw4jctbmv9hfkswj/T/bd3fbd4a-cf56-4fd6-a06d-d69ea92dc620/lib com.mycompany.MyExtension.a
    Undefined symbols for architecture armv7:
      "_MyExtensionInitializer", referenced from:
          _g_com_adobe_air_fre_fmap in aotInfo.o
      "_MyExtensionFinalizer", referenced from:
          _g_com_adobe_air_fre_fmap in aotInfo.o
    ld: symbol(s) not found for architecture armv7
    Compilation failed while executing : ld64
    I receive the above error when I execute the following command:
    adt -package -target ipa-ad-hoc -storetype pkcs12 -keystore certificate.pfx -provisioning-profile provisioning_profile.mobileprovision MyApp.ipa MyApp.xml MyApp.swf -extdir packaged-extensions
    where the folder “packaged-extensions” contains the ANE file I created using this command:
    adt -package -target ane packaged-extensions/MyExtension.ane MyExtension.xml -swc MyExtension.swc -platform Android-ARM -platformoptions platformAndroidARM.xml -C dependencies . -C platform/Android . -platform iPhone-ARM -platformoptions platformiOSARM.xml -C platform/IOS . -platform default -C platform/default library.swf
    where the content of the files are as follows:
    MyApp.xml:
    <application xmlns="http://ns.adobe.com/air/application/4.0">
        <id>MyApp</id>
        <versionNumber>0.0.1</versionNumber>
        <filename>MyApp</filename>
        <initialWindow>
            <content>MyApp.swf</content>
            <visible>true</visible>
            <width>600</width>
            <height>600</height>
        </initialWindow>
        <supportedProfiles>mobileDevice</supportedProfiles>
            <extensions>
                    <extensionID>com.mycompany.MyExtension</extensionID>
            </extensions>
    </application>
    MyExtension.xml:
    <extension xmlns="http://ns.adobe.com/air/extension/4.0">
            <id>com.mycompany.MyExtension</id>
            <versionNumber>0.0.1</versionNumber>
            <platforms>
                    <platform name="Android-ARM">
                            <applicationDeployment>
                                    <nativeLibrary>MyExtension.jar</nativeLibrary>
                                    <initializer>com.mycompany.MyExtension</initializer>
                            </applicationDeployment>               
                    </platform>
                    <platform name="iPhone-ARM">
                            <applicationDeployment>
                                    <nativeLibrary>libMyExtensionIOSLibrary.a</nativeLibrary>
                                    <initializer>MyExtensionInitializer</initializer>
                                    <finalizer>MyExtensionFinalizer</finalizer>
                            </applicationDeployment>
                    </platform>
                    <platform name="default">
                            <applicationDeployment/>
                    </platform>
            </platforms>
    </extension>
    platformiOSARM.xml:
    <platform xmlns="http://ns.adobe.com/air/extension/4.0">
      <linkerOptions>
        <option>-ios_version_min 5.1</option>
        <option>-liconv</option>
      </linkerOptions>
    </platform>
    MyExtensionIOSLibrary.m (yes, I know it doesn't do anything - it's simple on purpose to help isolate the error):
    #import "FlashRuntimeExtensions.h"
    void MyContextInitializer(void* extData, const uint8_t *ctxType, FREContext ctx, uint32_t *numFunctionsToTest, const FRENamedFunction **functionsToSet) {
      return;   
    void MyExtensionInitializer(void **extDataToSet, FREContextInitializer* ctxInitializerToSet, FREContextFinalizer* ctxFinalizerToSet) {
        *extDataToSet = NULL;
        *ctxInitializerToSet = &MyContextInitializer;
    void MyExtensionFinalizer(void *extData)
        return;
    I am using XCode to build MyExtensionIOSLibrary.m into a library file with a .a filename extension. My relevant build settings are:
    iOS Deployment Target: iOS 5.1
    Architectures: armv7
    Build Active Architectures Only: No
    Product Scheme: Release
    Compile Sources As: Objective-C
    Any ideas? Please help.

    Thanks for the reply.
    yes.I've created a static library with 3rd party frameworks and pulled the .a from product folder(Debug-iphoneos).
    and the framework didn't work(armv7 not supported error occurs ..don't know why) with it's original folder structure .
    so I followed below link to change folders inside the 3rd party framework and figured out but now  the application crashes on startup without giving an error message. .
    スタッフ日記 - 【ANE作成】外部フレームワーク を含むANE作成時の注意点(iOS) | 株式会社マリエッタ

  • How to use single ant build script to package the application with and without native extensions

    Hi,
    I am using iOS native extensions for Adobe air. For this I am listing the extensions in the application descriptor file. Since the package with native extensions are meant to run only on device, I want my build script to work without native extensions too to be able to run on simulator. Is this manadatory that I need two separate application descriptors/basically two build scripts to compile and package them? Please suggest and let me know if more explanation is needed.
    Thanks,
    Swathi.

    Hi
    This is a known issue addressed by CR205204
    As you said, IBM actually does not have rt.jar in its JDK - they have moved contents of rt.jar into various jars.
    IBM is not using org/apache/crimson/tree/ in their JDK at all.So the error shows up in the end of build even if it succeeds
    You may need to add crimson.jar to wlwBuild classpath, since it is not part of IBMs JDK.
    Note: the build will work even w/o crimson.jar giving a non build related IDE exception in the very end.
    Thanks
    Vimala

  • How to use single ant build to package with and without native extensions

    Hi,
    I am using iOS native extensions for Adobe air. For this I am listing the extensionid in the application descriptor file. Since the package with native extensions are meant to run only on device, I want my build script to work without native extensions too to be able to run on simulator. Is this manadatory that I need two separate application descriptors/basically two build scripts to compile and package them? Please suggest and let me know if more explanation is needed.
    Thanks,
    Swathi.

    why are you wanting to use single frames?
    They allow having the initial frame address stay in the
    address bar, and not
    show the linked page's address. The problems they cause
    usually override any
    value.
    Or- if we aren't using the same words the same way, please
    give an example
    site of what you want to do.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Developing and using Adobe AIR native extensions for Android devices

    I was using this tutorial:
    "Developing and using Adobe AIR native extensions for Android devices"
    http://www.adobe.com/devnet/air/articles/ane-android-devices.html
    When packing the Flex mobile ANESampleTest to deploy on an Android device, the below error happens
    Error occurred while packaging the application:
    aapt tool failed:invalid resource directory name: /private/var/folders/k8/1thhvkf92h947n_g22hg_v9m0000gn/T/52ba05aa-9001-4d46-9438-db81ef83 06f0/res/drawable-xxhdpi
    invalid resource directory name: /private/var/folders/k8/1thhvkf92h947n_g22hg_v9m0000gn/T/52ba05aa-9001-4d46-9438-db81ef83 06f0/res/values-sw600dp
    invalid resource directory name: /private/var/folders/k8/1thhvkf92h947n_g22hg_v9m0000gn/T/52ba05aa-9001-4d46-9438-db81ef83 06f0/res/values-sw720dp-lan
    Does anyone know what the issue might be?

    Did you find a workaround for the Error? I'm getting the same and I can't seem to find any solution.

  • Flash Builder 4.6 Mobile Project Using Blazeds & Native Extension

    Hi,
    I'm building a Flex Mobile project in FB, that uses BlazeDS to access data through a Spring Project, and also uses an ANE file to access the device's contacts.  I want to debug the application on a device connected with a USB cable, so had to set my root and output folders in Server Settings  using UNC so it can be found from my device thru my wifi network. I also have added the native extension via the Build Path and Packaging tabs.  When I debug from a desktop emulator, things launch OK and the extension correctly tells me it's not supported on the emulator. However, if I debug on the device, FB throws an exception at launch, complaining of a java null pointer exception.  The Eclipse log, in part, looks like this:
    com.adobe.flexbuilder.project.AbstractXMLModel$FileReadException: org.eclipse.core.internal.resources.ResourceException: Resource '/NewOne-debug/NewOne-app.xml' does not exist.
              at com.adobe.flexbuilder.project.air.internal.xml.ApplicationXMLModel.<init>(ApplicationXMLM odel.java:102)
              at com.adobe.flexbuilder.project.air.AppXMLCreator.init(AppXMLCreator.java:91)
              at com.adobe.flexbuilder.project.air.AppXMLCreator.<init>(AppXMLCreator.java:80)
              at com.adobe.flexbuilder.project.air.AppXMLCreator.<init>(AppXMLCreator.java:73)
              at com.adobe.flexbuilder.project.ui.utils.ANE.AppXMLFileANEExtensionHandler.getAppXMLCreator (AppXMLFileANEExtensionHandler.java:153)
              at com.adobe.flexbuilder.project.ui.utils.ANE.AppXMLFileANEExtensionHandler.retainExtensionI ds(AppXMLFileANEExtensionHandler.java:315)
              at com.adobe.flexbuilder.project.ui.utils.ANE.ANEController.modifyAppXMLforPackaging(ANECont roller.java:371)
              at com.adobe.flexbuilder.project.ui.utils.ANE.ANEController.modifyAppXMLforPackaging(ANECont roller.java:338)
              at com.adobe.flexbuilder.project.ui.utils.ANE.AbstractANEPackageHandler.modifyAppXMLforPacka ging(AbstractANEPackageHandler.java:91)
              at com.adobe.flexide.launching.multiplatform.launchhandlers.AbstractMultiPlatformLaunchHandl er.applyNativeExtensionDetails(AbstractMultiPlatformLaunchHandler.java:164)
              at com.adobe.flexide.multiplatform.android.launching.ADBLaunchHandler.doPackage(ADBLaunchHan dler.java:424)
              at com.adobe.flexide.multiplatform.android.launching.ADBLaunchHandler.launch(ADBLaunchHandle r.java:250)
              at com.adobe.flexide.launching.multiplatform.MultiPlatformLaunchDelegate.launch(MultiPlatfor mLaunchDelegate.java:191)
              at com.adobe.flexide.launching.AbstractFlexLaunchDelegate.launch(AbstractFlexLaunchDelegate. java:244)
              at com.adobe.flexide.launching.AbstractFlexLaunchDelegate.launch(AbstractFlexLaunchDelegate. java:134)
              at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
              at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
              at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:928)
              at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1132)
              at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/NewOne-debug/NewOne-app.xml' does not exist.
              at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:320)
              at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:194)
              at org.eclipse.core.internal.resources.File.getContents(File.java:287)
              at org.eclipse.core.internal.resources.File.getContents(File.java:278)
              at com.adobe.flexbuilder.project.air.internal.xml.ApplicationXMLModel.<init>(ApplicationXMLM odel.java:100)
              ... 19 more
    I guess the problem is that when the application tries to run on my device, the extension is not finding the application descriptor file.  Is there anything else I need to do?
    I appreciate any help.
    Jay

    Here's the fix in case anyone else runs into this problem.  When Flash Builder is building the deployment during launch, it converts the mapped path to a mangled local path for the ane to find the descriptor to a relative path, which can't be found and throws the null pointer.  Making the Output Folder path actually local to the computer, as opposed to the default that FB creates, resolves the error, and still allows blazeds access from the device.

  • How to use foreground dispatch system of android NFC with AIR native extension?

    Hello,
    I'm developping an AIR application which invokes NFC on android, via AIR native extension (ANE).
    I would like to enable foreground dispatch system of NFC (see http://developer.android.com/guide/topics/nfc/advanced-nfc.html#foreground-dispatch), but unfortunately it has not been achieved so far.
    [Problem]
    For enabling foreground dispatch system of android NFC, we need to listen some android native events e.g.) Activity.onNewIntent(), Activity.onPause() and Activity.onResume(). But I have no idea how to dispatch them to ANE. Could anyone tell me how to get it?
    I know there is an available ANE for android NFC as follows:
    http://code.google.com/p/ane-lab/source/browse/#svn%2Ftrunk%2Fmobile%2Fandroid%2Fjava%2Fnf c1
    But it is not fit for our use case, as it just uses "intent dispatch system" (another way to use android NFC).
    Maybe AIR must be extended for this case, but any information is welcome.
    Thanks.

    Hello
    My name is Sadao Tokuyama.(http://twitter.com/tokufxug)
    Is the person who is to manage the sample code in experimental AIR
    Native Extension.
    If you want to achieve the de-patch system foreground NFC, it is
    necessary to consider the following points.
    1.Create FREFunction for initial processing. processing of onCreate.
    2.can be obtained in onResume Event.ACTIVATE. After issuing
    Event.ACTIVATE, call the FREFunction to run in onResume.
    3.can be obtained in onPause Event.DEACTIVATE. After issuing
    Event.DEACTIVATE, call the FREFunction to run in onPause.
    4.onNewIntent can be obtained at InvokeEvent.INVOKE. After issuing
    InvokeEvent.INVOKE, call the FREFunction to run onNewIntent.(Gets the
    Intent of the scanned NFC. : FREContext.getActivity().getIntent())
    I have committed the sample code. Your reference.
    http://code.google.com/p/ane-lab/source/browse/#svn%2Ftrunk%2Fmobile%2Fandroid%2Fjava%2Fnf c-foreground-dispatch
    Thanks.

  • Problems using Native Extensions (Gyroscope) for iOS.

    I have downloaded the Gyroscope Native Extension for Air and I'm basically trying to install it so I can use the extensions to develop an iOS AIR app that uses my iPhone's Gyroscope.
    The Gyroscope Folder has been un-zipped and is placed in a folder alongside the AIR app that I'm developing. I've set the Actionscript settings to point to the gyroscope.ane file and also to the gyroscope.swc file.I don't know if the latter is necessary as I'm all new to this.
    My Actionscript reads:-
    import com.adobe.nativeExtensions.Gyroscope;
    import com.adobe.nativeExtensions.GyroscopeEvent;
    import com.adobe.nativeExtensions.GyroscopeIntervalValue
    var gyro:Gyroscope;
    if(Gyroscope.isSupported)
        gyro = new Gyroscope();
        gyro.setRequestedUpdateInterval(1000);
        gyro.addEventListener(GyroscopeEvent.UPDATE,onChange);
    function onChange(e:GyroscopeEvent):void
        trace("From gyro: " + e.x + " " + e.y + " " + " " + e.z);
    Which I've basically taken from the webpage https://www.adobe.com/devnet/air/native-extensions-for-air/extensions/gyroscope.html#artic lecontentAdobe_numberedheader
    And I've added the 3 imports at the top because I believe these should allow these functions / methods (or whatever they are called) to work ?
    Unfortunately I'm getting the following errors:-
    GyroscopeEvent.as, Line 1
    5001: The name of package 'com.adobe.nativeExtensions' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. /Users/myname/Desktop/programFolder/GyroscopeEvent.as
    Gyroscope.as, Line 1
    5001: The name of package 'com.adobe.nativeExtensions' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. /Users/myname/Desktop/programFolder/Gyroscope.as
    I don't know where to move the files or how I can get AIR to see this .as files Should I be moving the "Com" folder somewhere better ?
    I'm a relative newbie to AIR so I appologise for my ignorance. All I want is a way to get access to the x y and z values from the Gyroscope.
    Many Thanks
    Gary

    Remove the gyroscope folder. The only file you need is Binaries/Gyroscope.ane.
    If you are using Flash CS6 link to the ane file not the swc file in the publish settings.
    Also remove the line: import com.adobe.nativeExtensions.GyroscopeIntervalValue.
    Sample code that you can use is in the file Eg/src/Eg.mxml.

  • Successfully using a Native Extension with Flash CS5.5 Pro, having issues

    Hey all,
    I'm trying to use a native extension due to an app rejection about the new storage guidelines. I'm hoping someone can help me figure out how to use a native extension from Flash CS5.5 and the adt command line utility (I've never used before).
    Apples storage guidelines in 5.0.1 require files saved to Documents (and other places) to be marked with the icloud "do not back up" bit. I'm trying to use Adobe's IOS 5.0.1 data storage native extension to do that as I have file sharing enabled and my app downloads files I want the user to be able to copy to their desktop.
    From the bits and fragments I'm reading all over, getting it to compile means using the command line adt tool (I've never used it before) because Flash Pro CS5.5 doesn't support native extensions. Also, this native extension requires a v14 SWF published (11.1) and CS5.5 only goes up to 10.2 (or higher if you install the players).
    I edited the AiriPhone.xml file and pointed it to an AIR 3.1 airglobal.swc and I have AIR 3.1 overlayed in flash. I can't test AIR for iOS anymore after that change but I can get it to compile a SWF. The adt command line adt utility stopped complaining that my SWF version was 13 when it needed 14, so I assume this worked?
    I am trying to compile a debug version so I can see trace statements to see if the native extension reports success on changing the bit. Here is my command line cobbled together from scraps of info on adobe.com and the -help data:
    adt -package -target ipa-debug -connect 192.168.1.80 -provisioning-profile myApp.mobileprovision -storetype pkcs12 -keystore myApp.p12 myApp.ipa myApp-app.xml myApp.swf dat AppIconsForPublish Default-Landscape.png Default-LandscapeRight.png -extdir extensionDir
    Before this iCloud change this app published directly from Flash Pro CS5.5 without any issues. I am only running into issues getting this app to work with this native extension and/or published correctly.
    I am including the folders "dat" and "AppIconsForPublish" as well as splash screens (this app is landscape-only) as well as that extension in the folder extensionDir.
    After putting in my password my app compiles into an IPA which I can drop into iTunes. It has the same general size as the IPA generated from Flash Pro. The icon is correct, etc.
    When I sync this file, the progress bar goes across, I see it loading on my iPad and then once it goes to install I get a popup saying "iTunes Sync: 'myApp' failed to install."
    Is there anything obvious wrong with my adt line? Has anyone else used this native extension? Ideas on what I can do to fix this?
    No, unfortunately I did not build this with Flash Builder. I am an avid user of it now and this would be a moot point as it uses ANEs and changes SWF versions trivially. I have to get this to compile using Flash Pro CS5.5 though.
    Any help is greatly appreciated!
    edit:
    Just FWIW, after I updated the .xml to use the latest AIR and such (so the version is 14) I removed the extension, exported purely from Flash Pro CS5.5 and the app works fine. As soon as I enable the <extension> in the XML I can no longer install the app. This just appears to be a noob adt publish issue.

    My app downloads PDFs, movies and other information-esque files and saves them to the apps Documents folder so they can be retrieved via file sharing. These files not being in something purgable like /Library/Caches and not having the "do not back up" bit is why I was rejected.
    update: It's definitely my command line building.. I took out the native extension completely and published from flash to an IPA and it works. I then run adt on the same SWF that just worked and it fails to install. So the install failing is my command line. I see this article and my command line is very similar. I'm really uncertain why it's failing.

  • How to use GooglePlayServices libs in Native Extension of Android AIR app?

    I am trying to use some features of Google Play Services lib but I could not make it work. I have added the reference to the google play service libs to the manifest file (from Flash Builder)
    <application android:enabled="true">
    <meta-data  android:name="com.google.android.gms.version"
                    android:value="@integer/google_play_services_version" />
    <activity android:excludeFromRecents="false">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    </application>
    In my ANE, I have added the reference to the source of google-play-services_lib, but when I tried to call the FREFunction to check the availability of Google Play Service
    @Override
    public FREObject call(FREContext context, FREObject[] args){
         boolean result = false;
         try{
          Activity activitiy = context.getActivity();
          activityContext = activitiy.getBaseContext();
              result = isGooglePlayServiceExists();
         }catch(IllegalStateException e){
          Log.e(AneUtils.TAG, "Failed to get AIR current activity", e);
         FREObject obj = null;
        try{
            obj = FREObject.newObject(result);
        }catch(FREWrongThreadException e){
            Log.e(AneUtils.TAG, "Failed to create FREObject from [" + result + "]");
        return obj;
    private boolean isGooglePlayServiceExists(Context activityContext){
        int googlePlayServicesCheck = -1;
        try{
            googlePlayServicesCheck = GooglePlayServicesUtil.isGooglePlayServicesAvailable(activityContext);
        }catch(Exception e){
            Log.e(AneUtils.TAG, "Error getting googlePlayService state",e);
        if(googlePlayServicesCheck == ConnectionResult.SUCCESS){
             return true;
        return false;
    The ANE crashed at the line GooglePlayServicesUtil.isGooglePlayServicesAvailable(activityContext) so I really doubted the Google Play Service libs was not added.
    Has anyone successfully imported the Google Play Serivce libs into Adobe AIR Android app?
    Any advice or help will be appreciated. Thank you.

    hey sshk5,
    I have managed to make it work. The solution is quite simple, i will explain the steps below
    1. Download the latest Android SDK from ADT (including the latest version of GooglePlay lib)
    2. Check the version number of Google Play lib ( for example 412312....) something and in your FlashBuilder project, make sure you use the  exact number like
    <meta-data  android:name="com.google.android.gms.version" android:value="412312" />
    3. Use tool to merge the googlelib jar file with your native extension before importing the native extension to FlashBuilder. If you do not want to use any other tool, you can use the AIR 4.0 which will allow you to use commandline to merge jars (and even dependency resources)
    Hope it helps

  • IPhone 5S IOS 8. Can't figure out how to disable the "live" location feature within the native calendar app used for mapping/travel time.  Have looked everywhere and it's driving me nuts.  Thanks for any help on where to make the change!!

    iPhone 5S IOS 8. Can't figure out how to disable the "live" location feature within the native calendar app used for mapping/travel time etc.  Have looked everywhere and it's driving me nuts.  Thanks for any help on where to make the change!!

    iPhone 5S IOS 8. Can't figure out how to disable the "live" location feature within the native calendar app used for mapping/travel time etc.  Have looked everywhere and it's driving me nuts.  Thanks for any help on where to make the change!!

  • Using an ANE (Adobe Native Extension) in a CS Extension

    Hi,
    I've made a simple ANE which works with AIR on a Windows Desktop.
    I'd like to use it within a CS Extension, but it does not work (ExtensionContext.createExtensionContext(...) fails.
    Did anybody succeed doing this ?
    Any idea welcome,
    TIA,
    J.

    Hi,
    Thanks for your answer.
    We have a dll which does quite complex things.
    The idea is to create to ANE to use it either from a AIR desktop application (in Windows and later on MacOS), or from a CS extension within InDesign.
    The desktop application/CS extension are mainly GUI, doing it in Flex would have allowed easy and reusable development for both Windows/MacOS.
    J.

Maybe you are looking for