Detect if Android or iOS within Flex Mobile application

Sometimes there is a need when you need to detect what environment your Flex mobile application is running. Common scenario with my projects is to launch a Link to PDF to a external browser rather than using StegeWebView which is built in to Flex SDK. There could be many other scenarios that I can think of but it depends on the Application writer why and when its required Here is the code snippet that will help ya out public function getOS():String { [crayon-5f0866067f225213245430/] [crayon-5f0866067f22e623573045/] [crayon-5f0866067f230771846521/] [crayon-5f0866067f231146309755/] [crayon-5f0866067f232608951507/] [crayon-5f0866067f233037861659/] If you would like to add anything to the above code please leave a comment.   Cheers   .   … [Read more...]

Changing default browser in Android Devices

I have tested this on Samsung Galaxy S but the instruction should apply to all other devices out there. Download the file below, Dont worry its not a virus :), the size of the file is 1 Byte. {filelink=3} or if you do not want to download the file below then follow the instructions below open notepad type "hello" save it as "default.html" somewhere on your computer where you can remember the path. Now transfer the above file that you created or the downloaded one to your Android phone or tablet. Remember which folder you copied it to. Now Follow the instructions below Open File Manager App in your Android phone Navigate to the folder to which you have copied above file to Now Click on default.html file. you will be asked what application you would like to use to open the above file. Choose the already installed new browser and remember to check "Set as default" checkbox Groovy you are good to go. Default browser changed :). You can do this to many supported file extensions. Hope this helps Cheers … [Read more...]

Android How to Open Pdf file within the browser

So today was the day I found out how :) with lot of google and bing surfing. Its only a workaround not a actual fix according to me but is good enough for till the actual support comes up. wont take too much space to explain but let me tell you one thing. At this moment even with Android 3.2 the default browser do not have in built support for opening PDF files within the browser. Consider you are a student studying full time and have all your lectures delivered to you in PDFs. What now? Oh yeah! download them all and read them one by one. That works but over the time your PDF files accumulate and after some time it become impossible to look to certain PDF for THAT content. This sort of functionality should be default as it is with Safari browser on iOS devices Lets see a work around that I found Follow these steps Download Dolphin Browser from the Market Install it. Now Download PDF reader plugin for Dolphin Install it There you are, good to go Direct your browser to an HTML page with a PDF link. Click on the PDF link now, the file should in the same browser instance. Catch here is that Pdf plugin for Dolphin browser use Google Docs to read and open the PDF files. Smart! I've tested it on my Samsung Galaxy Tab and Samsun Galaxy phone II. This technique should work across all other Android enable phones aswell if you set if up properly. I hope this helps guys! Cheers … [Read more...]

Flash Builder java NullPointerException when debugging

Well I like working Flash Builder as an IDE but there are some times when it gives weird things. This happened to me last week so I thought I should share. Now it gets frustrating when I try to debug my in development App and It always gives me NullPointerException In my case it turned out to be  XML service for my website feed that i created to display news on the App I am developing. After I removed the service the debugging started as per normal. Now I am not sure why would this be the case and why FB fail to register XML service in debug mode. I guess I may be doing something really wrong somehow and somewhere I am running Flash Builder for PHP 4.5.1. Another thing i observe sometimes is that the service you create (PHP) becomes corrupted altogether, no matter what you do, you'll have to remove that service and re-add it to make things work. But sometime even deleting the service won't work. I'll discuss in my next post about how to go about removing the service if your IDE doesn't help. Leave a comment if You'ld like to add something to my experience. Cheers   . … [Read more...]

How do you persist data between Flex Mobile Views

Well simple answer to this is that you got few ways to do this. lets see a few of them to start with in you main application tag add persistNavigatorState="true"  so that it looks like below code snippet. When persistNavigatorState is set to true, your application will save the state of your Views and data to a Local Shared Object which by no means is encrypted. You have to write your own custom persistentManager by implementing IPersistenceManager interface. [crayon-5f086606811de572184816/] this tell the mobile environment to start persisting View data. but remember that once you pop out of view that View is destroyed completely. but the Views that are the the stack should be set destructionPolicy to never so that you View element looks like this [crayon-5f086606811e5949731766/] [crayon-5f086606811e7073558610/] [crayon-5f086606811e8905276179/] [crayon-5f086606811e9255003888/] persistenceManager.setProperty("myStoredProperty","myStoredVal"); // setup custom property:myStoredProperty persistenceManager.getProperty("myStoredProperty"); // retrieve the value of custom property:myStoredProperty [crayon-5f086606811ea577283999/] [crayon-5f086606811eb415928620/] [crayon-5f086606811ec956231927/] [crayon-5f086606811ed459245949/] [crayon-5f086606811ee783942906/] [crayon-5f086606811ef609440402/] [crayon-5f086606811f0334919818/] [crayon-5f086606811f7913745267/] … [Read more...]

How to: Flex Mobile Grouping radio buttons and getting the value of selected one

Question: How to Group Radio Buttons in Flex Mobile app and get value for the selected One? When I was messing around with my first mobile app I was lost when working with Radio buttons. I asked above question to myself. so lets find out how this is done. First create radio buttons for you app. put them where ever you like inside the view tag [crayon-5f08660681d71812289648/] [crayon-5f08660681d7a908555034/] [crayon-5f08660681d7c888647519/] [crayon-5f08660681d7d312473719/] [crayon-5f08660681d7f639804691/] [crayon-5f08660681d80422152254/] [crayon-5f08660681d81001922265/] [crayon-5f08660681d83635958225/] [crayon-5f08660681d84664825981/] [crayon-5f08660681d85767072597/] [crayon-5f08660681d86111601768/] [crayon-5f08660681d88517395016/] [crayon-5f08660681d89975408507/] [crayon-5f08660681d8a852491762/] protected function getRadioValue():String { [crayon-5f08660681d8b450509267/] return rbg.selectedValue.toString(); [crayon-5f08660681d8c226204688/] } [crayon-5f08660681d8d464818727/] [crayon-5f08660681d8e328042391/] [crayon-5f08660681d8f554065227/] There are other things that you can do but it all depends on individual need.   [crayon-5f08660681d90734891762/] [crayon-5f08660681d91954296286/] [crayon-5f08660681d98483996028/] [crayon-5f08660681d99546201074/] … [Read more...]

Rounded Corners For Flex Mobile Application’s List/ListForm

This technique is applicable to probably any component that is on the Mobile phones screen inside a group. Lets take a look how to do this I am using Flash Builder 4.5.1 for this exercise. First create a project called roundedcorners, In your Mobile settings check either Android, Apple iOS or BlackBerry > Select View Based application > Click Finish In the roundedcornersHomeView.mxml file you will see code similar to this [geshi lang="actionscript3" nums="1" ] [crayon-5f08660682383831277766/] Now add a rectangle to the above code shown below [geshi lang="actionscript3" nums="1" highlight="7" ] [crayon-5f0866068238a226697636/] [crayon-5f0866068238c459631642/] Lets add a List Control to our little app now as shown below [geshi lang="actionscript3" nums="1" highlight="39" ] [crayon-5f0866068238d634001315/] [crayon-5f0866068238f809765152/] Above code just had one problem with padding and margins, when you scroll your list the the List item are visible in the Gap between ActionBar and Rect border. To fix that try these margin and padding settings [crayon-5f08660682390183317254/] [crayon-5f08660682391425302958/] Run this application now and you will get lovely rounded corners for your Mobile View. Adjust padding as per liking.     This final result is shown below Hope this helps Download project files by clicking this link roundedcorners Flash Builder project … [Read more...]

AIR for Apple iOS Support in Flash Builder is not installed

I recently came across this error when starting a project in Adobe Flash Builder 4.5. This error is mainly due to the either if iOS support was not installed with your Flash builder or you are using a incompatible Fled sdk, AIR version with Flash builder. e.g. Flex SDK 4.6 is incompatible with Flash builder 4.5.x. As mentioned somewhere on Adobe's website that iOS support will be introduced soon i.e. with Flex SDK 4.5 onwards and they did that. I was so excited to start off my new project but when I tried to run/debug my application choosing iOS environment i got this error AIR for Apple iOS Support in Flash Builder is not installed Now where to go from here? I searched google for it and find out an article on Adobe KB These are the steps that you follow as per this article Install the components required to enable AIR for Apple iOS Support manually Download the Adobe AIR SDK from www.adobe.com/products/air/sdk/. From the downloaded AIR SDK, copy the folders \lib\aot\lib\gcc, \lib\aot\bin\as, and\lib\aot\bin\strip to the equivalent folders within the Flex SDK directory as follows: Copy from AIR SDK directory  To Flex SDK directory* \lib\aot\lib\gcc Adobe Flash Builder 4.5 Installation\sdks\4.5.0\lib\aot\lib \lib\aot\bin\as Adobe Flash Builder 4.5 Installation\sdks\4.5.0\lib\aot\bin \lib\aot\bin\strip Adobe Flash Builder 4.5 Installation\sdks\4.5.0\lib\aot\bin *Note: If you have installed the Flash Builder 4.5.1 update, copy the files to the Flex 4.5.1 SDK directory. From the downloaded AIR SDK, copy the folders \lib\aot\lib\gcc, \lib\aot\bin\as, and \lib\aot\bin\strip to the equivalent folders within the Utilities directory as follows: Copy from AIR SDK directory  To Utilities directory* \lib\aot\lib\gcc Adobe Flash Builder 4.5 Installation\utilities\ipa_packager\lib\aot\lib \lib\aot\bin\as Adobe Flash Builder 4.5 … [Read more...]