react native for Android

Android development feels easier with react native with the skills I have:

  • JavaScript
  • TypeScript
  • React
  • Redux
  • CSS (for styling)
  • npm
  • Jest (for unit test)
  • IDE: Visual Studio Code
  • Git

Now, after listing the skills. The list feels a little overwhelming. The first three can take years to master. My top programming language is C# but I want to see the beauty of react with Android.

web was nice…but get the phone/tablet or use image

I focused on Android (I have an Android phone) and having a web was nice until I added SQLite for local storage which prevented running on the web. Test is done on the phone/tablet but with Expo app. I can build a preview for android and install it without publishing.

starting with minimal api

I wanted to a binary search on stored items. There wasn’t Array.binarySearch(). I decided to build one instead of downloading from npm. I wanted to find an item similar to bisect in python. That, too, was built. It’s just the way it is with JavaScript.

design layout: flex master

CSS Flex concept is added in. Rather than Android xml with match_parent, flex concept can be used to stretch, center and place items where you want to.

local storage: SQLite

Building an app to store local values. I ran into storing key-value pair type of data where value can be string. This was OK probably for saving user tokens or some settings. Where it start to question is when you start to store records.

There’s SQLite via Expo: https://docs.expo.dev/versions/latest/sdk/sqlite/ As soon as this is installed and used, web is gone.

larger .apk than expected.

I published an app, Time Keeper, by using Java with Android. The size of the simple app is less than 2MB. Size of react native simple app is 30 MB (preview for now). I guess simple development adds quite a bit of weight.

adding onto app

I needed a way to manage navigations. It was easier than to deal with than the fragments/navigation in Android SDK. Perhaps I knew how painful those were.

Debug

I wasn’t expecting to hit a break point. I used console.log to valid values.

Unit test for library API

UI test is skipped as there wasn’t a big merit for me as I keep changing. For now, I’ve added tests for some utilities I added.

build is on the cloud

Build is done on the cloud (yep, they have all my source code… 😱).

refs


Profile picture

Kee = 💡 critical thinker ➕ 🦄 amazing coder ➕ 👦 handsome

The secret of your future is hidden in your daily routine.

© 2022 Kee Nam