How app developers can make the most of Android 4.4 KitKat

November 4, 2013
0 65 256 8


    Google recently announced the new Nexus 5 and the next version of the Android operating system: Android 4.4 KitKat. It also quickly released an updated version of the Android Software Development Kit and the Android Developer Tools. With the SDK and associated tools app developers can now start to tweak their apps to take advantage of the many changes introduced by Android API level 19.

    Probably the most useful user interface change in KitKat is the addition of the Full-screen Immersive Mode. This is different from the previous full screen mode as now apps can use 100% of the screen including the areas that were previously occupied by the status and navigation bars. The KitKat API provides two new modes IMMERSIVE and IMMERSIVE_STICKY. These extend the ways an app can work with Android so that users benefit from content at full screen but still allow access to Android’s system level navigation. Of particular interest is the Sticky mode which once set works without really any further interaction from the app. The Immersive Sticky mode shows the status and navigation bars in a semi-transparent state when a user drags from the top of the display. After a short delay they will disappear if the user doesn’t navigate away from the app. Google recommends that apps like book readers and magazine use the new Immersive mode while games and draw apps should use Immersive Sticky. Google have published a short DevBytes guide to these new modes on YouTube and there is also some sample code.

    Another addition to the UI tool kit is the new Transitions framework. Transitions allow app developers to define how one scene changes to another scene. This is similar to how scenes transition in a movie with fading or swiping etc. As well as fading in and out there is also the ability to create your own transitions so that different UI elements can be programmed to move, slide, rotate and fade. In fact using custom transitions means you can animate the entry into a scene in any way you want! There is more information in this Android 4.4 Transitions video.

    Since KitKat can run on devices with only 512 MB of RAM, there is now a new API call isLowRamDevice() to check if the app is running on a device with less memory. If it is then the app can change its behavior accordingly, maybe cache less data, use lower resolution graphics or pre-load less asserts and so on. KitKat also provides some new tools to available developers to analyze how much memory is being used by their apps. Under System->Developer options there is a new tool called Process Stats which shows the amount of memory being used by different apps. Tapping on a app shows a more detailed analysis including a summary of the memory used with useful stats like the average RAM used and the peak RAM usage.

    A great new feature in KitKat is the screen recording tool. It can be accessed by the adb command line tool (e.g. adb shell screenrecord) or via the Android Device Monitor (which is part of the SDK). With it developers will be able to create much higher quality screen recordings for demonstrating their apps or for providing tutorials on how to access more advanced features. Gone are the days of trying to video your app in action via steady hand and a camera.

    Android 4.4 KitKat introduces native platform support for printing. The print manager is basically available from within any app and allows the app to generate paper output to supported printers either over Google Cloud Print or via Wi-Fi and Bluetooth. The new platform also lets printer manufacturers create a driver which can be downloaded from the Play Store to allow their brand of printers to work directly from Android. All this is transparent to the app. To add printing support apps need to send either a bitmap, a HTML web view or a PDF to the printing services. The default format is actually PDF, but Google has added some helper classes which take other formats like the bitmaps and automatically convert them to PDF. Check out the DevBytes Android 4.4 Printing API video for more information.

    This is just a summary of the most user visible changes in Android 4.4 KitKat but what it shows us is that the perfect KitKat app will use full screen immersive mode with cool scene transitions and have the ability to send output to a printer, while all the time being aware of how much memory is available on the device!

     

    0 65 256

    Comments

    • Groud Frank

      Can’t wait to get a phone with Kit Kat or get an update. I am especially excited about being able to print over WiFi! My android phone is my companion and my phone must keep up with my level of productivity, especially at work. Kit Kat was no incremental update. At this point I don’t even care about 4.2 or 4.3. My OEM can skip it and go straight to Kit Kat but that’s a big ask for Huawei.

      • A.M

        NO your device will not be getting KitKat no device has skipped 2 updates 2 choices get a new android or root & flash your current phone when the community makes 4.4 for your device

        • John Motschenbacher

          samsung skipped multiple. they are going from 4.1.2 to 4.3 on s3′s
          4.2, 4.2.1, 4.2.2

          • A.M

            Man I don’t care for those devices cause everyone knows they’ll be getting those updates I’m speaking on the old devices S2 Note 2 Nexus 4 etc

    • Jon_D7

      What I’m also looking forward to is apps now have the ability to build in that gradual transparency to the status & navbar so that we can see more of the app – similar to the launcher on the Nexus 5.

      • A.M

        yes devices now can install the Nexus 5 Launcher

    • Sean 陳偉國 Tan

      looking forward for this!

    • Vincent Goh

      respect for talking non-stop for 12 minutes O.o

    Popular

    Latest