How to run an Android project on emulator and real phone

Flutter June 17th 2022

    How to run an Android project on an emulator phone

    From the Android Studio Toolbar:
    Step 1: Select the device for us to run the software on (in this case, the emulator phone we are working on)
    Step 2: Click the Start icon to run the software

    After clicking Start, we wait for Android Studio to execute (quite a long time if the device is weak), the results when running successfully:

    The process of running the software onto the device can be summarized into 6 steps:
    Step 1: Edit the source code
    Step 2: Compile to .dex
    Step 3: Pack it into .apk (which is an Android software file)
    Step 4: Upload .apk to the device
    Step 5: Install .apk on device
    Step 6: Enable Predefined Activity to run in AndroidManifest

    How to run an Android project on an real phone

    Step 1: Go to settings

    Step 2: Go to About device

    Step 3: Go to Software info

    Step 4: Press 5 times continuously on Build Number

    After tapping on Build Number 5 times continuously, the real phone will say “You are now a developer”. Then we go back to the Setting screen and see Developer options as shown below:

    Step 5: Configure USB Debugging

    When our real phone has Developer options, we need to configure USB debugging because the phone usually connects to the computer via a USB cable, in addition, we can also connect wirelessly. The course only focuses on the USB cab part.

    Do you see the USB debugging? Remember to choose it.

    Now you plug the phone's USB cable into your computer, you can run the software up:

    Step 6: Run the software from Android Studio on a real phone:

    Plug in the USB, Watch me take a picture of my cell phone connected to your Laptop:

    Now on Android Studio software, you will see your real phone:

    Specifically, the SAM SUNG, you select SAM SUNG-> Press START to run–> The software “HelloWorld” will be installed on the real phone.