Pages

Friday, January 8, 2016

Alpha Reflex

During the week of Christmas, I built a simple mobile game Alpha Reflex using React Native — yeah, React Native is a peculiar choice for game development; I'll explain the why and how in another post. One week after I submitted it for Apple's app review, the game is finally live on App Store today! It's also available for Android on Play Store.

Alpha Reflex challenges you to find letters in alphabetical order as fast as possible. It's designed to train your reflexes and enhance your peripheral vision. It also helps me memorize the Russian alphabet which I learned while debugging the game.

My personal record so far is 180 APM (8.66 seconds for the English alphabet); by my estimation, the human limit should be around 480 APM (i.e. 3.0 seconds for Greek, 3.3 seconds for English, 4.1 seconds for Russian, and 5.8 seconds for Japanese.)

One thing still puzzles me: I used the same code base and vector assets for iOS and Android, but the iOS app size is 1.9MB while the Android release build ends up to be a whopping 8.9MB. The lion's share of the bloat comes from a 5.7MB classes.dex file (uncompressed size). I have no idea why it is so or how to shrink the package.

Update: after digging into the AAR directories, I think I know why — React Native bundles the JSC library into the Android APK. The shared object file libjsc.so for ARMv7-A is 1.9MB uncompressed, and the x86 version 4.6MB. On iOS, I believe React Native leverages the shared JavaScriptCore engine provided by the OS, so the IPA package is much smaller. It's still unclear to me how to significantly trim the app size on Android. Maybe it hinges on React Native switching to the V8 engine?

2 comments:

  1. I think that it won't be as fast with V8, that's why they chose JSC.

    ReplyDelete
  2. The app crashes on Nexus 6P with Android 6.0

    ReplyDelete