April 4, 2018

Sneak peek at Red on Android

Here is a short overview of the implemented features so far for Red/View backend on Android:



The source code for that Android test app is available here.

Implemented features so far:
  • New java bridge for Android
  • Full set of Red/View widgets supported (some still require extra work)
  • Draw & Shape dialects fully supported
  • Compatibility with Android GUI themes
  • Device-independent coordinate system
  • Updated APK building toolchain for targeting API 23+ Android systems
  • Improved ARM backend, support for ARMv7+
  • Android OS support ranges from 5.0 to 8.1 (tested on a Pixel 2)

The new java bridge replaces the old prototype built a few years ago, the low-level JNI bridge has been kept as is. This new bridge is optimized for performance, and allows efficient bindings from Red/System to the Android API in Java.

Those features were implemented in about a month and half in August/September 2017. We have delayed the continuation of that work, as we need to focus our resources on higher priority tasks for now, like Red/C3 and full I/O support. Once 0.7.0 will be out, we should have some resources available to resume this work. As a reminder, the current work on Android is done in a private repository, in order to keep control over the communication about Red on Android, as we want to maximize the announcement effect on that very important milestone. This private repo will be opened to a group of selected developers in our community once we resume the work on it, in order to help with testing and fine-tuning.

About the Tiger demo, it's a Draw version of the famous SVG tiger. It has many complex shapes, so it is particularily intensive to render in realtime, as in the above animation. From what we have noticed so far, it is CPU-bound on most (if not all) Android devices, so the rendering speed varies according to your device raw performance. We did some simple benchmarks with raw Java 2D vector graphics using the same Android API as Draw, Java code performed only 12% faster than our Draw code. This is an excellent result at this point, and hints that we can achieve great performance for 2D rendering in future versions. Here is the same demo running on a Xiaomi Mi Mix, which has a bigger display and is quite faster than the Nexus 5 used in the first video:




Here is a non-exaustive list of features to add or issues to address in order to complete Android backend:
  • Font and Para objects support
  • Menus support
  • List widgets elements have fixed sizes so far
  • Text-list has fixed height
  • Area widget needs to be completed
  • User-defined list widget
  • Camera aspect ratio correction required
  • Camera control
  • Transition effects between panels
  • Fast 2D sprites and scrolling support (for 2D games)
  • Red GUI console support
  • Common hardware sensors support
  • Bluetooth support
  • QR code reading and generation library
  • Contacts database access
  • Intents access
  • Developer keys management
  • Permission system support
  • Extra application types support:
    • desktop widget
    • headless service
    • wearable
    • TV

We are really excited by how quickly and smoothly was this first part of the work achieved, so this bows well for the remaining parts. As you know, we have a very heavy schedule this year, so we really need the full support of the Red community, and beyond, in order to accomplish it all and finally make the tool we all dream about, come true!

11 comments:

  1. This is too cool! I have to stop myself drooling on the keyboard! Well done, Nenad and team.

    ReplyDelete
  2. Oh Yeah, Doc & Team. You've come a long way.

    ReplyDelete
  3. One of my dreams is coming true!

    ReplyDelete
  4. Great to see Red/Rebol making progress on Android!

    ReplyDelete
  5. Now I wish I had an Android phone ;p

    ReplyDelete
  6. I come from China. I like what you do. It's very very cool.

    ReplyDelete

Fork me on GitHub