My React Native (RN) Journey to building an app on Android
06-June-2022
I get this bright idea of developing a small word game on the mobile, a derivative of hangman, where the "word" in question will be the name of some Bollywood movie. I like the idea, run it across with friends, and get a positive response.
So this will be my next project. Piece of cake. I don't know RN, but I am confident, I will get this done in about a week's time, I say to myself. I decide to look for some existing sites that have this game, and I come across this: Bollywood Movie Hangman Game
07-June-2022
At this point, my journey begins.
As I search youtube for videos that can help, I come across Build Wordle with React Native, a code demo of deveoping wordle using RN. I decide to follow the tutorial to see where I end up.
Very soon, I face my first problem. What is expo? I have installed node.js and installed VSCode. I have created an app. Google Guru leads me to the React Native Documentation.
Here, I learn that there are two ways of developing apps with RN. One is with expo CLI, where you are pretty much limited in what you can do, given the expo libraries. Another, is to use RN CLI, which is more complicated. Mainly, RN CLI is based on Android Studio Platform, which is more java based. But you can build the wordle game with expo, so I continue.
I have to download the keyboard libraries that Vadim (the tutor) built, and am lost into understanding how it works. I leave understanding it for now.
The emulator doesn't show up. To solve this issue:
- Install Android Studio
- Setup Android SDK,
- From SDK Manager, download SDK files for running Emulator
- From Device Manager, select the emulator you want, and download related files. Once done, run the device. This will get your emulator working.
09-June-2022
I also note that the list of words are mentioned as constants in the code itself. I want to put those words in either a flat file, or sqlite database.So therefore, I now digress and go searching for how to read from a flat file. Turns out, there is no easy way of doing that.
Next, I try to look into sqlite and get the data from there. While searching for this, I came across this video, which looks like it will clear lots of fundamentals, so I start following The Complete React Native Course 2021: from Zero to Hero.
Resuming after a long break...
21-June-2022
On a whim, when looking at the extensions, I decided to disable Dart, flutter, Kotlin and a few more, since I thought I would have no use for them. Turns out that was a mistake. Next thing I know, this error message pops up when starting Android Studio.
I reinstalled Android Studio. This did not solve the issue. This link Android Studio missing essential plugin org.jetbrains.android helped me solve the issue. Disabling Kotlin landed me into this kind of trouble.
The plugins you should not disable : Kotlin, Smali Support, Gradle, Groovy, Properties, JUnit ntelliLang. Also you may not disable Layoutlib Native and Layoutlib Standard. If you disable these, Project View - Android would be stuck loading..
One suggested solution is to delete the file in the location (for Windows) -
C:\Users\{user}\AppData\Roaming\Google\{Android folder}\disabled_plugins.txt
Simply deleting the line in the file that mentions kotlin also solved the problem.
So now, I am fully set, My phone emulator is working, changes to my code are reflecting on the emulator, as well as my physical device.
The next topic at hand is to eject expo. If you have built your app using expo CLI, and later realise you need to move to RN CLI, you eject expo.
Comments
Post a Comment