Adobe AIR for Android - GPU Mode - Bitmap Auto-Smoothing Issue

Hi everyone
I'm having a bit of an issue with the AS3 bitmap object. I'm currently developing an 8-bit style pixel game for AIR for Android.
This game is being developed at a very low resolution and is being scaled up to maintain the charm of an old retro game.
One of the methods I'm using is drawing pixels directly to bitmap objects and scaling the object up to create the old look.
When testing on a mobile device, this works beautifully when you set the rendering method to Direct but when you change
the render method to GPU the visuals go all blurry and anti-aliased (it's as if the bitmap is being smoothed out). The mini map
for example is rendered using the setPixel method and then scaled up 9 times. Looks great on my PC but once I export it to my phone
it looks absolutely awful! This is no good as I want to keep the clean, solid pixel look to maintain the the old 8-bit feel and obviously
I'd like to stick to GPU mode due to it's speed.
Like I said, this only happens once you test on a mobile device in GPU mode - it doesn't do it on my main desktop machine or
in Direct mode. I already have the stage quality set to low and I've tried setting the bitmap's smoothing property to false but
it does nothing.
Does anyone have any suggestions as to how I can get around this?

How about first blit your image to a small bitmapData, then draw it on a large bitmapData (9X larger)?
Like,
var small_bmd:BitmapData = new BitmapData(SMALL_WIDTH, SMALL_HEIGHT, false);
var large_bmd:BitmapData = new BitmapData(SMALL_WIDTH * 9, SMALL_HEIGHT * 9, false);
var bm:Bitmap = new Bitmap(large_bmd, PixelSnapping.NEVER, false);
var blitRect:Rectangle = new Rectangle(0, 0, 9, 9);
var i:uint, j:uint, blitColor:uint;
small_bmd.draw(SOURCE_IMAGE);
large_bmd.lock();
for(j = 0; j < SMALL_HEIGHT; j++){
     for(i = 0; i < SMALL_WIDTH; i++){
          blitColor = small_bmd.getPixel(i, j);
          blitRect.x = i * 9;
          blitRect.y = j * 9;
          large_bmd.fillRect(blitRect, blitColor);
large_bmd.unlock();
Not sure if the code works or not, but hopefully this helps.

Similar Messages

  • Garbled/scrambled text with Air for Android & GPU mode

    Please excuse the big image! Has anyone come across this? As you can  see the 'U' in 'Nebula' is scrambled and so are the digits below best  time.  It only happens within  the space a character would occupy. The line under 'game' is just a reflection.
    I can't work out what's causing it, it's not always the same  characters that do it although the U in Nebula is always scrambled.  Sometimes digits are scrambled and sometimes the same ones are not. It  seems to occur with embedded fonts and with normal ones like Arial. I've  tried using both Classic and TLF text, and changing anti-aliasing  settings. It occurs on both dynamic and static text.
    But it only happens  with GPU rendering, not CPU rendering.
    I can't find any mention of this at all on Google, starting to wonder if perhaps it's just my phone? (Desire S).
    Any input is greatly appreciated!

    Thanks for the fast reply! Switching to device fonts does fix the problem, but it means using some horrible default font rather than the one I want to, which I've embedded. I've tried a few more settings and Bitmap Text seems to fix it in some instances but not in others.

  • Partial wakelock in Adobe Air for Android

    I'm developing Adobe Air (for Android) application which is intended to be constantly on. App has event based operations. However, when phone enters to sleep mode app is able to perform only one or few events in a second which is not good enough. AIR's SystemIdleMode.KEEP_AWAKE -mode is not an alternative since it is too battery consuming.
    I'm looking for a solution where phone is allowed to go into sleep mode (screen is off) but still CPU performance is not drastically dropped. Not sure if Android's partial wakelock -mode does the job and is available via ANE?

    Well Im a bit puzzled now. I just created a quick AIR app using AIR13 for Android and did a DEACTIVATE test on the NativeApplication.nativeApplication property and used a TextField to "trace" out the frame rate when the app deactivated. The frame rate stayed at 24FPS the entire time. I turned the screen off, let it turn off, went to the home screen, and switched to other apps while the test app was still running. In all cases, the frame rate never dropped to 4FPS as indicated in Adobe's documentation. So it is either something a bug or feature of AIR13+ or it is how Android KitKat handles applications in the background. Im using an unlocked/stock Moto X running Android 4.4.3. The app also appends the getTimer() call to the end so you can see that it does change. Here is a link to the quick app I created: Dropbox - deactivate.apk
    I guess if you want to download that and test it out to see how it behaves on your device and let me know the results. What device and OS are you running?
    Below is the original message I started to type before I decided to create a quick app to test with. It may or may not still be relevant based on your results from my app test.
    If you are looking at just recording information, you could probably setup something on the Android/Java side that gets started when the app "sleeps" using the DEACTIVE event as a trigger to start the ANE side of things. Then when your app "wakes", you could use the ACTIVATE event to trigger a call to the ANE to pull all the data collected in the Java side back to AIR and stop the ANE data capture since the data capture would be back to being handled by AIR.

  • Adobe Air for Android - caching key event that have "unusual" keycode

    I am developing an application for a platform. The OS of this platform is Android Gingerbread (2.3.4) The platform has some buttons with "unusual" key code: 141, 131 etc.
    Native application that created in ADT can catch and respond to these keyboard events While my Adobe AIR application (created in Flash professional) are Indifferent to them.
    I try both: stage.addEventListener(KeyboardEvent.KEY_DOWN,KeyHandler,false,0,true); NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN,KeyHandler,fa lse,0,true);
    How can I "catch" this event? Maybe a way to add constant to the keyboard class?
    Thanks

    If you are deploying for iPhone it is on the 'general' settings(First setting page opened).
    Just noticed you are making android app but i still added iphone deployment settings for further future
    But if you are using it for flash/android you have to add code into your fla descriptor with XML language(dont worry it is 1 line of code)
    Watch the video on this page about GPU rendering:
    http://blogs.adobe.com/cantrell/archives/2010/10/gpu-rendering-in-adobe-air-for-android.ht ml
    Your app shouldn't lag after these steps but if you have a project that gets bigger and has lots of code it MIGHT lag so that is when external files should help.

  • Adobe Air for Android 2.3.4

    I need Adobe Air for Android 2.3.4 Urgently.
    I recently made an app on Flash CS5.5 and it installed correctly.
    It said to install adobe air
    But then it said "This prodict is not comptable with this version of..."
    ANY help?

    Hi,
    Please download latest AIR3.4 SDK from http://www.adobe.com/devnet/air/air-sdk-download.html.
    Look for the runtime.apk present in the AIRSDK folder \runtimes\air\android\device.
    Install the AIR3.4 runtime on android device using command(Refer http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-7ff6.html) -
    adt -installRuntime -platform android -device deviceID -package path-to-runtime
    The above steps will install latest AIR runtime on Android device.
    Please note that - Applications created and published from Flash Professional CS6 for Android platforms will run on devices that run Google Android™ 2.2 operating system or higher.
    Thanks,
    Meenakshi
    Flash Pro Engg Team

  • Adobe AIR for Android update FAILS

    The most recent update for Adobe AIR for Android is failing on multiple users. Reading the reviews, I am having the same problem with running the update. Update runs, then stops and won't update? Why bother coming out with an update THAT WON'T LET YOU UPDATE AIR???????

    Hi,
    Could you please share the device used, OS version, kernel version and the last Adobe AIR installed in your device. Also, is this intermittent or it is failing everytime.
    Regards,
    Nimit

  • Adobe AIR for android, what is going on ?

    Hello!
    Few days ago i decided to try develop adobe air for android.
    Updated my phone to android 2.2 installed Android SDK , Adobe AIR SDK.
    Now there are few tutorials out there how to set up Air ap for android.
    They all state that u have to install Runtime_Device_Froyo_***********.apk
    You can supposidly download it from adobe pre-release, i cant get in there because they don`t let new members to register ?!?!?!
    I searched the entire google for 3h in every possible way to find Adobe Air setup for android, but its like it never existed. There are few disabled rapidshare and megadownload links, it is mentioned in a lot of places but you just cant find it anywhere.
    How can i setup Adobe AIR for my Android phone ?

    Can you please give directions where can i clear that cash.
    Anyway i don`t think its the case, because this is first time i hooked phone to internet, and first time i launched Android app store.
    Edit:
    I went to https://market.android.com and there is Adobe air app. But when i try to download it says that my device doesn't support it (Samsung Galaxy GT-I5500) By default it comes with android 2.1 and doesn't support Adobe air, but i upgraded firmware to 2.2.
    Maybe that is the reason it doesn't show me Adobe AIR in app store - based on my phone, not my Android version ?

  • Can you play/view swf files on adobe air for android?

    Hi, yes; I'm new here, as well as to Adobe Air, and I'm still trying to learn the ropes around here, and I apologize in advance if this has already been asked, or I have placed this question in the wrong forum.
    The thing is, I was wondering if it was possible to play my SWF files via adobe air for android; and if so, how? Thanks in advance either way.

    Can you please give directions where can i clear that cash.
    Anyway i don`t think its the case, because this is first time i hooked phone to internet, and first time i launched Android app store.
    Edit:
    I went to https://market.android.com and there is Adobe air app. But when i try to download it says that my device doesn't support it (Samsung Galaxy GT-I5500) By default it comes with android 2.1 and doesn't support Adobe air, but i upgraded firmware to 2.2.
    Maybe that is the reason it doesn't show me Adobe AIR in app store - based on my phone, not my Android version ?

  • The Error Message 'Application descriptor file cannot be parsed' shows when compiling (Ctrl + Enter) Adobe AIR for Android applications on Flash Professional CS5.5

    The Error Message 'Application descriptor file cannot be parsed' shows when compiling (Ctrl + Enter) Adobe AIR for Android applications on Flash Professional CS5.5
    This is happening for most of the pupils and staff at our school and they are unable to complete their work.
    This also happens on a fresh copy of windows and CS5.5 without any updates and also with all latest updates.
    I have tried it on 32-bit and 64-bit CS5, Windows, Air and Java with the same error every time.
    There are a small minority of users where this works fine for them with no issue.
    I have tried re-setting user profiles.
    I have tried a local admin and domain admin account with the same issue
    I have noticed however that if the file is moved to the shared area it will compile. If it is on their documents area it will not compile. The users have full control in both locations. This is fine for staff but we are unable to give full control or modify access to the shared area for the pupil's
    I have been through the online support section and it directed me to phone Adobe Customer care who informed me that all support has been discontinued for CS5, CS5.5 and CS6 and they will only support creative cloud.
    Any ideas what to try next? There is no other information about this error and I cannot work out what is causing it.

    I have tried and  able to package an apk using your XML file.Could you please make sure your XML file starting from line 1 and coloumn 0.Any space will results in the error (Application Descriptor file cannot be parsed)
    -Pranali

  • Increase brightness using adobe air for android

    Is there any fringe api to increase the screen brightness in adobe air for android?
    Im making a morse code app and it could really use a pump in brightness while the app is in use.
    If its not yet implemented, then this would deffinately make a nice addition.

    i have an app called screenLight on my droidx. it really pumps up the screen brightness and makes it like a flashlight (kinda)... so i am pretty sure it is possible. i dont know how but you might try to see if you can contact one of their develepors. another option for you would be to possibly use the cameras flash. it is way brighter than the screen will ever be (though much smaller)
    good idea for an app!

  • Does Adobe AIR for Android support C2DM?

    Does Adobe AIR for Andoird support the Android Cloud to Device Messaging Framework (C2DM)?
    for more information on C2DM see:
    http://code.google.com/android/c2dm/index.html

    It isn't supported right now. It should be supportable (you will have to write native code) in an upcoming release. Same for iOS/Android notifications.

  • How to reduce suttering in Air for iOS GPU mode?

    My game currently runs at 60FPS on iPad 2 and has no problem regarding rendering speed but I'm rather annoyed by constant stuttering which causes the game to stop for 0.1-0.5 sec  once in a while. The stuttering behavior is similar to when garbage collector is ran and I supposed it is casued by GPU memory swapping as my game uses lots of bitmapdata.
    Problem is that my game transits one scene to another scene seamlessly without stopping animations in the game screen by letting old game scene sliding out of the screen and new scene sliding in. So there's no time to preload/precache graphics assets used in the new scene. After transitting different scenes a few times, the game starts stuttering when trying to show new images.
    My game works fine without stuttering on old PCs but on iPad2 it is quite obvious. Could anyone tell me some tips to reduce stuttering when using Air for iOS? In the game, all vector graphics are pre-drawn to bitmapdata(so no vector graphics are shown) and the size of graphic assets each scene has is about 2048*1024 pixels. There are about 10 scenes. On top of that, there are common interface graphic assets which are used in all scenes and the size is about 30x 400*400 pixels.
    I know the game uses quite a lot of graphic resources. Making the game preload the assets before transitting to a new scene will eliminate stutter but I'd still like to see if I can keep the seamless scene transition on iOS.
    I'm currently using Air3.5 + Flash CS6.
    * I mean preloading/precaching by actually displaying( addChild and visible=true)  them on stage and make time for GPU to cache. All the actual graphic data are already loaded.

    Some things that might help:
    I've heard that textures are uploaded as square textures on iOS. I'm not certain that really happens, but if it does then having two 1024x1024 textures would be better than one 2048x1024, because that would end up actually taking 2048x2048.
    Bitmaps are sent to the GPU when they first hit the stage, and it takes a significant amount of time for them to get there. If you are timeline animating a transition to the next scene, stagger the graphics that are going to be appearing next. That is, before you start to move on to the next area have the biggest bitmap of the next are already touching the edge of the stage. It can be invisible, or underneath another graphic, it will still get uploaded. But if you tween in all of the graphics exactly when they are needed, they will take a while to upload.
    Dispose of the bitmaps that are no longer in the scene. I think your stuttering is because you're going into a new area that has a lot of new graphics, and the GPU still has the bitmaps from the current scene and the one before that, and so has to spend time freeing up the memory before taking the new bitmaps. If you had already disposed of them the GPU might not need to clear memory for you.
    There is System.gc(). That will force the system to garbage collect, which you could do at moments that there isn't anything animating.

  • Integrating Flurry in Adobe Air for Android

    Hi,
    I am having a hard time integrating Flurry into an android application built with Adobe Air.
    Setting: Flash Builder 4.6 (sdk 4.6) and Adobe Air 3.1
    I have successfully created the bridge between Air and Java (e.g. I can open a native notification).
    The flurry doc requires to call the method
    FlurryAgent.onStartSession(this, "FLURRY_ID");
    in the onStart() of an activity, where 'this' is an instance of the Activity class.
    Following the tutorial on building ane I have seen that when you extend a FREEFunction and you override
    the call method, the context has a "getActivity()", so I hav tried the following
      @Override
              public FREObject call(FREContext context, FREObject[] args) {
        FlurryAgent.onStartSession(context.getActivity(), "FLURRY_ID");
    But with no success.
    I even tried to build an empty activity and pass it to onStartSession like this:
    Activity a = new Activity();
    FlurryAgent.onStartSession(a, "FLURRY_ID");
    Again, no success.
    I even tried "null", but no success.
    Did anybody face a similar problem here?
    Any suggestion/idea?
    ps:
    I have tried contacting flurry, but I had no replies.
    I have tried to use the id in another,  built in the gold old way, android application and it works.

    Well Im a bit puzzled now. I just created a quick AIR app using AIR13 for Android and did a DEACTIVATE test on the NativeApplication.nativeApplication property and used a TextField to "trace" out the frame rate when the app deactivated. The frame rate stayed at 24FPS the entire time. I turned the screen off, let it turn off, went to the home screen, and switched to other apps while the test app was still running. In all cases, the frame rate never dropped to 4FPS as indicated in Adobe's documentation. So it is either something a bug or feature of AIR13+ or it is how Android KitKat handles applications in the background. Im using an unlocked/stock Moto X running Android 4.4.3. The app also appends the getTimer() call to the end so you can see that it does change. Here is a link to the quick app I created: Dropbox - deactivate.apk
    I guess if you want to download that and test it out to see how it behaves on your device and let me know the results. What device and OS are you running?
    Below is the original message I started to type before I decided to create a quick app to test with. It may or may not still be relevant based on your results from my app test.
    If you are looking at just recording information, you could probably setup something on the Android/Java side that gets started when the app "sleeps" using the DEACTIVE event as a trigger to start the ANE side of things. Then when your app "wakes", you could use the ACTIVATE event to trigger a call to the ANE to pull all the data collected in the Java side back to AIR and stop the ANE data capture since the data capture would be back to being handled by AIR.

  • Adobe AIR for Android 2.2(Samsung Galaxy Fit)

    Hi all,
         I have Samsung Galaxy Fit with Android 2.2. I want to deploy applications coded in Flex on my phone.
    Also Adobe AIR is supported by devices with Android OS 2.1 and above, but in Android market it shows that my phone is not compatible with the latest version of AIR.
    So does anyone knows which lower version of AIR will be supported by Galaxy Fit.
    Thanks in advance
    Ronak Shah

    Hi,
    Please download latest AIR3.4 SDK from http://www.adobe.com/devnet/air/air-sdk-download.html.
    Look for the runtime.apk present in the AIRSDK folder \runtimes\air\android\device.
    Install the AIR3.4 runtime on android device using command(Refer http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-7ff6.html) -
    adt -installRuntime -platform android -device deviceID -package path-to-runtime
    The above steps will install latest AIR runtime on Android device.
    Please note that - Applications created and published from Flash Professional CS6 for Android platforms will run on devices that run Google Android™ 2.2 operating system or higher.
    Thanks,
    Meenakshi
    Flash Pro Engg Team

  • Adobe air for android development in linux?

    So, I'm shifting to a linux and I heard that adobe air does not support sdk 2.7 and higher! is that true for mobile app creations also or just .air packages? will I be able to compile android projects required adobe air 3.1 or 3.2 because I am building with Starling and I need newer adobe air runtimes... Please let me know. and will you please be able to tell me what software, IDE, I need to install on my linux to be able to package my .apk files on a linux?
    Thanks,
    Hadi

    I need linux to package the apk for me because I will be changeing some files like some xml files in the bin folder and then I need the new files repackaged again... the linux will be used as a server side packaging for us... get the idea?
    I've been using 3.0 in the xml namespace and it created "app.air" for me on the linux! I know I must put the -target apk to the "adt" call but when I set the -target method, it throws many errors!

Maybe you are looking for