How to create a native window in Xcode and integrate it with a Mobile Flex application. The native window should act similar as the StageWebView component whereby the native content floats in a rectangular area over the rest of the Flex app.
How to create an ANE that will natively display a Floating Window
5k Views Asked by Christo Smal At
1
There are 1 best solutions below
Related Questions in IOS
- Overlapping UICollectionView in storyboard
- Cannot pod spec lint because of undeclared type errors
- Is the transactionReceipt data present in dataWithContentsOfURL?
- UIWebView Screen Fitting Issue
- ZXingObjC encoding issues
- iOS: None of the valid provisioning profiles allowed the specific entitlements
- How to hide "Now playing url" in control center
- CloudKit: Preventing Duplicate Records
- Slow performance on ipad erasing image
- Swift code with multiple NSDateFormatter - optimization
- iOS 8.3 Safari crashes on input type=file
- TTTTimeIntervalFormatter always returns strings in English
- How do I add multiple in app purchases in Swift Spritekit?
- Setup code for xibs in iOS. -awakFromNb:
- iOS Voice Over only reads out the title of any alert views
Related Questions in XCODE
- Using Storyboard Reference
- Getting this message in my console in xcode "Ignoring restoreCompletedTransactionsWithApplicationUsername: because already restoring transactions"?
- Error when creating UIImage
- fade in an bounce animation subview
- How to delete static library ".a" file from xcode project?
- Error in main.storyboard
- Is the compiler Xcode uses to produce Assembly code a bad compiler?
- Using paths bonded to a XCode project to be shared
- How to set the time of Local notification in app to random between two times? (swift)
- "Invalid Signature, code object not signed at all" error
- Alarming memory increase with custom segue
- Display both alertTitle and AlertBody on a custom WatchKit notification
- How to make a CocoaPods project work on OS X El Capitan & Xcode 7 Beta?
- Cannot use CTRL+Drag for making a button action in Xcode?
- Labels properties changing in Xcode
Related Questions in APACHE-FLEX
- call Win32 API in flex to set Window Display Affinity
- Adding a listener to a VerticalScrollBar in flex
- Two ane file conflict in one flex mobile application
- Using AS3 Timer & distriqt Notification ANE To Send Notifications While In Sleep Mode
- Creating a vertically draggable container in Adobe Flex 3.5
- There is no save() method in FileReference Class of Flex
- Passing data between MXML files and opening one after Click on another
- How to check a Number in mxml?
- Strange flex module behavior.Module become null when add a little nonsense code
- AS3 can't find the load method on a Loader
- 2032 Flex error while contacting HTTPS REST services
- Error Message not generated
- ASC2 compiler with Flash Builder 4.6
- Is there a class in AS3 that tells you the type of the URL protocol?
- Skip window from being captured
Related Questions in ADOBE
- Adding a listener to a VerticalScrollBar in flex
- How to include an existing component multiple times
- Coldfusion 9 serializeJSON()
- Creating a vertically draggable container in Adobe Flex 3.5
- Adobe Analytics - Log/debug back-end traffic
- Redirection url in Adobe Analytics
- Adobe omniture - trying to fire evar and events in the s_code file doesn't work
- How to add multiple pages in AIR for Android
- Not able to see modified pdf only on Adobe Acrobat reader on ios
- blob url in ie is not working
- How do I get rid of a 3D grid overlaying my artboard in Ilustrator?
- Creating a Record Option on a PDF or Word Document
- Read IDML file in Java
- Photoshop - How to navigate the canvas using Javascript?
- Unable to see embedded image in <TextArea> using <img> tag (Flex 3.5 build 123683)
Related Questions in AIR-NATIVE-EXTENSION
- Two ane file conflict in one flex mobile application
- How to access Android apk resources from AIR native extension?
- Complile ane with ant
- Correct jar lib for android ane
- Flash Air / Android: native extension testing
- Is it possible to add Native Extensions to Actionscript Library projects?
- Registering but not receiving push notifications on Android
- Run a new UI background activity from an ANE (Adobe Native Extension) on Android
- Adobe AIR Native Extension Game Kit by Vitapoly. How accept invitation?
- How to get Context from FREContext ?
- Google Cloud Messaging service in flex mobile project
- Start Flex Mobile Application on Android startup
- as3 _ctx is null pozirk android in app purchases ANE
- Adobe native extension Missing Implementation
- Build ActionScript Native Extension
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Being a flex programmer, this was a tedious process that took me weeks to figure out. Hope this will helps some other Xcode newbies.
First of all, you must have a basic understanding of Objective-C and Xcode. You should be able to create a simple Hello World Xcode program. Once you know how to do this, you'll see that for each visual window you'll typically have a xib file, a header file and an implementation file. I found that it is easier to start of writing a normal Xcode application, and then once it is working and looking like it should, you manually pull these 3 files (and of course the helper files) over to your Xcode static library project. So, moving on, I'm going to assume that you're past this step. Here are some step by step instructions on how to integrate Xcode and Flex mobile, using ANE:
Delete FWAne.h file. Replace contents of FWAne.m file with the following:
'#import "FloatingWindow.h" '#import "FlashRuntimeExtensions.h" FREObject openFloatingWindow(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[] ) { uint32_t parm0Length, parm1Length, parm2Length, parm3Length, parm4Length, parm5Length, parm6Length, parm7Length, parm8Length, parm9Length, parm10Length, parm11Length, parm12Length, parm13Length; const uint8_t *uparm0, *uparm1, *uparm2, *uparm3, *uparm4, *uparm5, *uparm6, *uparm7, *uparm8, *uparm9, *uparm10, *uparm11, *uparm12, *uparm13; FREGetObjectAsUTF8(argv[0], &parm0Length, &uparm0); NSString* parm0 = [NSString stringWithUTF8String:(char*)uparm0]; // FREGetObjectAsUTF8(argv[1], &parm1Length, &uparm1); // NSString* parm1 = [NSString stringWithUTF8String:(char*)uparm1]; // FREGetObjectAsUTF8(argv[2], &parm2Length, &uparm2); // NSString* parm2 = [NSString stringWithUTF8String:(char*)uparm2]; // FREGetObjectAsUTF8(argv[3], &parm3Length, &uparm3); // NSString* parm3 = [NSString stringWithUTF8String:(char*)uparm3]; // FREGetObjectAsUTF8(argv[4], &parm4Length, &uparm4); // NSString* parm4 = [NSString stringWithUTF8String:(char*)uparm4]; // FREGetObjectAsUTF8(argv[5], &parm5Length, &uparm5); // NSString* parm5 = [NSString stringWithUTF8String:(char*)uparm5]; // FREGetObjectAsUTF8(argv[6], &parm6Length, &uparm6); // NSString* parm6 = [NSString stringWithUTF8String:(char*)uparm6]; // FREGetObjectAsUTF8(argv[7], &parm7Length, &uparm7); // NSString* parm7 = [NSString stringWithUTF8String:(char*)uparm7]; // FREGetObjectAsUTF8(argv[8], &parm8Length, &uparm8); // NSString* parm8 = [NSString stringWithUTF8String:(char*)uparm8]; // FREGetObjectAsUTF8(argv[9], &parm9Length, &uparm9); // NSString* parm9 = [NSString stringWithUTF8String:(char*)uparm9]; // FREGetObjectAsUTF8(argv[10], &parm10Length, &uparm10); // NSString* parm10 = [NSString stringWithUTF8String:(char*)uparm10]; // FREGetObjectAsUTF8(argv[11], &parm11Length, &uparm11); // NSString* parm11 = [NSString stringWithUTF8String:(char*)uparm11]; // FREGetObjectAsUTF8(argv[12], &parm12Length, &uparm12); // NSString* parm12 = [NSString stringWithUTF8String:(char*)uparm12]; // FREGetObjectAsUTF8(argv[13], &parm13Length, &uparm13); // NSString* parm13 = [NSString stringWithUTF8String:(char*)uparm13]; } // ContextFinalizer(). void ContextFinalizer(FREContext ctx) { NSLog(@"ContextFinalizer"); //Cleanup Here. return; } // ContextInitializer() void ContextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx, uint32_t* numFunctionsToTest, const FRENamedFunction** functionsToSet) { NSLog(@"ContextInitializer"); *numFunctionsToTest = 1; } // ExtInitializer() void ExtInitializer(void** extDataToSet, FREContextInitializer* ctxInitializerToSet, FREContextFinalizer* ctxFinalizerToSet) { NSLog(@"ExtInitializer"); *extDataToSet = NULL; *ctxInitializerToSet = &ContextInitializer; *ctxFinalizerToSet = &ContextFinalizer; } // ExtFinalizer() void ExtFinalizer(void* extData) { NSLog(@"ExtFinalizer"); // Do Cleanup here. return; }Add the FlashRuntimeExtensions.h to your Xcode project. This file exists under the /Applications/Adobe Flash Builder 4.6/sdks/4.6.0/include folder
Create your class that will use ExtensionContext to wire the Flex code to your Xcode code like so:
package fwane { import flash.events.EventDispatcher; import flash.events.StatusEvent; import flash.external.ExtensionContext; }Build the FWAne swc
Next, you are going to require a build script to compile your ANE. Here's my build.sh script:
Important to note about my build script: The xibs are compiled to nibs, and then these nibs together with other resource files (such as images) are then included in the ANE. Remember that static libs cannot contain resource files.
You would also require an ios-platformoptions.xml file. This is to include all frameworks you require. You can also include any additional 3rd party libs with their search paths here:
<platform xmlns="http://ns.adobe.com/air/extension/3.1"> <sdkVersion>5.0</sdkVersion> <linkerOptions> <option>-framework Foundation</option> <option>-framework UIKit</option> <option>-framework QuartzCore</option> <option>-framework CoreGraphics</option> <!--option>-lthirdparty</option> <option>-L/searhPath/for/thirdlibrary</option--> </linkerOptions> </platform>Now, in FlashBuilder, create a sample test application project. Go to project properties. In Flex build path, make sure the ane is added. Also under Flex Build Packaging -> Apple iOS -> Native extensions the ANE is added there and package is checked. Also add the Apple iOS SDK folder under native extensions. Finally, check that the extension is added in the -app.xml file.
Hope this helps
C