AIR detection from HTML

Hi,
I want to find if my html page is opened in browser or is
loaded in AIR through HTMLLoader. I need to ensure my event
handlers (e.g onclick) work and in browser I am setting them up
through innerHTML and in AIR like:
element.onclick = onclick_handler_function;
Currently I am using the following method:
var browser = navigator.userAgent;
browser = browser.toLowerCase();
if(browser.indexOf('adobeair') > -1)
//page is rendered in AIR, setup event handlers accordingly
If anyone knows any better method of detecting AIR, please
let me know.
Also I dont want to include "AIRAliases.js" in the html page
as the page is rendered using HTMLLoader and does not use any AIR
apis.
Thanks for any help.

www.extjs.com has a method ext.isAir you could have a look in
the source what that method does

Similar Messages

  • Using Dreamweaver to create AIR app from HTML site, FLV loaded by placed SWF not loading

    Hello.
    I'm using Dreamweaver to create an HTML-based site that has pages with FLV-based videos that are loaded using a SWF file. The SWF file is just the player / skin. When I preview or publish to AIR, the videos do not show up. I'm sure others have asked how to accomplish this but I'm having difficulty finding the solution to this issue. Can someone share with them their solution please?
    Thank you!
    Robert

    Steveejay, I was having the same problem. It turns out that
    mine didn't like the fact that I was using the "POST" method in my
    loadMovie() call. I changed them to "GET", and it works fine in the
    web page now. Just doesn't work when previewing in Flash.

  • I need to remove "air." from package name. I'm get a Layout xml error when repackaging android app..

    So, i'm doing this on my own app. I made an update for an older app that was build using Native Android. But this time, i used Adobe AIR... The catch is Adobe likes to append a "air." to the front of your package name without asking you. So basically I can't upload my update because it has a new package name is now "air.com.mycompany.myapp" rather than the original "com.mycompany.myapp"
    Basically I'm going through this guide..
    http://helpx.adobe.com/air/kb/opt-out-air-application-analytics.html
    I followed all the steps, made all the adjustments to the androidmanifest.xml like it asks.
    But after going along with the above guide, with no issues when i get to the step that says
    "Run the following command to create the resource file for the updated AndroidManifest.xml:"
    I run this..
        "/Users/brybam/Documents/eclipse/android-sdk-mac_x86/platform-tools/aapt" package -f -M AndroidManifest.xml -F resources.arsc -I "/Users/brybam/Documents/eclipse/android-sdk-mac_x86/platforms/android-8/android.jar" -S ./res
    But I keep getting the same error regarding the xml files in res/layout
        ./res/layout/expandable_chooser_row.xml:1: error: Error parsing XML: not well-formed (invalid token)
        ./res/layout/expandable_multiple_chooser_row.xml:1: error: Error parsing XML: not well-formed (invalid token)
        ./res/layout/main.xml:1: error: Error parsing XML: not well-formed (invalid token)
        ./res/layout/multiple_file_selection_panel.xml:1: error: Error parsing XML: not well-formed (invalid token)
        ./res/layout/ssl_certificate_warning.xml:1: error: Error parsing XML: not well-formed (invalid token)
    The guide doesn't say anything about these xml files, and im not sure what to do with these or how to handle them.
    If i go into the res/layout folder, and just delete these (i know they're necessary. But i just deleted them as a test, to get through the rest of the guide...)
    I was able to get through the rest of the steps in the guide fine, make an apk, and put it on my phone...only to find out the app will crash the moment you try to run it. Probably because i deleted the layout xml files...But i cant get the command i need to run above to accept them!
    So, earlier in the guide they have me use thing thing called the "AXMLPrinter2.jar" to make the AndroidManifest.xml readable so i can edit it.
    I run something like this:
        java -jar "/Users/brybam/Desktop/repackage/AXMLPrinter2.jar" AndroidManifest.xml > AndroidManifest.xml.bk
    This makes a new file "AndroidManifest.xml.bk" and i can edit that.
    So, I was thinking with all of these layout xml files, maybe I could run this "AXMLPrinter2.jar" on them and then edit them. Because right now if you open them they're not human readable, and its hard for me to work on them if they're not...
    I tried this thinking i could do the same thing...
        java -jar "/Users/brybam/Desktop/repackage/AXMLPrinter2.jar" main.xml > main.xml.bk
    Just get a blank file and a console erorr when trying to use the AXMLPrinter2.jar on the layout xml files...
        java.lang.ArrayIndexOutOfBoundsException: 67
                  at android.content.res.StringBlock.getShort(StringBlock.java:231)
                  at android.content.res.StringBlock.getString(StringBlock.java:91)
                  at android.content.res.AXmlResourceParser.getName(AXmlResourceParser.java:140)
                  at test.AXMLPrinter.main(AXMLPrinter.java:56)
    So, I think my whole issue is based around these XML files not being converted to human readable before i try and re-package....
    EDIT:::
    Ok, so I found a site that talks about the error I'm getting but it's in chinese, and even after translating the page...I'm still not well versed with terminal and this stuff to get it.
    It reads:
    "Error.
    Final conclusion:
    In minSdkVersion <= 7, AXMLPrinter2.jar can normally decompile xml file
    Greater than 7 can not be normal decompile xml file (AndroidManifest.xml except)
    Give way to share a batch decompile xml file:
    First, create a *. Txt file
    Stresses inside the content authoring
    for / r layout%% a in (*. xml) do @ java-jar AXMLPrinter2.jar "%% a" >> "%% a". txt
    Then this txt file extension into bat form, and this BAT the file and AXMLPrinter2.jar on the same directory will be decompiled xml into the layout directory
    Decompilation results can be generated by executing the bat file multiple xml files."
    - http://hi.baidu.com/ghcghc/item/ecbaa1ce997cb225a0b50ac2
    Maybe someone with more know-how could explain what they're explaining? I get that he's saying the issue im seeing appears when you're using minSdK <=7 but I need to use minSdk 8. Does anyone understand this work around? And how I might go about it on a Mac with terminal?
    I wish adobe would make it easy to remove the "air." from the package name. If they want to convert old Native devs to AIR devs...the transition needs to be seamless. But now I'm about to have to go back to Native because I can't update an app I already have out on the market with an air app.

    Hello~
         I also tried to remove "air." package name in air application. And i encounter the same problem.
         I do not find any solution to decode the xml inside res folder by AXMLPrinter2.jar. And those xml inside is compressed which is unreadable.
         However, what you can do is copying the structure of res folder. And go to your air sdk file path -  adobeair-sdk-folder/lib/android/lib/resources/
         Replace those file exists in your res folder. And copy "values" folder to your res folder.
         Hope this solve your problem~

  • Installing and Running Air application from webpage

    Hello ,
    I am trying to run the air application from web page and its working fine in my system. (http://localhost:8080/examples/test1.html)
    if i try to run the same air application from another system's webpage by pointing the url to my system's IP Address,(http://lpAdres of my system:8080/examples/test1.html) its showing error "The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the application author"
    Air Application version are . Flex3.6 sdk and Air2.7 sdk & runtime
    Any of you know what could be the problem.
    please help em to resolve this issue asap.
    its very urgent requirement

    Hi, Jeff;
    Make sure you have compiled your application as 32 bit, and not "any cpu".
    See this document for some more info: [64|http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/10d5fa88-2013-2c10-c9a5-f11963607d4e&overridelayout=true]
    Regards,
    Jonathan
    Follow us on Twitter u2013 http://twitter.com/SAPCRNetSup

  • How can I compile an AIR app from the Flex-OEM Compiler?

    Hi all.
    As i've read in http://livedocs.adobe.com/flex/3/html/help.html?content=CommandLineTools_1.html, you should run amxmlc or pass +configname=air param to mxmlc in order to compile an air application. Is there a way to do this with the OEM Compiler?
    Thanks

    I ran across this article, however it's for an earlier version of AIR. A version that used publisherID, however that is not required in the new air versions.
    http://blog.everythingflex.com/2009/06/08/open-an-air-application-from-a-2nd-air-applicati on/
    I tried creating this app without the pub id, didn't seem to work. I've got to get a certificate and get the pub id from that.

  • Firefox 11 will not install air or start air application from the badge install

    Seems to work in Chrome, but I need this to work from within firefox...11 is the default for the windows platform we must use.
    Running window 7 64-bit for development, and the air app is html javascript (J Query) created in dreamweaver 5.5
    any help...thanks

    Strange - You can't even install it directly on the phone from the App Store. Have a look [http://support.apple.com/kb/TS1702 this Apple troubleshooting article]. Beyond that, Apple would probably be better equipped to help you.
    Let us know if you have any new information.

  • Problem starting AIR app from windows server 2003

    Hello,
    I have an AIR app that I am trying to run using a c#
    webservice under Win 2003.
    I am starting the application process (air .exe file) as the
    "Network Service" user which has full-rights on the app-folder and
    app-working folder. The problem is that once with the applications
    the "Adobe AIR Updater.exe" process is starting to (using the same
    user N.S.) and both of the processes stop responding.
    I have tried to start the process as "Local Service" with
    "Desktop Interaction" too but unfortunately with no result.
    I must tell you that under XP and Vista it runs perfect...
    Is there any security issue related to win 2003 or any way i
    can start an air app from command line.
    Also i am interested why "Adobe Air Updater.exe" is starting
    ?

    Not sure about  copying eulaAccepted file from one location to another - that would really depend on which user account your service is running under.
    A better approach (IMHO), is to open the services window (My Computer | <right-click> | Manage, then navigate to Services and expand the tree) so you can see your service on the RHS.
    Stop your service, then inspect it's properties, select the 'Log on' tab, then check the checkbox which says "Allow system to interact with desktop". Apply the change, then restart your service.
    next time the AIR runtime prompts you to accept the EULA, the window will appear on the screen, so you can click "I accept".
    After accepting, reverse the procedure which allowed the service to interact with the desktop, and make sure that you have modified the registry to prevent AIR from updating as mentioned in:
    http://help.adobe.com/en_US/AIR/1.5/air_admin/WS5b3ccc516d4fbf351e63e3 d11c0f59823a-7ff0.html
    You should be all set.

  • Conversion of an AIR-AP1120B from autonomous to LAP

    Does anyone know if it's possible to convert the AIR-AP1120B from autonomous to LAP?

    Hi Federico,
    Sadly, the 1120 with "B" Radio is not supported :(
    Support for the 1121 was added in WLC version 4.0.155.0 Have a look at these related docs;
    Software release 4.0.155.0 New Features
    LWAPP for Cisco Aironet 1100 Series Access Points (802.11g radio only) Allows the Cisco Aironet 1100 Series Access Point to be upgraded from autonomous access point mode to lightweight mode using the autonomous to lightweight mode upgrade tool.
    Note You must install software release 4.0.155.0 on the controller before connecting 1100 series access points to the controller.
    http://www.cisco.com/en/US/products/ps6366/prod_release_note09186a00806e8989.html#wp147320
    LWAPP Upgrade Tool Troubleshoot Tips
    http://www.cisco.com/en/US/tech/tk722/tk809/technologies_tech_note09186a008072d9a1.shtml
    Access points must run Cisco IOS Release 12.3(7)JA or later before you use the upgrade tool.
    System Requirements
    You can use the Autonomous to Lightweight Mode upgrade tool to install Cisco IOS Release 12.3(11)JX on these access points:
    **All 1100 series access points containing MP21G (802.11g) radios
    All 1130, 1230, and 1240 series access points
    All modular 1200 series access points running Cisco IOS software and containing these supported radios:
    802.11g: MP21G, MP31G
    802.11a: AIR-RM21A-x-K9, AIR-RM22A-x-K9
    All 1300 series access points in access point mode
    http://www.cisco.com/en/US/docs/wireless/access_point/ios/release/notes/b311jx1.html
    Cisco has released a free tool called the "Autonomous to Lightweight Mode Upgrade Tool" that allows selected Cisco Aironet autonomous access point models to be configured for lightweight mode operation.
    The Autonomous to Lightweight Mode Upgrade Tool supports the following models:
    Cisco Aironet 1240AG Series access points
    Cisco Aironet 1230AG Series access points
    Cisco Aironet 1200 Series access points that contain 802.11g (AIR-MP21G-x-K9) and/or second-generation 802.11a radios (AIR-RM21A-x-K9 or AIR-RM22A-x-K9)
    Cisco Aironet 1130AG Series access points
    **Cisco Aironet 1100 Series Access Points that contain 802.11g radios (AIR-AP1121G-x-K9)
    Cisco Aironet 1300 Series Access Points/Bridges (AIR-BR1310G-x-K9 or AIR-BR1310G-x-K9-R). A Cisco Aironet 1300 Series operating in Lightweight Access Point Protocol (LWAPP) mode only operates as an access point. This series does not support LWAPP bridging mode.
    The Autonomous to Lightweight Mode Upgrade Tool supports a process to migrate an autonomous access point from autonomous mode to lightweight mode. Unlike a VxWorks to Cisco IOS Software upgrade, this process is a Cisco IOS Software upgrade to the existing Cisco IOS Software image-not an operating system "swapout". In converted access points operating in lightweight mode, Cisco IOS Software continues to run on the access point, while LWAPP is used to communicate with a wireless LAN controller. Since LWAPP supports automatic access point configuration, there is no need to retain or convert the original autonomous Cisco IOS Software access point configuration.
    http://www.cisco.com/en/US/netsol/ns340/ns394/ns348/ns337/networking_solutions_white_paper0900aecd804f1a23.shtml
    Cisco Aironet Access Point Support for Lightweight Access Point Protocol
    http://www.cisco.com/en/US/products/ps6521/prod_bulletin0900aecd80321a2c.html
    Hope this helps!
    Rob

  • Default browser window from HTML

    I am just building a simple HTML app and want to open a new window to an existing web page from the air app that opens in a default browser window rather than spawining a new air window.
    I have been banging my apparently limited-capacity head against a wall for 8 hours now with no luck.
    Can anyone tell me how to get this done? I am guessing it's as simple as adding a piece of code to my app xml file and a corresponding piece of code to my HTML page where I have the link?
    Any help will be sincerely appreciated.
    Bill

    I have a similar problem:
    I have built a web app for the iPhone which works splendidly in AIR, except that it's links to external sites will not open in the default browser.
    Currently I have one HTML file in the AIR app: redirect.html which simply redirects to my web app.
    If I set <script>window.htmlLoader.navigateInSystemBrowser = true;</script> the redirect to my web app opens in Firefox instead of AIR. If I set that on the home page (and all subpages) of my web app it's as if nothing was ever set.
    I am new to AIR so I am making these assumptions:
    window.htmlLoader.navigateInSystemBrowser = true; must be set on the first page loaded by the AIR app.
    server-hosted pages cannot open anything in the default browser.
    Is there are a way to set it up so my AIR version of the web app can simply mirror locally the code from my server, thus allowing me to access the default browser? I have tried an iframe which actually just caused the web app to load in Firefox like the redirect.
    Any advice would be helpful.
    Thanks.

  • ExtendedScript from html page

    Hello,
    can i make script in the extendedScript toolkit(this script place document to indesign application) and run this script from html page?
    or is there integration between extendedscript and html?
    thanks

    HTML pages are usually displayed in web browsers, whose security model is designed specifically against any access to local resources, especially such calls to local applications.
    Besides to browsers, on the Mac, the "Dashboard" allows you to write little applications "widgets" exactly the way you're suggesting. It uses WebKit to display HTML.
    http://www.apple.com/downloads/dashboard/
    In order to communicate with extendscript, you'd have to go through the operating system's command line.
    http://developer.apple.com/documentation/AppleApplications/Conceptual/Dashboard_ProgTopics /Articles/CommandLine.html
    From there you'd invoke the scripting system with "OSAScript"
    http://developer.apple.com/documentation/Darwin/Reference/Manpages/man1/osascript.1.html
    then pass on your extendscript and arguments into InDesign via doScript.
    Another alternative to the main HTML browser is AIR, which also has an instance of WebKit for HTML display.
    http://livedocs.adobe.com/labs/air/1/quickstartshtml/
    Apparently it is possible to invoke BridgeTalk - the Creative Suite's inter application communication used by extendscript - straight from AIR. I don't yet have references how to do that, found the link below just yesterday.
    http://www.inthemod.com/bps/?p=165
    Dirk

  • How to Autorun an Adobe AIR App from CD

    Does anyone know how to auto-run and Adobe AIR application, or auto-install the Adobe AIR runtime (if it's not installed yet on the user's machine) and then the Adobe AIR application from a CD or DVD?
    How is it done?
    Thanks in advance for any inputs on this.

    You can apply for permission to redistribute the AIR runtime:
    http://www.adobe.com/products/air/runtime_distribution1.html
    Mike Chambers wrote a good article about this:
    http://www.mikechambers.com/blog/2008/04/07/redistributing-the-adobe-air-runtime-installer /

  • Why doesn't my macbook air detect my new iphone 5S?

    why doesn't my macbook air detect my new iphone 5S?

    The warranty entitles you to complimentary phone support for the first 90 days of ownership.
    If you bought the product in the U.S. directly from Apple (not from a reseller), you have 14 days from the date of delivery in which to exchange or return it for a refund. In other countries, the return policy may be different. If you bought from a reseller, its return policy applies.

  • Launching another iOS AIR app from iOS AIR App

    Hi
    Ideally we would like to be able to launch another AIR iOS from our AIR iOS.  Is it possible to do this with AIR?  I understand you can do it natively.  We would also need to pass a few parameters: such as authentication ID and a URL.
    Potentially we need to be able to do this in Android too.
    Thanks
    Ben

    Yes. you can have following chunk in your infoAdditions
    <key>CFBundleURLTypes</key>
       <array>
        <dict>
         <key>CFBundleURLSchemes</key>
         <array>
          <string>appA</string>
         </array>
        </dict>
       </array>
    then from another AIR iOS application you can call navigateToURL("appA://thisDataWillBeReceivedByAppA")
    I have written an Article which lets AIR iOS applications implement Facebook Single Sign-On It uses the same techniques. You can follow http://www.saumitrabhave.com/2011/10/facebook-single-sign-on-for-air-ios.html for more details.
    Thanks,
    Saumitra

  • How to get the values from html:select? tag..?

    i tried with this, but its not working...
    <html:select styleClass="text" name="querydefs" property="shortcut"
                 onchange="retrieveOptions()" styleId="firstBox" indexed="true">
    <html:options collection="advanced.choices" property="shortcut" labelProperty="label" />
    </html:select>
                        <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>

    <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>This java script is not working at all..its not printing anything in document.write();
    This is code..
    <td class="rowcolor1" width="20%">
    <html:select styleClass="text" name="querydefs" property="shortcut"
                             onchange="retrieveSecondOptions()" styleId="firstBox"
                             indexed="true">
                             <html:options collection="advanced.choices" property="shortcut"
                                  labelProperty="label"  />
                        </html:select>i tried with this also. but no use..i'm not the getting the seleced option...
    function retrieveOptions(){
    firstBox = document.getElementById('firstBox');
                             if(firstBox.selectedIndex==0){
          return;
        selectedOption = firstBox.options[firstBox.selectedIndex].value;
    }actually , how to get the values from <html:select> ...?
    my idea is to know which value is selected from the combo box(<html:select> ) if that value is equal some string i have enable a hyperlink to open a popup window

  • HT201335 What causes the TV screen to freeze but sound continue on TV when using Air Play from I Phone?

    What causes TV screen to freeze but sound continue on TV when using Air Play from I Phone 4?

    First try rebooting ATV and router. Beyond that, it's probably something within the network, typically interference.
    To get a report of the network go to istumbler (Mac) or netstumbler (PC). Look for signal strength and noise.
    If on wifi try ethernet.

Maybe you are looking for

  • 'PLS-00363: expression..' error when executing a stored procedure..

    Hello, I'm trying to run a PLSQL script containing an ORACLE API but its failing on compilation with the message: 'PLS-00363: expression '<expression>' cannot be used as an assignment target'. As far as I understand its connected to my IN-OUT paramet

  • Message variant is missing in INBOUND IDOC.

    hi, Any one can help on this issue? The sender has confirmed that message variant was filled in outgoing file. However, When we received this Inbound IDOC, the message variant is blank. I still am confused by two questions: 1. The function module whi

  • How to kill feedback loop?

    I'm working on a project - no files are selected for recording, but there is feedback always on that's driving me nuts. Sorry, novice user here and I can't find a clue in the manual. Any idea?

  • BC email and recovery email are the same

    Client has setup his email account in BC and unfortunately his recovery email is the same as the BC email.  He is locked out of his email because he changed the password and cannot remember it.  Going through the password recovery or reset module is

  • Please tell me how to call javascript(.js) in my vb exe for adobe illustrator cs.

    Could you please please give some sample codings "how to call javascript in my vb exe for adobe illustrator cs". I called through doscript in my vb program, but some time it throws an error. If i run the script directly in illustrator it does not thr