Installing Java Development Kit (JDK)
Download the latest version of the Java Development Kit (JDK) from the link provided above. If you're running 32bit Windows, download the 32bit version, if you're running 64bit, download the 64bit version. When Installing the JDK take note of where it is being installed too, we will need to know the location to setup something later. It may ask you to install the Java Runtime Environment (JRE) as well, if so do that too.
Now we need to setup a "JAVA_HOME" environment variable. To do this follow the steps below.
1. First press Win+R (Windows Key + R), this should open up the RUN window.
2. In the RUN window type "SystemPropertiesAdvanced" (without quotes) and press enter or click OK. This should open up the "System Properties" window, like the image below.
Figure -1. System Properties

Figure 0. Environment Variables Window

5. For the variable name put the following (without quotes) "JAVA_HOME".
6. For the variable value put the location/path of your JDK install. Commonly (for 64bit): "C:\Program Files\Java\jdk1.8.0_144" (without quotes).
7. Press OK three times to close all the windows.
Installing Android Studio/Android SDK
Download the latest version of Android Studio, or the standalone Android SDK. This guide will be using the Android Studio to illustrate the process however so I suggest that.
When installing Android Studio, make sure the Android SDK option is checked.
At some point during the installation you will be able to select the location you want to install the Studio IDE and Android SDK to. This page looks like the below by default:
Figure 1. Android Studio Install Config

You can install it to anywhere you like, but for the sake of the tutorial and for my own reasons I will be installing the Android SDK to the "C:\Android" directory (see below image). I suggest keeping the install location for it easy to reach, and without spaces as sometimes even on Windows spaces can be the cause of issues when doing stuff. Note down or remember the location of the "Android SDK" (In my case, as you will see in the image below, it is C:\Android) we will need it later.
Figure 2. Android Studio Install Config Change

Once the Install is complete, start Android Studio. You may see a screen like below.
Figure 3. Android Studio 'Missing SDK'

Figure 4. Android Studio SDK Missing SDK Install 2

On the next page, click Finish and it will begin to install the missing components. When the missing components are installed, click Finish again. This should open up a window like so:
Figure 5. Android Studio Main Window

Click "Configure" at the bottom of this window, and then click SDK Manager. This will bring up a window like so:
Figure 6. Android SDK Manager

Now we need to setup the ANDROID_HOME environment variable in Advanced System Properties. In order to do that follow the steps above that you used to setup the JAVA_HOME environment variable, except for variable name put "ANDROID_HOME" and for variable value put the location of the Android SDK directory that you noted during the install (in my case C:\Android). DO NOT close the "Environment Variables" window like you did previously for JAVA_HOME, instead locate the "Path" system variable by scrolling down the list (if need be). You will need to modify this a bit by following the steps below.
1. Double click the "Path" variable, it should open up a new window to edit the variable. In Windows 10, the window looks like the below image.
Figure 7. Path variable editing

If you aren't on Windows 10, it may look like the window from creating a new variable, just the variable value field has a bunch of paths separated by the character ";".
2. If you're on Windows 10, click "New" it will add a new text field at the bottom of the list for you to add a new path too.
3. In the new text field type the path to your Android SDK install and end it with "\tools" (in my case: "C:\Android\tools" without quotes). Please make sure it is the full path to the "tools" directory of your Android SDK install, when installing the Android SDK it may have added an "sdk" sub folder before the "tools" folder if you did not change the directory.
4. Repeat the above process but add "\platform-tools" after (in my case it would be "C:\Android\platform-tools" without quotes).
5. Repeat the above process but just end it with the base directory for the Android SDK (in my case just "C:\Android" without quotes).
6. Press Ok to close all the Environment variable and System Properties windows.
If you aren't on windows 10, just do the above steps but instead of clicking "New", just end the path with a ";" (without quotes) before typing a new path.
To test if you did it right, press Win+R and then type CMD and press enter. It will open the command prompt, type "android" without quotes and press enter. If you did it right you should see something similar to the below image.
Figure 8. Testing Android SDK In command prompt

Close the command prompt, if that was what you saw, you can move on. If it wasn't try modifying the variables again.
Installing NodeJS
Download and install the Windows LTS installer from the download link provided above for NodeJS. When installing NodeJS make sure the "Add To Path" option will be installed, so you can access NodeJS from the command prompt without having to add it to the Path environment variable yourself. Also make sure "npm package manager" will be installed as well.
Once it is installed, you should be able to open the command prompt (Win+R + typing CMD and pressing enter) and if it was installed correctly (meaning it also set the Path variable in the environment variables) you should be able to type "npm" without quotes and press enter and get similar to the following image.
Figure 9. Testing npm

Building an APK
Getting Cordova Setup
Congrats! If you made it this far, your Android environment should be setup correctly and now its time to get Cordova.
Step 1. If command prompt isn't open from testing npm, open it again.
Step 2. Type the following and press enter: npm install -g cordova
Step 3. If it installs correctly you should see something similar to this image below:
Figure 10. Cordova install

Step 5. If installed correctly, you will see a Synopsis on how to use the cordova command (the help).
Creating a Cordova Project
With Cordova installed its time to create a project. In RPG Maker MV, deploy your project for Android/iOS as you would normally to get the exported "www" folder. Then follow the below steps to create a Cordova project to use for the exported "www" content.
Step 1. In command prompt type the following and press enter (see below though before pressing enter): cordova create myMVProjectCordovaDirectory com.my.mvproject myMVProject
Where "myMVProjectCordovaDirectory" is the directory you want the Cordova project to be
Where "com.my.mvproject" is the "address" of your android app (usually safe to just do like com.yourComapnyOrName.TheGameName) without spaces.
Where "myMVProject" (the last one) is the name of the cordova project, usually safe to just use your game name with no spaces.
Example: cordova create C:\AwesomeGameCordova com.liquid.awesomegame AwesomeGame
Step 2. If done correctly you should get a simple "Creating a new cordova project." output.
Step 3. CD into the directory of the cordova project using the "cd" command. For the above example: cd C:\AwesomeGameCordova
Step 4. Once in the directory with command prompt type the following and press enter: cordova platform add android
Step 5. If the above is done correctly, you should see something similar to this image:
Figure 11. Cordova add platform

Step 7. The above command will check to make sure you can build the project for android, if so you should see similar output tot he below image.
Figure 12. Cordova requirements check

Step 9. Go to the location of the Cordova project in Windows Explorer and enter the cordova projects "www" folder, deleting everything in it.
Step 10. Paste the contents of your games "www" into the cordova projects "www". Your cordova projects www folder should look like the below image now.
Figure 13. Cordova www project folder merge

Step 12. After awhile if all goes well, a lot of text should fly by that are basically the build steps executing themselves, and you should end up with a built project.
Step 13. Copy the built apk, found in <PathToYourCordovaProject>/platforms/android/build/outputs/apk/android-release-unsigned.apk to your phone and install the apk! Additionally if you have your phone connected and ADB enabled, you can do "cordova run android" to automatically do this and launch the game on your phone.
Troubleshooting
1. When building the apk with "cordova build android --release" i get the "ERROR: cmd: Command failed with exit code 1" error Why?
Try doing the following commands:
cordova platform rm android
cordova platform add android@~6
cordova build android --release
If the above doesn't fix the problem, you may have messed up in setting up your environment.
F.A.Q
NOTE: This guide still needs refinement, and I will go through it later today and do so. You should be able to follow it though and if you understand it build for android, if you have any questions feel free to ask.
Happy RM'ing!
- Liquid
