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-6623781297f64583703608/] [crayon-6623781297f6b872741455/] [crayon-6623781297f6c783040554/] [crayon-6623781297f6d126932032/] [crayon-6623781297f6e899690713/] [crayon-6623781297f6f150531651/] 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-662378129888b424359850/] 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-662378129888f040294052/] [crayon-6623781298891890210935/] [crayon-6623781298892165516479/] [crayon-6623781298893880458975/] persistenceManager.setProperty("myStoredProperty","myStoredVal"); // setup custom property:myStoredProperty persistenceManager.getProperty("myStoredProperty"); // retrieve the value of custom property:myStoredProperty [crayon-6623781298894892509763/] [crayon-6623781298895021415488/] [crayon-6623781298896464462698/] [crayon-6623781298897148868036/] [crayon-6623781298898561316811/] [crayon-6623781298899565218779/] [crayon-662378129889a536474617/] [crayon-662378129889b733031508/] … [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-6623781298b4e532921332/] [crayon-6623781298b51636610312/] [crayon-6623781298b52787610284/] [crayon-6623781298b53399715321/] [crayon-6623781298b54474954451/] [crayon-6623781298b55143192535/] [crayon-6623781298b56826656545/] [crayon-6623781298b57168769068/] [crayon-6623781298b58701670323/] [crayon-6623781298b59536556177/] [crayon-6623781298b5a194094689/] [crayon-6623781298b5b829680268/] [crayon-6623781298b5c453349006/] [crayon-6623781298b5d373700142/] protected function getRadioValue():String { [crayon-6623781298b5e381045717/] return rbg.selectedValue.toString(); [crayon-6623781298b5f772601674/] } [crayon-6623781298b60705540324/] [crayon-6623781298b61038926983/] [crayon-6623781298b62087274787/] There are other things that you can do but it all depends on individual need.   [crayon-6623781298b63480997143/] [crayon-6623781298b67538698708/] [crayon-6623781298b68417656002/] [crayon-6623781298b69208573598/] … [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-6623781298e08402957894/] Now add a rectangle to the above code shown below [geshi lang="actionscript3" nums="1" highlight="7" ] [crayon-6623781298e0b354608638/] [crayon-6623781298e0c683543024/] Lets add a List Control to our little app now as shown below [geshi lang="actionscript3" nums="1" highlight="39" ] [crayon-6623781298e0e409082698/] [crayon-6623781298e0f125226329/] 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-6623781298e10811722967/] [crayon-6623781298e11221277132/] 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 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...]