简体   繁体   中英

Run Flex Mobile Application on Desktop

I have a completed Flex Mobile application, built for the Blackberry Playbook. I would like to have it so the application could run on the desktop. I don't mean in the simulator, I mean as an actual application on Windows.

Is this possible/easy to do? How could this be done?

If you want an installable desktop app of your mobile project in Flash Builder you can:

  1. Click on Project > Export Release Build.
  2. Fill in your destination directory in the "Export to folder" input.
  3. Change the "Export as" option to "Signed AIR package for installation on the desktop" and click the Next button.
  4. You'll need to have or create a new digital signature. Click the Create button and fill out the form to have Flash Builder create it for you.
  5. Then hit Finish and it'll build an AIR app that you can install on the desktop OS.

I'd suggest setting some values in your APPNAME -app.xml file in your project. I set resizable to false, width to 640 and height to 960 so that it would mimic a mobile iPhone 4 app. I also made sure my application identifier ( id ) was set, along with filename , versionNumber and versionLabel .

If you'd like to put your app on your website, Michaël Chaize has a great post on how to run a version of your Flex app in the browser . Basically you create a new non-mobile project, add the mobile components, override some classes for states and orientation changes you'd have on a device, and include the mobile skin and you're finished. I have not tried this yet, and I don't know if there are any caveats or restrictions with this route.

Generally, with Flex Builder I would create a new project, with the same code. Or, ideally, move the shared code into a library project; then you can easily share it between the two projects.

If you're using a build tool, such as ANT or Maven, you should be able to use the SDK w/ different compiler flags to create your release builds from the exact same source base.

Of course, in most cases you won't want to use the same exact code in a mobile app that you use in a desktop app.

Change the publish settings to AIR for desktop. You'll probably get errors if you have accessed any APIs that are explicitly reserved for that mobile platform but that will require some refactoring on your part and is unavoidable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM