31 Replies Latest reply: Apr 19, 2012 6:43 AM by johnpaok RSS

    Air for android emulator black screen

    johnpaok Community Member

      I run my app for android which I made with flash cs 5.5 and Air 3.0 on my Emulator. Way I see only a black screen on my Emulator?

        • 1. Re: Air for android emulator black screen
          sinious CommunityMVP

          How are you installing the apk into the emulator?

          • 2. Re: Air for android emulator black screen
            johnpaok Community Member

            I have the sdk emulator 5554 android 2.2. I see my app when I choise launcher icon -> settings-> applications -> manage applicatios and I see in downloaded. I have install my app whith commad line cmd.exe and adb commad line ./ adb -e install myapp.apk

             

            Also, I run myapp on my emulator from flash pro cs 5.5 and File —> Air Android Settings and I choise emulator relese and then publish

            • 3. Re: Air for android emulator black screen
              sinious CommunityMVP

              Have you quick published for device debugging from flash before? Have you ever made any other apps or is this your first?

               

              It requires Adobe AIR installed on an Android so you will need to make sure you're putting the captive runtime in your APK or it will not run.

              • 4. Re: Air for android emulator black screen
                johnpaok Community Member

                I have install the adobe AIR .apk file on emulator but I cant download  and run any other app

                • 5. Re: Air for android emulator black screen
                  sinious CommunityMVP

                  Here's a basic link from Adobe on installing AIR although it's not telling you where to get it from, so it will install whatever version of the SDK you have:

                   

                  http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-7ff6.html

                   

                  Your problem is your Android Emulator does not have "Adobe AIR Runtime" installed. For Android, your .apk file does not contain the Adobe AIR Runtime. So you need to get Adobe AIR Runtime installed into your Emulator or your apk will never run.

                   

                  Captive Runtime is an option in Flash Builder when exporting an APK file. What it means is it embeds an Adobe AIR Runtime directly into the APK. I'm not certain if Flash Pro supports this option but if it does it will be in publish settings. You will notice your apk file size goes up drastically once you install the captive runtime. If you install it, your app will work without needing to install Adobe AIR Runtime on the Android Emulator.

                   

                  Here's another link on this issue:

                  http://forums.adobe.com/message/3909016

                  • 6. Re: Air for android emulator black screen
                    johnpaok Community Member

                    I can't find the apk file. Where can I found and download the Adobe Air runtime .apk file?????

                    • 7. Re: Air for android emulator black screen
                      johnpaok Community Member

                      I find in this site

                      http://codethink.no-ip.org/wordpress/archives/699

                       

                      the air runtime 2.7 but the adobe flash cs it haves the runtime.apk in the setup folder in program files 3.1 but nothing it works. May Must I run another android emulator 2.1 or 1.8 or less

                      • 8. Re: Air for android emulator black screen
                        sinious CommunityMVP

                        If you read the links I posted, the AIR SDK you have installed has a runtime it will install for you on your device.

                         

                        Connect your device and make sure it's visible to the SDK, then run this line:

                         

                        adt -installRuntime -platform android

                         

                        It will install the AIR runtime that is located in your AIR SDK in this path:

                         

                        AIRSDK\runtimes\air\android\emulator

                        • 9. Re: Air for android emulator black screen
                          johnpaok Community Member

                          I have not a device only Emulator and I'd like to run my app on emulator on pc. Also, I have install the Runtime.apk (for emulator) on emulator with android 2.2. Must I run the AIR before I run myapp on emulator

                          • 10. Re: Air for android emulator black screen
                            sinious CommunityMVP

                            You can run that to install it into emulator, the device isn't necessary just optional.

                            • 11. Re: Air for android emulator black screen
                              johnpaok Community Member

                              how can I incude the into emulator but not download it ?

                              • 12. Re: Air for android emulator black screen
                                sinious CommunityMVP

                                Have you run the command I listed above?

                                 

                                adt -installRuntime -platform android

                                 

                                That should install the SDK into the emulator itself as mentioned in the links provided. If you have Android SDK version 3.0 then it should install AIR 3.0 Runtime into your emulator.

                                 

                                I'd suggest upgrading to AIR SDK 3.2 if you want some of the new 3d goodies.

                                http://www.adobe.com/devnet/air/air-sdk-download.html

                                 

                                edit:

                                Having the latest Android SDK helps too:

                                http://developer.android.com/sdk/index.html

                                 

                                Also if your emulator is not running (run adb to see devices connected) then it will not be able to install it. By saying "make sure you have your device connected" (for clarity) I mean "run your emulator because it is considered a device".

                                • 13. Re: Air for android emulator black screen
                                  johnpaok Community Member

                                  where is the adt.exe? must I run with cmd.exe? I have only the adb.exe in this location C:\android-sdk-windows\platform-tools and now I extract the zip AdobeAIRSDK.zip in C:\AdobeAIRSDK location

                                  • 14. Re: Air for android emulator black screen
                                    sinious CommunityMVP

                                    adt comes with any AIR SDK you have installed (there's one in Flash Pro and one in Flash Builder or you can download the latest from the link I gave).

                                     

                                    Don't get confused. The ADT tool is for Adobe AIR, the Android Emulator adb tool is for the Android Emulator. They're 2 completely different SDKs. What I mentioned (adb) is in the Android SDK not the AIR SDK.

                                     

                                    Yes adb is installed in the platform-tools folder and yes you should be in a cmd prompt for ease. In the command prompt just type "adb devices" and it will tell you any devices (including emulators) you have running. Before you run it, you should have the emulator open running on a device profile you already set up via the AVD Manager.

                                     

                                    It's worth mentioning, if you already haven't, that you should run the SDK Manager.exe and make sure you have already installed the version of Android platform you want to target. Then when you run the AVD Manager you can select that platform to run the emulator on. Then 'adb devices' will see it as a connected device.

                                     

                                    After all of that, run the command from the AIR SDK bin folder:

                                    adt -installRuntime -platform android

                                     

                                    That should install the AIR runtime on what it thinks is your connected device (the emulator). After install your APKs should work.

                                    • 15. Re: Air for android emulator black screen
                                      johnpaok Community Member

                                      whith cmd.exe and adb commant in this folder - location C:\android-sdk-windows\platform-tools

                                      I see my Emulator -5554 device.

                                       

                                      whith cmd.exe and adt comand "adt -installRuntime -platform android" in this folder - location C:\AdobeAIRSDK\bin

                                      It can not install tell me the following message

                                       

                                      Failure [INSTALL_FAILED_OLDER_SDK]

                                       

                                      I try two times.

                                      More over, I have target Android 2.1 platform 2.1 API Level 7 and SD Card 80MB

                                      Aslo this location C:\AdobeAIRSDK\bin include the Adl.exe

                                       

                                      What Happened?

                                      • 16. Re: Air for android emulator black screen
                                        sinious CommunityMVP

                                        Sometimes a picture is needed. Getting your device running in the emulator with a profile installed is key here.

                                         

                                        http://www.filehorde.com/o/devices.jpg

                                         

                                         

                                        What you see me have up is AVD. I installed the 2.3.3 platform, for example. I made a "new" device using it. I pressed the Start button and my Emulator pops up.

                                         

                                        Then in the DOS window above you can see me navigate to my Flash Builder install (which has AIR 3.2 overlayed) and I'm in the bin folder. I run the command as I've mentioned. It takes about 3 minutes to complete and you see no errors.

                                         

                                        I then change back to my AndroidSDK and go in platform tools and run "adb devices". You can see I have both my phone AND the Android Emulator running as devices. Yet the adt command still worked perfectly and installed in the Emulator as you see in the picture.

                                         

                                        Look at the Emulator screenshot. After I ran the adt command, I now have Adobe AIR installed in the emulator.

                                         

                                        Hope that helps.

                                        • 17. Re: Air for android emulator black screen
                                          johnpaok Community Member

                                          I have not flash builder I have adobe flash cs 5.5 and  I have not SDK folder must I put in flash pro cs 5.5 the downloaded AdobeAIRSDK?

                                          • 18. Re: Air for android emulator black screen
                                            sinious CommunityMVP

                                            Flash CS5.5 comes preloaded with AIR 2.6. The location is here:

                                             

                                            C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\AIR2.6\bin

                                             

                                            But 2.6 is very old. You should overlay AIR 3.2 into Flash CS5.5 for best results. Here's a link to explain this process:

                                            http://helpx.adobe.com/x-productkb/multi/overlay-air-sdk-flash-professional.html

                                             

                                            Don't worry that the tutorial doesn't say the latest version of AIR 3.2, the process is pretty much identical except you change the version of AIR they mentioned (the namespace, folder name, etc) to 3.2 instead of 3.0.

                                             

                                            Otherwise.

                                             

                                            All you really need to do is download the latest AIR SDK with the link mentioned above and extract it anywhere on your system. You do not need to have AIR3.2 installed in Flash Pro (although I'd recommend it). It doesn't matter where you stick the AIR SDK files at all. I just happen to have 3.2 overlayed in Flash Builder as that's what I use instead of Flash Pro (but I have both).

                                            • 19. Re: Air for android emulator black screen
                                              johnpaok Community Member

                                              I have done this But in the bin folder it haves only 2 files adl.exe and adt.bat

                                               

                                              in android 2.1 I have install an AIR apk file but it can run my app. When I run myapp see a black screen

                                              • 20. Re: Air for android emulator black screen
                                                sinious CommunityMVP

                                                Lets step back and make one thing clear.

                                                 

                                                AndroidSDK and AIR SDK are 2 different SDKs.

                                                 

                                                They are separate.

                                                 

                                                AIR SDK has adt and adl.

                                                 

                                                Android SDK has adb, AVD Manager and SDK Manager.

                                                 

                                                You need to have both of them.

                                                 

                                                Here's a picture of my overlayed AIR 3.2 on Flash Pro CS5.5 as well as a completely separate folder for my AndroidSDK. You can see the executables I am talking about, nested in their proper separate SDKs.

                                                 

                                                http://www.filehorde.com/o/filesneeded.jpg

                                                 

                                                You can see how the top 2 Windows Explorers show the AndroidSDK. You can see adb as well as SDK Manager and AVD Manager.

                                                 

                                                You want to go to the location you see in the top 2 to set up your emulator to run.

                                                 

                                                The bottom Windows Explorer shows this path for me:

                                                C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\AIR2.6

                                                 

                                                This is the AIR SDK. Regardless that the name of the folder says AIR2.6, the instructions above tell you to overlay AIR 3.2 into this same folder. So this is actually my AIR 3.2 SDK. In there you can see clearly there is adt and adl.

                                                 

                                                You need to keep in mind which SDK has which executables.

                                                 

                                                If you do not follow the depicted, verbose instructions here to install the AIR SDK in your emulator and you are not producing an .apk that embeds AIR (captive runtime) then you will only ever see a black screen and your APK will never work.

                                                • 21. Re: Air for android emulator black screen
                                                  johnpaok Community Member

                                                  I understand and I have both of SDKs. ok you are very clear. what can I put in this location C:\Program Files\Adobe\Adobe Flash CS5.5\AIR2.6\bin

                                                  to install my emulator.

                                                   

                                                  I put the adl and adt in the androis sdk->....->platform tools

                                                  run the command line adt -installRuntime........ and it say me it have not access to adt.jar file om android sdk platform tools\...\bin

                                                   

                                                  om the top 2 image "android sdk" it haves the emulator

                                                  • 22. Re: Air for android emulator black screen
                                                    sinious CommunityMVP

                                                    The androind SDK emulator is not a part of Flash Pro. It is separate, yet they integrate.

                                                     

                                                    You run your emulator from the AndroidSDK first, then Flash Pro can see it as a device and thus let you run on the emulator publish option.

                                                     

                                                    Here's a picture. I installed AIR as I outlined above. I ran the emulator from AndroidSDK's AVD Manager. So before I selected to export for emulator I already had the emulator running.

                                                     

                                                    I then just made a quick fake certificate so I could publish and pressed publish. It found the emulator, ran it, and I see my text (not a black screen).

                                                     

                                                    http://www.filehorde.com/o/kwtf.jpg

                                                     

                                                    You can clearly see I have a flash document with nothing but publish for AIR for Android being used, my emulator up on the right, I choose to export to Emulator and check to install and launch on the device. I click Publish and what do you see in the emulator? Not a black screen, you see my text.

                                                    • 23. Re: Air for android emulator black screen
                                                      johnpaok Community Member

                                                      okokokoko thanks a looooooot......!!!!!!!!!

                                                       

                                                      before this action I have done this, I put in this location C:\Program Files\Adobe\Adobe Flash CS5.5\AIR2.6\bin

                                                      on the bin folder on adobe flash cs5.5 on the overlay AIR my app adb.exe and two dll , adbwinusbapi.dll and adbwinapi.dll (and the lib folder which include the dx.jar file but I suppose it's not important) and run the cmd.exe in the AIR2.6\bin and I have wrote the command adt -installRuntime -platform android and  install successfully the AIR on my emulator 20.70 MB and then I setup my app with the command adb -e install myapp.apk success and now  it say me to write my ip address dut in not neede it because when I choise cancel, rum my app.

                                                       

                                                       

                                                      • 24. Re: Air for android emulator black screen
                                                        sinious CommunityMVP

                                                        Are you all set now? If so please mark the question as answered. Thanks

                                                        • 25. Re: Air for android emulator black screen
                                                          johnpaok Community Member

                                                          yes ofcourse , I have another question, how can I exit my app, What can I write in actionscript? I put a button on tree frame and I'd like to go in the first frame and exit with this button from myapp or who can I exit from myapp and when I run it to go to first frame.

                                                           

                                                          and what it can open my mail to write a e-mail? the emulator say unsupported action. I hope it possible in real phone.

                                                          • 26. Re: Air for android emulator black screen
                                                            sinious CommunityMVP

                                                            Exiting on Android? Run this:

                                                             

                                                            NativeApplication.nativeApplication.exit();

                                                             

                                                            For mailto you can try the old:

                                                             

                                                            navigateToURL(new URLRequest("mailto:some@email.com"));

                                                            • 27. Re: Air for android emulator black screen
                                                              johnpaok Community Member

                                                              yes for android, if the name of button is ExitB must I write ExitB.NativeApplication.nativeApplication.exit();   ???

                                                              • 28. Re: Air for android emulator black screen
                                                                johnpaok Community Member

                                                                ok I made buttons and I write in the functions of instance-object. why my picture in every frame is smaller from my backround when I run my app on emulator????

                                                                • 29. Re: Air for android emulator black screen
                                                                  johnpaok Community Member

                                                                  I have in default size the background and my picture of every frame is smaller  on emulator and in the fla file and the swf file which I run it everything is ok.

                                                                  • 30. Re: Air for android emulator black screen
                                                                    sinious CommunityMVP

                                                                    The "name" is a tricky subject. You can only access an object on the display list by a quick name if it is placed in your timeline from your library and you assign it an instance name of ExitB. What you name it in the library is meaningless. Just to get that straight.

                                                                     

                                                                    I'll paste an old image of what an instance name is (in the properties panel) when you have something selected that is a movieclip on stage. This picture is for another thread but you'll get the general idea.

                                                                     

                                                                    http://files.ertp.com/temp/exfix.jpg

                                                                     

                                                                     

                                                                    In the case it is as you say and your instance name is ExitB then you would write a listener like so:

                                                                     

                                                                    ExitB.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void { NativeApplication.nativeApplication.exit(); });

                                                                     

                                                                    As far as the pictures being too small you'll need to give more information on this. Do remember the emulator tries to mimic android devices but androids have the unique issue of unknown "form factor". It means any developer can take their phone, give it any resolution screen they want and run the OS. So your app is going to need to get ready to sniff out the available resolution and resize your interface to suit it.

                                                                    • 31. Re: Air for android emulator black screen
                                                                      johnpaok Community Member

                                                                      if you wand answer  again in the second discussion with theme "Basics stage and background" to give you another correct answer I don't give instance name of any picture Must I do to control the image? Also, I tick on the emulator the "unknown "form factor".