Google I/0 2014

As every year, i’m gonna summarise what i found most interesting about this year’s I/O. Sadly, there isn’t a lot of public material relevant to game developers. According to the schedule there have been a few hands-on talks with Intel, Nvidia, ARM etc. on performance tuning, but no videos are available on that. So, breaking with the tradition a little, i’ll highlight what i found interesting from a more general point of view. Here’s the keynote (danger, very long, very robotic, kinda boring):

New Android version “L”

Now, hold your horses. The new version is still in the making and will be released this fall. However, you can get preview release images for the Nexus line of devices and emulator images. A lot of new features went into this one, some are quite interesting for us libGDX folks:

  • Dalvik’s out, ART is in. Starting with L, ART is the new default VM on Android. Dalvik has been completely removed from L, which is a good thing. Preview builds of ART didn’t work with libGDX due to some JNI issues on ART’s side. Those have been resolved and merged into L.
  • Separate rendering thread. Previously the UI toolkit thread did both processing and rendering. Not anymore, there’s a separate rendering thread to which the UI toolkit thread is sending display lists essentially.
  • 64-bit support. This has been long coming, and it must have been pain to fix up the class library which used 32-bit ints to store pointers to native peers. While this mostly opens up the possibility of more addressable RAM, it also may give us some new instructions/registers ART and native code can exploit.
  • OpenGL ES 3.1 support and Android extensions pack. It appears that most GPU vendors in the Android ecosystem are now pushing for OpenGL extensions for tessellation, geometry and compute shaders (and still not OpenCL…) as well as things like ATSC texture compression. We’ll see how that pans out, i’m not sure it’s to relevant for libGDX at this point.
  • USB audio. Not sure if they finally fixed the audio latency, which i guess is part software/driver part hardware related.
  • Project Volta. Aims at giving users more control and insight into battery usage. There’s also a method level kind of battery profiler called Battery Historian which is really awesome! Here’s the talk on Project Volta which i haven’t seen yet.

There’s of course a metric ton of other additions, but i didn’t feel that those were to relevant for game devs. Check out Chet Haase and Adam Powell’s talk on what’s new in Android L:

Material Design

Most of Android’s current design was introduced with Ice Cream Sandwich, with iterations in Jelly Bean and and KitKat. With the new Android release called ‘L’ we get a new iteration called Material Design. Apart from the nitty gritty design principles you should follow, the big obvious things for non-designers like me where:

  • Shadows: every view now has an elevation value (z-coord), based on which the framework can draw orthographic soft shadows. It looks awesome, and gives us a back a bit of the the feel before everybody went insane with “flat” designs.
  • Animations: everything is animated. I’m not a super big fan of this as it’s easy to overuse it. But the things presented so far looked very non-intrusive while giving things a nice natural touch. I especially like the new activity transitions, which can take a few of the activity that’s being left and animate it into the activity that’s being started.

Quite a few talks have been given on Material Design. My favourite is of course the Romain Guy/Chet Haase. They are giving a bit of a behind the scene talk, with Romain explaining how the shadow rendering works. They also tell us why Romain was fired from the Android team and is now working on boring robots instead.

Chet Haase and Adam Powell also gave a nice round-up talk on how to write Material Design apps for Android. Adam will likely replace Romain in upcoming I/Os, which is sad, sorta.

Android Wear, TV and Auto

Introduced in the keynote, Android Wear is what you expect: smart watches that can hook up to your Android devices and desktops/laptops. Definitely not for me, but some people seem to like to order their pizza with those things (as demonstrated in the keynote video). Android TV is a bit more interesting, as it means that TV set vendors may start using Android as the OS running the TV. This is sorta like a death blow to Ouya and other micro consoles and may indicate that Google is not interested in playing the console game after all. Android Auto must have been the most underwhelming thing next to wear. While Google was able to round up a few manufacturers that will ship their 2015+ line ups of cars with Android Auto, i can’t really find the appeal. Similar to wearables. You hop in your car, then have your phone hook up to the console of your car. Maybe i’m just to old, so all i really need is Android TV.

Android Fireside Chat

I always look forward to the fire side. Some insights:

  • Java 8, no comment. This led me to believe that Google may pull a Swift on us (though very unlikely given the investment in Java within the framework)
  • Google’s not gonna pull a Swift on us, so says Dianne Hackborne. Neither will Scala become the new lang for Android.
  • Eclipse support is on it’s way out according to Xavier Ducrohet and David Burke, though improvements in the Gradle Eclipse integration should keep Android working in Eclipse. Somewhat.

Port your libgdx app to x86 Android and win with Intel!

Intel Developer Zone and BeMyApp are holding a couple of code fests over the next few weeks in Berlin, New York and Santa Clara. During these events, Intel will help you port your Android apps using native code to x86, free of charge!

To motivate you, you can win prices (trip to MWC 2013, tablets, Ouyas, go-to-market package) by porting your app and submitting it to the Google Play Store within 2 weeks after the respective code fest. Best of all: libgdx games can participate, and the porting couldn’t be simpler.

Porting your libgdx app to x86 Android

You have to use the nightlies for this to work. Make sure all the jar files are from the latest nightlies. Next, copy the x86/libgdx.so file to your Android project’s libs/x86/ folder. If you use the gdx-freetype extensions, simply copy the extensions/gdx-freetype/x86/libgdx-freetype.so file to your Android project’s libs/x86/ folder. To use bullet, copy extensions/gdx-bullet/x86/libgdx-bullet.so to your Android project’s libs/x86 folder.

That’s it, your app is now x86 compatible! You can test it by setting up an x86 Android emulator. Let’s look at the event details and how to win fabulous prices!

Code Fest Berlin, 9th of November, 2013

In Berlin, November 9th, from 2pm to 8pm, at co-up, Adalbertstra├če 8, 10999 Berlin. More information can be found at the Code Fest Berlin site.

You need to be based in Germany to participate in this event.

The awards

  • The two best ported app will get a trip to Barcelona with invitation to Mobile World Congress 2013
  • The fifteen first team who successfully port their app to x86 (which means no buggy app) will get a tablet
  • The fifteen next team who successfully port their app to x86 (which means no buggy app) will get a OUYA
  • Some of the team might receive a $5.000 go-to-market package (which is advertising on GP and Facebook)

Steps to follow

  1. Subscribe on the evenbrite: https://codefestberlin.eventbrite.fr
  2. Recompile your app and submit it to the Google Play store until the 23th of November, the earlier the better!
  3. Send an email at XXX with the effective Google Play link attached

The faster you port and submit your app, the better! I highly recommend attending the event, Intel dev guys will be there to help you out, and there’ll also be some test devices available! Don’t forget to register for the event!

Code Fest New York (1-2nd November), Santa Clara (15th-16th November)

The US Android Codefest is taking place in two places

  • New York, November 1st-2nd, at Alley NYC, 500 7th Ave, New York, NY 10018 Floor 17A.
  • Silicon Valley, November 15-16th SandBox Suites Silicon Valley, 3295 Scott Blvd. Santa Clara, CA

You can find more info on the official site. You need to be based in the US to participate in this event.

The awards

  • The best ported app will get a trip to Barcelona with invitation to Mobile World Congress 2013
  • The second best ported app will get $1.500 + $5.000 go-to-market package
  • The 3rd, 4th and 5th best ported app will get $5.000 go-to-market package

Steps to follow

  1. Subscribe on one of the evenbrite:
  2. Recompile your app and submit it to the Google Play store until the 16th (NYC) and 30th (SV) of November, the earlier the better!
  3. Send an email at XXX with the effective Google Play link attached

Again, make sure to register and attend the event(s), and submit your app as soon as possible!

If you run into any problems regarding libgdx, post a comment on this blog post!

Happy coding, and best of luck!

Android 4.4 for Game Developers

Android 4.4, code name KitKat, was released today, along with the new flagship phone Nexus 5 by LG. You can find more consumer oriented info on the Official Google Blog.

Developers should check out the Android KitKat release notes, as well as this Android 4.4 playlist on the Android Developer Youtube channel.

As has become usual around these parts, we are going to look at Android 4.4 from a game dev perspective.

New Memory Analysis Tools

The Android engineers have put a lot of work into memory management in Android 4.4, so that even devices with 512MB of RAM don’t struggle. Us developers have fancy new tools to analyze and battle memory issues that crop up in our apps. procstats and meminfo allow you to gauge memory usage over time via ADB. For on-device memory stats, there’s a new developer option in Settings > Developer Options > Process stats which visualizes the procstats results in a more high-level manner. Fancy!

Screen Recording

You can now do a high-quality screen recording of your app directly via DDMS. The video gets pulled down from your device and is encoded in MP4 format. Audio is sadly not recorded, but for marketing videos you usually add your own audio anyways. I haven’t tested this myself yet, so ymmv.

Immersive Mode

Since Android 4.0 (i think), you could disable the on-screen navigation bar to let your app use all of the screen. An example of this can be found when playing Youtube videos in fullscreen mode. For games, this wasn’t a viable solution, as the navigation bar would be shown again as soon as a user touches the screen.

The new immersive mode solves this issue, and is hence fit for games! In addition to the usual fullscreen flags (which libgdx sets for your automatically), you only specify one more flag called immersive sticky, and your game will use the entire screen. To get the navigation bar, a user simply swipes down from the top of the screen. With the immersive sticky flag, the status and navigation bars will be shown for a brief moment, before they get hidden by the OS again. They are actually overlayed in a translucent manner, your OpenGL surface doesn’t get resized (this is not true for the non-stick immersive mode). I let Roman Nurik explain it in more detail:

RenderScript via the NDK

From 4.4 onwards you can use RenderScript from within your C/C++ code directly. While this may not be directly game dev related, you may still want to look into it for some special use cases, i.e. image processing. It seems like the docs for this aren’t available yet (or the are hidden in a new NDK release, which i haven’t downloaded yet).

And that’s it. Android 4.4 seems to be a really solid release, adding a nice set of new features, even printing (by creating PDFs on the fly!).

Off to buy me a new Nexus 5!