With AIR 3.6, is it finally possible to load an EXTERNAL swf file with AS3 code from the web and use it on the iOS device?
I see on their web page they say the new features include:
Packaging and Loading Multiple SWFs: This feature provides developers better memory management by allowing them to load the assets they need dynamically at ANY time from multiple SWFs and not have to load it up-front.
Just to make it clear, does this mean it only work for swfs packaged with the application, or also with externals swfs?
This was just announced in AIR 3.7 not 3.6.
AIR 3.6 includes the ability to package multiple swf's with your iOS app but does not allow you to download them from an external server.
AIR 3.7 looks to give you the ability to load external swf's from a website.
Application developers will be able to host their secondary SWFs on an External server and load them on demand as per their application
logic using this feature. The loading secondary SWFs which have any ABC code in AOT mode, which worked for just locally packaged
SWFs earlier, will now work for loading SWFs externally as well
It looks like the bytecode will be contained in your application binary
During IPA packaging, ADT extracts the Actioscript code from all child SWFs which are specified within the sample text file, adds it to the
final executable and moves the stripped SWFs into the "externalStrippedSwfs" folder created in the current working directory.
Check the release notes PDF for an example,
http://labsdownload.adobe.com/pub/labs/flashruntimes/shared/air3-7_flashplayer11-7_releasenotes.pdf
It seems there is a requirement that the external SWF file is compiled for Flash Player 11.6, with an internal version number >= 19.
Related
I'm working on a software that includes 3D graphics. Those are massive enough, so I decided to use OpenGL to keep a quite fluent animation. I selected THREE.js graphic library (WebGL).
Reading the html through a Web browser works very well : WebGL functions are recognized. I did it on my desktop (Win32/Firefox17, please do not judge me on my configuration !) and on a Nexus 10 (Android 4.3, FF24 and FF25Beta, tried with Chrome30Beta but no joy...). But I need to access native data, like the file system, to get informations for my program. So I wrapped my code with WL, and deployed it as an app on my Nexus 10... And so disappeared the WebGL capability... :(
So I looked for a reason to that :
I found on the IBM site two different ideas : in one way, I understand that a JS engine is embedded, in another that WL uses the engine of the default Web browser of the tablet (what I understood the first time)...
Let's be precise with the different engines : On the Nexus, FFs have obviously Gecko engines, Chrome30 is a Blink (webkit-like, version 537.36). Those are the ones detected by window.navigator.useragent as I read directly in the browser, no surprise. In the Eclipse/WL preview, I got different interpreters, depending the browser I selected, FF or IE (not Safari, I don't have it installed), but not the one from my desktop (the ones used are even older than my own FF...). But, when I detect the one used in the app (after wrapping in an apk), it returns an AppleWebkit 534.30/Worklight/6.0...
Maybe I'm wrong (tell me), but if 'Worklight' is in the version of the engine, and if webkit is used even when I suppress Chrome from my tablet (the version is different, but who knows..), I wonder that, for this app, as it's configured, the engine is embedded by Cordova or WL.
If it is so, I agree it allows to read a code with a fully-compatible interpreter, regardless the browser installed on the hardware. But when a webkit engine does not please you for the functions it supports (like WebGL, very partially supported), it looks a problem for me.
Does anybody have a confirmation of how it works ? If the engine is wrapped with the app, do you know if we can choose the one to be included, or configure it (like enabling WebGL ;) ) ? Another idea ?
Thanks,
Vincent.
Worklight applications do not bundle an interpreter. The application will use what that is bundled in the OS.
In other words, the default WebView in Worklight is the one that the OS provides, in the case of Android it uses the bundled WebKit.
This is not something Worklight controls what-so-ever.
You could, maybe, somehow, bundle in your app the Firefox engine libraries and hook it all up together, but the task to do so is incredibly large and complex in size... and not supported by IBM Worklight. Also, I do not know whether Cordova supports this as well ( it is used in Worklight to interface with native functionality).
As for the useragent, the string "Worklight" is attached to it as part of support for IBM WebSphere Portal.
I am a newbie in Blackberry Development and has got stuck on a very complex thing.
I have to make an application which should be support all O.S 6 and 0.S 7 based mobile phones.
Now I have different screen resolutions for different handsets in BB OS 6 and 7.
Now how can i manage my background images, and its button positions to be synced on all size of devices.
I have created an images for the screen size of 640x480 and according to it I have placed some button on x,y positions. now if i install the same app on a screen size of 480x360 how can i manage the x,y positions and manage the background size according to device width and height.
Can anybody help? I am complete newbie.
Use preprocessor, built-in to Eclipse JDE-plugin, or third-party preprocessor and BlackBerry Ant Tools
Compile separate applications for different RIM OS versions using the same source code files with preprocessor directives inside.
Technically an application compiled with RIM SDK 6.0 is compatible with device with RIM OS 7.0, but to provide the best user experience make separate applications for separate RIM OS versions.
On preprocessing include those image files which are suitable for building a particular application version. If you need to support many screen sizes, then add the biggest possible images to your project and then scale them down at the runtime. Scaling down almost does not affect image quality.
Upon ant build process employ Alx task to collect all information about separate application versions into one alx file.
As a result you will have one alx file (application descriptor file, it is an xml-file), and a set of folders with cod files inside.
When all cod files are signed, you can also do it upon ant build process distribute this alx file with all folders with cod files as one zip archive.
Customer unzips this archive, connects device via usb to the computer, launches BlackBerry Desktop Manager and selects this one alx file. Directives generated by alx task will guide BlackBerry Desktop Manager to install application suitable for the device RIM OS version.
If you want to distribute your application wirelessly, then employ jadtool task and make a php page that reads browser user agent and redirects browser to a relevant jad file.
Before using OTA (over the air) method for distributing your application, add the following MIME-type instructions to the .htaccess file of your web-server.
AddType text/vnd.sun.j2me.app-descriptor jad
AddType application/java-archive jar
AddType application/vnd.rim.cod cod
While the approach suggested does provide the best user experience, it is also the most complex to manage.
Personally I try very hard to make one executable and have it evaluate at run time what it needs to do based on the form factor of the device. This is actually easier than you might think, helped significantly by the fact that most screens about the same width. So you can do things like scale your assets to match a proportion of the screen width, based on the screen resolution, and they will look OK on most devices.
And while there are some nice things to be had by using stuff that is specific to say OS7, at this stage I think you should focus on the bread and butter stuff that you can do with OS 5. So, I would recommend you develop something for OS 5.0 - it will run on OS 6.0 and OS 7.0 devices. Create the UI generically to cope with various screen sizes. Later, if you need to get more sophisticated, you can use the tools that have been described.
You will find more on how I try to do things by looking at this.
http://supportforums.blackberry.com/t5/Java-Development/Tutorials-for-new-developers-Part-1/m-p/1621711#M194036
I would suggest you look at tutorial 10.
I also recommend a cruise around here:
http://developer.blackberry.com/java/
One final thing though, are you aware that Java phones are no longer being developed by BlackBerry? If you are just starting development, you might consider learning C++/Cascades and developing for the BB10 phones.
Story:
I have written a HTML Merge Compiler that can merge resource's/assets into one single HTML file (minify it to the max) and compiles Javascript with the google enclosure compiler. I have written this compiler to speed up loading and interpreting the code and to obfuscate the code to protect a little bit (script kiddie protection). Major reason was/is speed and to make it compact.
This is working OK with reliable results and i use this in PhoneGap applications/games. I have also written a javascript library that encapsulate all platforms that works with standard HTML/CSS without the need to change the code, it works also in the browser, with a touchscreen or without or on any device or operating system. Write once, publish many ;-). The idea around it is that is working always, always operate the same but can use device specific things when available but does never fail (when something is not there, for example a vibrate functionality).
Anyway, most frameworks (like PhoneGap) concentrate on Mobile Platforms but i want to port it also to desktop platforms like Windows, OSX and maybe Linux. For Windows I have wrote an Delphi Application that loads the HTML in a TEmbeddedWB object (is Internet Explorer actually) but the 'problem' is that it is only suitable to Windows and IE is not the fastest browser around, especially when it is embedded (do not why it is slower than the browser itself). For example, when i load the compiled code in Firefox and/or Google Chrome it is blazing fast (you do not notice it is javascript ;-)).
EDIT:
Pre release of IE10 for Windows 7 is just launched, installed it and lag is gone!
You can download it from here:
http://www.microsoft.com/en-us/download/details.aspx?id=35709
Introduction to my question:
I have tried XULRunner of Mozilla a long time ago but the first time was not a pleasure to me and also i tried it today again but can't get it to work. Get a parse error in the main xul file of the project, window is an undefined entity. ??? I create a sample project like: http://mdn.beonex.com/en/Getting_started_with_XULRunner.html
I do not know what to do about this error. Also i think documentation is not up-to-date? Most documentation is from around 2006.
The question, what i want to know:
Before i am going to waste my time (see also introduction), is it
possible to create frameless (full-screen) desktop executables with
use of XULRunner like with PhoneGap?
Is it possible to create cross-platform applications with XULRunner, i mean, does it really work seamless. Where can i find a ready-to-publish example of a XULRunner project and is it possible to load local HTML file(s) like in PhoneGap?
It is possible and allowed to access external resources?
Long story, but maybe there is somebody that have tried this before and can lead me to choose the right direction.
is it possible to create frameless (full-screen) desktop executables with use of XULRunner like with PhoneGap?
Yes. You use disablechrome attribute to remove the window frame and sizemode="maximized" to have it open full-screen. Alternatively you can use the full-screen API if you want your application to run in a normal window and only switch to full-screen mode on request.
Is it possible to create cross-platform applications with XULRunner
Yes. There are things like menus that work very differently on OS X but most of the time you don't need to care what operating system your application runs on (Windows, Linux and Mac OS X supported).
Where can i find a ready-to-publish example of a XULRunner project
See documentation for a XULRunner application example. For "ready-to-publish" you would need an installer which doesn't come with the platform.
is it possible to load local HTML file(s) like in PhoneGap?
Yes. The top-level window has to be XUL but you can use some very minimal code here - essentially a single <iframe flex="1"/> tag. You can load HTML pages into that frame then.
It is possible and allowed to access external resources?
Yes, XULRunner applications have full privileges and can access files on disk as well as web resources without any restrictions.
There seems to be a lot of confusion regarding deploying Adobe Air apps to ios after the restrictions were lifted. Before apple lifted the restrictions you had to go through the process documented here: http://blogs.adobe.com/cantrell/archives/2010/09/packager-for-iphone-refresher.html using the Packager for iPhone. But now that the restrictions have been lifted and the Air 2.7 update we can use the same ADT tool in the flex SDK that we use with all air applications.
My understanding is that the old Packager for iPhone (PFI) some how converted actionscript code into native objective C in order to be accepted by apple.
If that is correct does the restrictions being lifted mean that the ADT tool is not converting to objective C and is only bundling the AS3 .swf and air player together when creating the .ipa app file?
What exactly changed in the Air deployment process after apple lifted its restrictions?
If anyone could point me to some documentation on how the .ipa file is being created behind the scenes I think this would really clear some confusion.
Thanks for the help
Nothing really changed; apple just lifted the ban. The ban wasn't just on flash-created apps, it was on any tool that created any kind of intermediary language or used a virtual machine, etc. What the PFI does: it actually uses the LLVM compiler to statically compile actionscript 3 BYTECODE (not AS3 source) into native ARM assembly. So essentially when you're deploying an IPA it's the same idea as publishing a SWF to an exe (as in the publish settings) in the sense that both your SWF application and the flash virtual machine are bundled together, except instead of being an exe where the code inside is x86 ASM with AS3 bytecode executed along the VM, it's ARM. The PFI and all its classes were simply merged into the ADT tool. The PFI contained a LLVM dll which is accessed through various LLVM java classes that were added to the internal adobe version of the ASC or actionscript compiler. These LLVM classes and other associated classes, however, are not open source, which adobe is allowed to do, even though the ASC is open source because it's licensed under the MPL or mozilla public license, which permits the use of the open source code in proprietary closed source applications without sharing your changes.
For proof of all that I've told you, just download the new flex SDK that includes the ADT with the PFI merged in and you'll find the LLVM dll's etc. Further, you can decompile the ADT jar and see all the LLVM classes. The LLVM classes ( I believe ) intercept the ASC bytecode through the class GlobalOptimizer, or at least it did back in the day... they've probably changed that. The only other thing that has changed is that apparently Adobe has optimized the PFI (now merged into ADT) quite a lot. More info here:
http://blogs.adobe.com/cantrell/archives/2010/09/packager-for-iphone-refresher.html
http://www.leebrimelow.com/?p=2754
Update
Here is an official Adobe article confirming the things I've told you:
http://www.adobe.com/devnet/logged_in/abansod_iphone.html. I also should clarify that I've really over-simplified the process behind the scenes and appear to me mistaken in one of my points. I guess somehow the PFI actually merges the AS3 bytecode and the VM into a single seamless executable that doesn't use JIT compilation, and thus would technically not be a virtual machine? Not sure on that point, but the above article does seem to imply this:
"When you build your application for iOS, there is no interpreted code and no runtime in your final binary. Your application is truly a native iOS app."
I have a Flash application written in ActionScript 2 that I would like to port to the BlackBerry Playbook. The application is composed of an .swf file and a directory containing a large number of vector images. The path to these images (e.g. imagefolder/icons/icon1.swf) is hard-coded into an application and requires the image directory and the .swf file to be in the same directory.
I've installed the PlayBook SDK and have tried packaging the application with FlashBuilder 4, but I have no experience with this programme and have so far been unsuccessful. I tried placing the application in an SWFLoader component, but I then realised after reading this pdf document that MXML components are not supported. Since the app is written in AS2, I believe it cannot be compiled by Flash Builder. I don't need any any of the AIR features so I was wondering how could I embed the .swf and image directory in a Flash Builder ActionScript project so that it would run on the BlackBerry PlayBook.
The playbook uses AIR to play, so you need to be able to run it in AIR, which means that you need to have it working in as3. You could try "tricking it" by loading the AVM1 into AVM2.