Distributable extensions (modules) for mobile app in Adobe Flex/AIR - apache-flex

I am creating an mobile app in flex 4.6 which will have some default embedded content.
I need to be able to extend this app with modules (additional content libraries) let's say up to 35MB each, the client wants these modules as separate positions(packages) on the app store. How to approach such project in Flex? Is it possible to create mobile Flex app with separately purchasable extensions?

Yes, its possible. Copy over your assets from your Application directory to user directory or application storage directory(if you want to update them). Now use you can write a module or a native app to go and update/copy these files that your app will use.
Keep in mind your Application Directory is write only and protected well. You will not be able to go edit/delete files at least for flex. From what I understand you cannot do this with IOS on the application storage directory, Apple don't like that-
http://blogs.adobe.com/airodynamics/tag/file-applicationstoragedirectory/
http://blogs.adobe.com/simplicity/2010/01/api_tip_dont_abuse_fileapplica.html
You should be able to detect these files and automate whatever you need. With the user directory there is a chance that your sensitive material may be accessible to the technically savvy.

Related

How to make an SQLite database as part of the build process - iPhone SDK

I have created a Core Data application in iPhone Simulator. Now when I am testing it on a device, my SQLite database is empty. I have some preloaded settings which I want to deploy when the application is installed.
How can I achieve that?
I have seen a few questions on Stack Overflow, but they don't exactly answer my question.
If you have an existing sqlite-store file you just add it to the app bundle just like you would any resource e.g. images, audio, etc.
If it is read only, you just use the NSBundle commands to supple a path to it inside the readonly app bundle. If you want it writable, you copy the store file from inside the app bundle to one of the writable app directories e.g. Documents or Library, and then open it there as you normally would.

Is it possible to upload a complete directory structure with Flex?

Is it possible to upload a complete folder with subdirectories and files (in the subdirectories) in Flex?
I am using a Flex / BlazeDS / Spring application. The question is not how to transfer the data to the server. The question is: if it is possible to get access to the files and subfolders (recursive) with Flex?
If you're working with AIR, then yes. Look a the File class. It is a reference to either a file or directory. You can tell if it is a directory using the isDirectory attribute. You can use getDirectoryListing to get a list of all files and subdirectories in a directory.
As far as I know, you'll then have to upload things one by one to the server, though.
If you are using Flex in a web based app, I do not believe what you're trying to accomplish is possible.
No, not if you are talking about a Flex app running in a web browser. In an AIR application it is probably possible, but not in Flash Player in a browser.
The security sandbox doesn't give that kind of file system access, files are only available when selected by a user, via some user action like clicking a button. And then you only get a reference to the file, so it can be read or uploaded, there is no mechanism to for example get the local path to the file as a string or such, and no way to check for subfolders (unless it's an app for the AIR runtime).

Convert Multiple SWF files to Single EXE

Hi I have an application in flash, I build in ActionScript 3.0 Flash IDE, my application loads some external swfs which mentioned via XML file. Its working fine at the moment. But I need to compile all these external SWFs and xml file into single exe file. How can I compile like this. or how can I code like this?
EDIT: 1
from here : http://page-flip.com/products/pdf-publisher/
You can see an example, the application is build in .net and it import pdf and publish it as flash projector or web based(swf). How is it compiling all the external SWF files.
If you have Flash CS4 you can make use of the mxmlc compiler which has some additional tricks up it's sleeve.
Using the embed tag like this will allow you to embed an entire swf "inside" your swf:
[Embed(source = '../assets/items/9.swf')] public static const ITEM_9:Class;
Then, to instantiate it you simply go:
var mySprite:Sprite = new ITEM_9() as Sprite;
Using this and some clever overloading of your current classes for external loading should allow you to get a single swf (xml files can be embedded in a similar fashion).
Then it's just a matter of using the Publish settings to make Flash spit out an .exe
On an unrelated note, please go back and accept some answers to your questions. It's not very nice not to.
You can try mdm Zinc.
Zinc is really powerful. It lets you package your Flash or Flex in different ways, with lots of native platform hooks.
you can build an AIR application. if you don`t want it to be cross platform, you can build an AIR application with a windows native installer.
Flash > File > Project settings > Windows Projector.
For MAC, choose a MAC projector.
If you are burning to a disc and you need both platforms to work...a good option is to use Toast (if you are on a MAC)...it will hide the files you don't need the user to see, and also hide windows files from MACs and vice versa.
There is an application for Windows called SWFKit, which allows you to package your SWF and external files into one exe file. I had the same problem as you, and this worked a treat for me. Unfortunately you do need to pay for it :( http://www.swfkit.com
Hope this helps,
Will
I would go about it with these steps
create a flex application
embed all of the SWF's and the XML into that application
create a release of the application you just created
open the SWF application with the stand-alone flash player and not with the browser
from the file menu select the option create projector
All of this will result a single EXE file that contains all of the SWF's and the XML file.
You can use a projector or make an windows only AIR project.
Use flajector and forget about your problems

converting Adobe AIR to Flex application

We have a Adobe AIR desktop client which talks to a WAMP server. How can i convert this AIR app to a Flex app to be used in the browser.
Please let me know.
Thanks
vish.
I would create a new empty Flex application and copy your files into that project. Then move any code in your main app component (which is derived from WindowedApplication) into the main app component in your new project (which is derived from Application). You'll also have to go through your app and determine which components are used that are specific to AIR and rework them to use other Flex components (the compiler will complain if you don't). This should give you a good start.
I would move everything into a Flex library project. Then have an AIR project as well as a Flex app project which accesses the common code in the Flex Library project. This way you don't have to maintain two different codebases for common code and you can also have code which is specific to each version.

Flex and AIR passing data between each other

I’m looking for some samples/tutorials/general pointers in doing either of the following.
1) Create an AIR app that can load a live flex app and use that for testing. So we have a app which is live and if I could load that into a AIR app which can edit a config file and then test that config file using the live swf but inside the AIR app to make sure that if doesn’t break the flex app before uploading new config for the live app.
2) Or I’ve heard of being able to drag data from an AIR app into a flex app. If so then the AIR app could pass the test data across to the flex app and it would refresh and we could see whether it works or not.
I've looked into this a bit now and it looks like using the clipboard and some javascript seems like the way forward. Save data in clipboard from AIR app then read clipboard using javascript and send to flex app. Has anyone any other ways of transferring data between AIR & flex.
Also 'You cannot access shared objects across sandbox boundaries.' is from Adobe docs which I'm presumming means that an AIR app can't share the same 'flash cookie' as a flex app. Is this correct?
Has anyone any other ways of
transferring data between AIR & flex.
flash.net.LocalConnection is the standard method of doing this, and although it has its quirks, it works quite well. This is what I use to transfer data from a Flex app (that's running in a browser, although it shouldn't matter whether it's running in the browser plugin or the stand-alone Flash Player) to an AIR app.

Resources