Putting the project on your Android device
The following steps may be different for you depending on your Android version. If you are using Android Oreo or higher, start with step 5. If you have version 7 or lower, start at the beginning:
- On your Android device, you'll need to go to your Settings app.
- From there, scroll down till you get to the Security | Security & location section or similar, and then tap on it to go into the menu.
- Inside there, you'll see a section called Unknown sources, which you'll want to enable:
With this enabled, your device can now install the .apk file, but now you will need to move your game over to the device so that you can install it. The easiest way is to transfer it to your device via USB; we'll do that now.
- Connect your phone to your computer via USB. Upon being connected, your phone will show a notification saying that it's connected via USB for charging. Click on that notification and change the option to File Transfer:
- After that, go back to your computer and go into Windows Explorer/Finder, and then go to the Devices and Drives section; you should see your device appear there:
- Double-click on your device and access the internal shared storage section from there. Then, drag the .apk file we made before into this folder:
- Now, back in your phone, open the Files/File Explorer app. From there, click on the button on the right-hand side and select Show internal storage:
- Then, click on the button in the top-left corner and select your phone's name (in my case, Pixel 3a XL):
- From there, select your .apk file listed from the files included:
- You'll be asked to confirm the installation. Hit the Continue button:
- This will open up the installer. Go ahead and click on the Install button and wait for it to finish:
- You may see a window pop up that mentions that Play Protect doesn't recognize the developer. We will see how to solve this issue later on in Chapter 12, Game Build and Submission, but for now, click INSTALL ANYWAY and wait for the installation to finish:
- Once it's finished, go ahead and click on the Open button to open our game:
As you can see, the game is on there and it's working. Granted, you can't control it yet, and there are a lot of new things that you can't do, but this lets you know that you've set up your Android device properly. Now that you have your game on an Android device, you now need to get it working on iOS, which we will cover in the next section.