1 / 12

NativeProcess

NativeProcess. By, Jonathan Rowny. The power to process (other applications). Jonathan Rowny. @ jrowny Jrowny.com jrowny@aboutweb.com jrowny@gmail.com Google Plus, +Jonathan Rowny. The Plan. Overview Support Setting up your Project The basics  Compiling Example #1 Check Yo Self

tejano
Download Presentation

NativeProcess

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NativeProcess By, Jonathan Rowny The power to process (other applications)

  2. Jonathan Rowny • @jrowny • Jrowny.com • jrowny@aboutweb.com • jrowny@gmail.com • Google Plus, +Jonathan Rowny

  3. The Plan • Overview • Support • Setting up your Project • The basics  • Compiling • Example #1 Check YoSelf • Example #2 SSH into a remote server • Example #3 Drinking Bird • Q&A

  4. What’s the NativeProcess? • Allows you to call other applications • Behind the scenes • Send/Receive input and output through "processes" • a.k.aStandard In, Standard Out • a.k.a text. • NOT the same thing as NativeExtensions

  5. Support • Works on Mac, Linux, and Windows • Assumes Native Apps Exist • Linux goes unsupported after Air 2.5  :(  • Introduced in Air 2.0 • Extended Desktop Only • No Flash Player, No mobile. • Applications must be compiled to EXE, DMG, DEB, or RPM • Will NOT work on Mobile (Use Native Extensions for that)

  6. Setting up a Project • New Flex App • Select "Desktop" • Use Flex 4 SDK or higher, we'll use 4.5.* • Edit your-app.xml • <supportedProfiles> extendedDesktop</supportedProfiles>

  7. The Basics • You only need to worry about TWO objects! • NativeProcess • The actual running process • Add listeners to this (i.e. input/output) • NativeProcessStartupInfo • Instructions to get the process started: • Path to command • Arguments

  8. Basics, Part Duex (Info) varinfo= newNativeProcessStartupInfo(); info.executable = "some/fun/program.exe"; info.arguments = ["-do","stuff"];

  9. Basic, Part 3 (Process) varprocess = newNativeProcess(); process.start(info);

  10. Basics, Part 4 (Events) • ProgressEvent.STANDARD_OUTPUT_DATA • The text comes out • ProgressEvent.STANDARD_ERROR_DATA • The error comes out • NativeProcessExitEvent.EXIT • The process is done… hopefully not on error

  11. Compiling • Export release build as you normally would • Run ADT at command line    Example: -package -target native myApp.exe myApp.air relevant document: http://goo.gl/ppmVS

  12. Examples

More Related