Flash Differences Between Adobe AIR And Internet Explorer - actionscript-3

We have developed an application front end in Flash. Now we are allowing access either from a browser or an Adobe AIR application. We point to the URL of our web server and download swf components and data via a NetConnection. We are seeing differences in the communication behavior of our web application with the Adobe AIR container verses Internet Explorer. There are some communication drops between the Adobe AIR container in our requests back to the web server for requests that take a longer time. Internet Explorer seems to be much more tolerant and handles much better.
It is not an issue simply with the connection reliability because the same behaviors can be observed by setting and holding a breakpoint on the requests for data from the web server.
So, same code but different behaviors when flash runs in Adobe Air. We have made sure both are using the same version of the flash dll.
As I missing some configuration of the Adobe AIR container that changes default behaviors?

You can take it as a given that AIR runtime and Flash Plugin are independent, do not run anything shared, and so on. Moreover, Flash ActiveX component and Flash Plugin for Mozilla FireFox and Flash Plugin for Chrome are different builds. Furthermore, you cannot be sure about configuration on a random client PC.
I advise you to stop using NetConnection (which is intended for message interchange and streaming video/audio) and load everything via standard Loader and URLLoader classes. Even if your server breaks connections now and then, it's easy to wrap those classes with failsafe retry functionality.

Related

Webkit support for local storage on Samsung TV browser

I'm porting a HTML-based app to a Samsung smart TV. The app uses local storage to keep preferences, etc.. Local storage appears to be supported and data is persistent while the browser is open. But, once the browser is exited ... poof! the data is gone. Other data like sessions and cookies do persist.
I use the Lawnchair library in the app and have also tested using jStorage. Neither persist beyond closing of the browser.
The browser (or browser component) on the TV is webkit build 534.7. From playing with the browser, I suspect it is actually written in Adobe Air.
I have also tested the Air browser component on my PC, which is build 533.19.4 of webkit. This doesn't appear to support local storage at all.
Chrome on my PC, build 535.19 of webkit, works fine in all my tests.
So, where does the blame lie here: is it the webkit build, the implementation of webkit in Adobe Air, or the TV? Can anyone offer a fix or a suggestion for work around?
Thanks.
Unfortunately I don't have 2012 model so I can't check if the HTML5 localStorage is working or not.
But I have workaround for you which will be backward compatible with previous TV sets' models also, as 2010 and 2011 models use Maple browser:
http://www.samsungdforum.com/Guide/View/Developer_Documentation/Samsung_SmartTV_Developer_Documentation_3.1/API_Reference/JavaScript_APIs/File_API
Serialize your data object
Save it using File API to application directory
And every time you open the app open this file and unserialize data.
This will work for sure!
1- you an use file api
2- you can set a cookie
I was once trying to save preferences of my app and using cookies seemed easier.
I don't know much about html5 but in TV's you should check which features allowed. Most of the smart tv's are giving partial support to html5.

Flash Builder: Mobile AS3 Project or Mobile Flex Project?

This month I started to play with Flash Builder because I don't have a mac to create native iPhone apps.
I have made a Flex Mobile Project and an AS3 Mobile project. Both do mostly exact the same and I see great differences in operation speed (AS3 version is much faster). Also the size of the AS3 version is less than the size of the Flex version when I deploy the project.
But one thing disappoints me, the size of a deployed AS3 app (Android) is still about 8MB. I think that is quite huge for a simple app, or is it normal? I did not test the iOS version because I am not an Apple Developer member (is there a trick to deploy an iOS app with fake certificates)?
Resources I have used in the apps:
Two images approx. 35kb in size
A StageWebView
I want to know:
What is the average size of a simple app when it is a native app (apk file)?
What is the difference between an AS3 app and a Flex app except the libraries that re used?
Is the AS3 app converted to C or another language?
Why is the apk so huge (IMO)?
Is there a trick to deploy an iOS app with fake certificates? (just for testing)
Thanks for the answer(s).
What is the average size of a simple app when it is native app (apk file)?
I have no idea. When you were comparing sizes; did you export a release build or a debug version? The full version of my app; using Captive Runtime is 12MB. That includes all the embedded images. I thought that roughly 8MB is the size of the embedded runtime. Of course, if you don't use Captive Runtime then the app will be smaller; but it will have a depency on the user having the runtime installed.
What is the difference between an AS3 app and a Flex app except the libraries that are used?
For all intents and purposes nothing. The Flex Framework will need to execute code to setup the framework and such. In theory this 'impact' is offset by the value that the framework brings.
- Is the AS3 app converted to C or other language?
Not for Android or Playbook. It relies on the Mobile AIR Runtime--which I assume is written as a native app somehow. For iOS there is a more in depth conversion taking place; but no on knows the exact magic sauce; but it the process is much more intensive than Android or Playbook and people believe that your code and the AIR Runtime is converted to Objective C somehow in a way that is not in violation of the Apple licensing agreement.
Why is the apk so huge (IMO)?
Huge is open to interpretation. Without seeing your full app code; it's tough to judge.
Is there a trick to deploy an iOS app with fake certificates? (just for testing)
I don't think so; although there may be possibilities on unlocked devices.
You would like to use Mobile AS3 Project if you want you apps to be smaller and your GUI mainly contains vector graphics and Mobile Flex Project if you prefer to use standart GUI Controls that comes together with Flex framework but adds overhead in size because of controls that come with it.
As of the other questions:
the size of the apps is different on mobile platforms. Typical iOS app is about 2MB - 20MB. It really depends on resources you store with your app. What might be important to you is not to overcome 20MB if not needed because 20MB+ apps require Wi-Fi connection to be downloaded.
(However you should export release build version only as mentioned by www.Flextras.com)
there is no fundamental difference between AS3 and Flex apps - they both compile to the same instructions that executes on targeted mobile platform.
as far as I know (being iOS developer myself) there is no workaround to deploy an iOS apps. You need to use Mac and become Apple Developer to deploy with valid certificate.
to make your app smaller try to pai special attention to the resources you add to the project. Although I believe the size is so big because of framework itself, you would like to use more vector graphics vs. bitmaps when compiling apps with Flash/Flex.
When you export for Android you have an option of embedding the air framework in the application, that way your users don't have to download air. you can export your application without air embed which will result in a much lighter application, however your users will need to download air runtime. http://cookbooks.adobe.com/post_How_do_I_create_an_AIR_application_for_Android_tha-19299.html

Get a stream from client microphone via web browser?

I want to implement something like voip communication that client doesn't need to install additional application, they just open the webpage and talk to a server. Is there anyway to access the audio stream from client microphone via web browser ? I don't want additional plugin like applet that user have to install.
I think flash can do this, but is there anyway else ?
Thank you,
Voteforpedro
Your four main options are:
Flash
Silverlight
ActiveX
Unsecure browser settings (e.g. javascript calling EXEs)
All of the above will be subject to various security limitations or require some acceptance by the end-user. I'm not even certain that the browser calling out to EXEs is even possible any more so it should be avoided at all costs.
Installing an ActiveX control will limit you to IE on Windows, so should probably be avoided. The user would have to agree to installing the ActiveX anyway.
Both Flash and Silverlight are cross-platform (Flash more so than Silverlight) but also require the user to agree to access to the Microphone/Webcam - this is done by the framework, not something you can control/influence. Obviously, if the user does not have Flash or Silverlight installed, you'd need to prompt the user that they need to install it!
As stated by #Oded, there are serious security and privacy issues related to microphone's and webcams, so do not expect future browsers to make this easier for you (e.g. the new family of HTML5 browsers).
There is no standard, I think flash is your best bet.
AS 3.0 Accessing a microphone.
There is no standard that gives you access to the client machine microphone.
I can imagine there are security implication to giving a browser such access, so don't expect to see anything soon, not without some sort of plug-in.
Chrome 11+ supports access to the microphone. Visit this page (with Google Chrome) and click on "Speech" and try it out. This is using Sencha Ext/Touch which is an open library. This specific addon to Sencha Touch is also open source and released here.
Edit: To clarify, this is JavaScript only. The user doesn't need to approve anything. But, it only works in Chrome and it uses Google voice recognition.
Good luck!

Trying to understand Adobe AIR and full screen mode

This adobe's page says that:
In Flash Player, full-screen mode can
only be initiated through ActionScript
in response to a mouse click
(including right-click) or keypress.
AIR content running in the application
security sandbox does not require that
full-screen mode be entered in
response to a user gesture.
I thought Adobe AIR was a development tool. But this text above is making look like it is either a player, as it is comparing it to the Flash Player.
So, is AIR both development tool and a player?
AIR is not a development tool but rather an application runtime that allows Flex/ActionScript apps to run as a desktop application instead of within a browser window. One advantage of compiling your app as an AIR app is that it is not limited by the security sandbox that comes with running code within a browser. This means you can read/write files, go into fullscreen mode without constraints, etc. On the downside it requires the user to install your application (as well as the AIR runtime, if not already installed) rather than simply accessing your app via a webpage. Hope that helps clarify things for you.

What are the things need to taken care while working with flash playeres?

I have been working since a long time on a particular flash(Action Script 3.0) project and did all the test and development under the Flash itself(tested by Ctrl+Enter) . But It should be compatible with the browser, so i exported all these to my localhost, and its working fine.
But unexpectedly I got many more errors from swf player. I don't know why flash player on the browser behaves like this. All functions are working fine in Flash but when I export to swf its not working correctly...
The browser in the authoring environment is much more lenient with it's sandbox, you're likely running into security issues.