Introduction
This article demonstrates how to integrate Android studio with Unity 3D. There are two Android build process output types in Unity, the output package (APK), and the exported project. An APK is automatically deployed to your device if you select Build and Run. Alternatively, you can use the Android Debug Bridge (ADB) to deploy the APK manually after building.
Run code on your Android device, or in the Android emulator. For more in-depth information see the step-by-step instructions below.
Step 1
First, go to create a new unity 3D project; if you add any package click here.
Step 2
Go to file >> Build Settings.
Choose the Android Platform. If you try to run your game from another platform you can follow the same procedure then click the build and run button. If you get an error follow the given steps to solve this error.
("http://download.unity3d.com/download_unity/57cc34175ccf/TargetSupportInstaller/UnitySetup-Android-Support-for-Editor-2018.1.6f1.exe").
Step 2
Next, go to Edit >> Performances. Select Performances, and the External Tools will appear here.
Next, go to select the Script editor platform. I will choose the Visual Studio enterprise 2017. MonoDevelop for unity is the same as for Visual Studio.
JDK
The Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc), and other tools needed in Java development.
SDK
The Android SDK (software development kit) is a set of development tools used to develop applications for the Android platform. I have already used this SDK and JDK. If you know this platform we can download and install the SDK and JDK.
Step 3
After this process is completed, build, and run again. If you faced an error, Bundle Identifier has not been set up correctly.
Please set the Bundle Identifier in the Player Settings. The value must follow the convention 'com.YourCompanyName.YourProductName' and can contain alphanumeric characters and underscore. Each segment must not start with a numeric character or underscore.
Next, go to Edit >> Player Settings >> Player, Select the player. The inspector box will appear, change the following name format and select the minimum API level.
Step 4
Next, go to Fill >> Build and Run. Select the build and run, the location box will appear, and just place the app name with (.apk) format.
Run the application in your desired emulator or Android device following this command box, shown here.
(i)
Connect your Android device or emulator.
(iii)
I hope you understood how to integrate Android with unity 3D studio.