Everyone wants to compile their desktop (AIR) or web (Flex) applications as mobile (Air mobile) apps. Here I am going on the opposite direction. I want to compile my Air mobile app as a Flex web app and open it with the browser.
I think this is possible since, at the end of the day the, the Air mobile framework is -almost- a subset of the flex framework. Am I correct? I know that you use other libraries as well, like mobilecomponents.swc and servicemonitor.swc, but mainly they are supposed to be very similar.
While trying to acomplish this, I created a Flex Project on the Flash Builder and added the mobilecomponents.swc, imported my mobile code and replace and compiled it. There were no errors and the builder compiled everything without any warnings.
The only problem was that when I opened the swc in the explorer, the screen was all white and the app didn't even run. I knew the swc was loaded because of the mouse context menu, it showed you all the options of a regular swc but the app didn't run. I tried to debug it but nothing happened.
Clearly I did something wrong. If anyone can tell me how can I do this, I would really appreciate it.
Thanks in advance,
Sebastián
You're confusing some things...
I want to compile my Air mobile app as a Flex web app and open it with
the browser.
I think this is possible since
You are correct; this is possible. I converted a mobile application to a browser based application in about half a day. I had to change how a config file was loaded; but everything else worked without change.
You may have to re-write some functionality of your app if it uses AIR Specific functionality. The File class is one example.
the Air mobile framework is -almost- a subset of the flex framework.
Am I correct?
You are wrong here. The AIR Mobile framework is completely independent of the Flex Framework.
However, the Flex framework does provide many mobile optimized skins for Flex UI Components, such as buttons and lists. It also provides some special mobile only components.
However, there are non-Flex classes / functionality available on mobile that have nothing to do with the Flex Framework; they are part of the core AIR SDK provided by Adobe. The File class I mentioned previously is one.
While trying to acomplish this, I created a Flex Project on the Flash
Builder and added the mobilecomponents.swc, imported my mobile code
and replace and compiled it. There were no errors and the builder
compiled everything without any warnings.
Yes, you can use the Flex Mobile Component set tin a browser based app or other desktop app. But, as you discovered, you have to manually add the SWC to the output. You may also need to add the mobile theme for the mobile components to display properly. This can get confusing if you want to use a mix of mobile themes and non-mobile themes in the same app; because there is some cross over and Flex will not know which one to use by default.
You'd have to provide more information / code to help us diagnose the specific error you received.
I've done it before so it should work just fine.
What I did was create a standard web app (I have no code in sitting in "main" so I could switch the top level application tag easily), added mobilecomponents.swc, and selected the mobile theme in the Project Properties (you may need to import this from frameworks/themes/Mobile/mobile.swc).
After that it should be able to use the mobile components in a web or air desktop build.
Related
I am playing with Qt on Android platform, and one of major drawbacks of Qt on mobile platforms is that it's missing Web Browser component.
I found that in order to display HTML content, one can use "WebView" component: http://doc.qt.io/qt-5/qtwebview-index.html
Unfortunately I found 0 information on how to use this on non-QML application. Everyone is assuming your app is QML, but what if it isn't. Is there any way to use this component? How?
I'm working in a webapp with Spring and I always used JSP and Jquery, In a recent conversation, some guy commented: You should use Flex instead.
Would Flex be a good choice for a web app? What are the advantages of using it vs. just JSP and Jquery?
I think you really mean to ask; why should I use Flex instead of JQuery.
JSP is a server side language. Flex or JQuery are client side languages. Flex is not a replacement for JSP any more than JQuery is a replacement for JSP.
Flex can be used to create a Flash Application; which can be deployed in a few different ways.
It can be used to create a browser based application that run in Adobe Flash Player. The Flash Player is only supported on desktop browsers, and there are no viable options to deploy a Flash Platform app to current mobile browsers. I would only recommend this if you had tight control over the machines accessing your application.
It can be used with Adobe AIR to create a desktop application for Windows or Mac machines. I, personally, think the use case for this is even smaller than creating browser based applications.
It can be used with Adobe AIR to create a Native Application on iOS, Android, and Blackberry Playbook. If you are tasked with building a Native Application that needs to be deployed on multiple mobile OSes; I think that Adobe AIR presents an intriguing option.
if you need to build Native mobile applications, and you already know JQuery, I'd recommend investigating options to build your JQuery apps as Native Applications. I know options are out there to convert HTML into Native Applications, but can't comment on them. I see no need to switch your technology unless you are running into limitations. To evaluate Flex ;you'd have to define what those limitations are and then decide whether Flex will help solve them. Usually the time savings of "use what you know" outweigh any benefit that comes from switching technologies.
That said; Flex provides some things that I don't see yet in the "HTML5/JavaScript" space. It has a robust UI Framework that works identically across all the platform targets, a step through debugger, and a memory profiler just to name a few.
The two technologies are completely different. JSP/jQuery would give you a web application. Flex would give you a Flash application.
Personally, if JSP/jQuery would work for you then you should go that route. If you don't need the features of Flex, there's no reason to require the user install the plugin.
I recieved a Flex project and I want to try to compile and run it using Adobe Flash Professional, but I unable to do it. How can I do it?
I think that I need to create a new project and import every single class from Flex project to a new project in Adobe Flash Professional. Can someone help me?
Really, I strongly recommend against even trying, because it is going to be tediously hard. The Flex Compiler does a lot of framework setup behind the scenes, and you'd have to re-write all that code manually to get a Flex project to compile / work in Flash CS5. This will be extra difficult if any MXML is used in the Flex project, which is likely.
That said, a few people have experimented with that stuff. This is the best one, on manually initializing the SystemManager.
This one came up in Google search and may be useful too.
I we have been working for some years in a flex (cairgorn)+spring+blazeDataservice application using blazeDataservice to connect to the back end, now its getting kind of big and takes too much time too load, and people who use it, normally need it to use it regulary.
My country's internet bandwith is not getting better, actually it´s getting worse, so the app gets bigger and bandwith gets worse so loading it it's getting slower by the day.
I was wondering how could I get the client to be installed on peoples computers, I would be turning a flex online app into a desktop app WITHOUT REWRITING IT. I only need someone to point me in the right direction, i was thinking about 2 options:
1.- Can it be turned into adobe air ? is in´t adobe air desktop ?
2.- Maybe a flash that runs in peoples desktop ?
I need everything to work against the host spring backend just like it does today
Thank you very much!
Just to be clear:
If it is the size of the app (SWF) itself, rather than the queries being performed, an another alternative to speed things up, without building a Desktop (AIR) version, would be to use what Flex calls Modules.
Basically you would be breaking your app into smaller pieces that get loaded only as necessary.
If you do go the Desktop (AIR) route, you may also want to explore a local SQLite database that Syncs with your server only as needed, thus further reducing the internet connectivity issues.
This would of course add to your development time, but it seems like it might be a good bet given the situation you describe.
As for where to start, switching from a Web to a Desktop (AIR) app can be as simple as changing the main MXML tag from (in Flex 3) mx:Application to mx:WindowedApplication and launching your app.
UPDATE in response to follow up question:
Hard to say how much rewriting would be involved without knowing how your code is currently structured, but doubtful it would be a major rewrite.
As an experiment, I would suggest the following:
Create a new Flex application.
Create a new Module.
Add some simple MXML and Actionscript to the Module.
Add an instance of the Module to your Main view.
Run/Compile.
What you should see is that you might as well have not wrapped it in a Module at all, from a functionality or coding perspective, but the Module will have been compiled into a separate SWF, and Flex will handle loading it as needed.
If that all works and makes sense, I would start breaking up pieces of your code into Modules and see if that begins to solve your problem.
Adobe AIR is the right way to go. It is essentially #2, and often you can pretty much just publish exactly what you have straight to AIR instead of the web, and it just works. Fancy!
I'm new to Air. I've got an existing Flex 2 application which I'm considering bringing into Flexbuilder 3. My question is can I use the same base application (and source code) to make the Air version, or would I have to maintain to separate code trees: one for the Air version and one for the Flex/SWF version?
The best approach I've found to creating both Flex and AIR applications from the same source, is to use a core library project for almost all code, with separate small projects for the Flex and AIR applications.
There are two key concepts that make this very powerful and maintainable, allowing for not just two applications, but for many "editions" if you're so inclined.
Modules:- If the core application is
actually a module (or a module that
loads other modules) you'll be able
to easily create stub Flex and AIR
applications that are basically
there to set project properties,
reference classes for cross-module
communication, and then simply load
the core application module with a
ModuleLoader.
Factory Objects:- When there are
things you want to do on the AIR
desktop application that you can't
do in the Flex application, or any
case where you want something to
work differently across
applications, a factory object that
creates an instance of a project
specific class is a great way to do
it. for example, you can call your
"save" function, which for AIR saves
to the file system, but for Flex calls
a web service.
Have a look at Todd Prekaski's
excellent Flex DevNet article on
Building Flex and Adobe AIR
applications from the same code base
on how to do this.
Once you've created a Flex Library project where you're going to create your main module, create your Flex and AIR application projects. In the properties of the two application projects add the library project src directory to the Flex Build Path. While in the project settings you'll also need to add the modules to the Flex Modules section, setting the option to optimise for the project.
You can't mix both AIR and Flex in the same Flex Builder project, but you can share code. Here's how...
Create a Flex based project as you
normally would.
Create a second AIR based project.
In the second application, go to
project->properties.
Select the "Flex build path" option.
Under "Source Path" add the folder
that contains the source from your
first Flex based project.
Now both projects share the code from the flex project.
You need to be careful not to use AIR only API's in code you intend to share between both apps.
You can use the same.
One way is to put the bulk of the application in a Group-based component in a library.
Both Flex and AIR applications can embed that component in their Window.
If you need to have custom code, have your Group component accept an Interface object that has all the methods that are specific to a platform (loadFile, saveFile, etc.). Each application injects an object that implements these methods appropriately.
I've worked on a product that injected a whole local-data access layer (to the SQLite database) and the core application had no idea if it was running in a browser or on the desktop (connected or disconnected).
Cheers
Create 3 project: Air, Web, and common. from air and web, include common.
http://simplifiedchaos.com/how-to-compile-both-flex-and-air-application