My First Stupid Mobile App

Everybody seems to have developed a mobile app in his life, so I always thought that mine was just a matter of time. Last week I finally decided to take this next step and I started to look for more information about mobile development.

Around three years ago, I tried to play with the Android SDK and Java, but I found the documentation very confusing and I thought I didn’t have the stoma… I wasn’t mature enough to handle the complexity just using my spare time. From that time to now, I have been hearing a lot about hybrid apps and how useful they can be for small teams and where performance is not a requirement.

I was decided to build my first app using Cordova and, if possible, Clojurescript, and I started to search for related documentation and experiences of other developers. I don’t remember exactly how I ended up reading something about React Native, but it got my attention, since I had some happy experiences with Reagent. In addition, with React Native I would be able to generate a native app (with potential performance issues).

I thought: “if it is Javascript and React, I could probably use Clojurescript and Reagent for a quick test and have some fun at the same time”. I was excited! I could replace Java (at least for a small experiment) with a functional approach and much more fun! So, I changed my focus to Clojurescript with React Native and I found a blog post about an app called Lymchat and the projects Natal and Re-Natal. Once again, I naturally moved my focus to Re-Natal.

Re-Natal is based on re-frame, which was new to me. I knew about the project before because of their Reagent tutorials I used when I implemented my first reactive web applications, but, as I didn’t want to start by using a framework, I didn’t dig into it. By using Re-Natal, I decided to read the re-frame docs to have an opinion. I got surprised by their functional approach! It was really nice to understand it, I felt like learning more about functional programming in general, not just a framework.

Now I felt ready to start playing with some code and I generated a project using Re-Natal. To install all the required dependencies, I followed a post from gadfly and everything worked almost as expected. I didn’t installed Watchman (since it was supposed to be optional) and I didn’t want to use Genymotion, I preferred to try the Android Virtual Device.

When starting an AVD, selecting the option “use host GPU” makes the emulation much faster and nicer to work with a REPL, but I got an error:

libGL error: unable to load driver ...
...

Setting the environment variable ANDROID_EMULATOR_USE_SYSTEM_LIBS, as described in this answer, was enough to solve the problem.

Another error that happened was a ENOSPC (not enough space) error. This weird problem was solved by this answer. Maybe using Watchman would have avoided this error, but I didn’t tried.

Finally, after just a few tweaks in the generated code, I was able to have my first mobile app! After trying the Java SDK (and feeling stupid for not getting it quickly), this implementation looked so simple, so easy, so… stupidly easy (the final feeling was almost the same, but for different reasons). The result was this simple Android project: Countdown.


Do you wanna tell me something? Please, send me an email! =)

Published: January 23 2017