-1

I have been self learning how to design android applications and while following some tutorials I encountered issues with my pc and the emulator. How can I bypass the virtual emulator to debug?

  • You cannot run an arbitrary Java program on an Android phone. You need to write an Android app. Android studio can generate various template apps to get you started. – Henry Jul 10 '20 at 14:40

2 Answers2

1

I dont think you have done a good research on the internet, because i have seen many guys explaining it in different languages. I guess you have and android emulator downloaded in android studio, you might have a good PC that is heavy enough to hold an android emulator inside it. But there are many programmers who use a physical device for debugging instead of an android emulator. You can also do that buy the following steps:

Before that make sure your phone is android.

  1. Turn on developers option in your phone. To do that:

    a) Go to your phone settings and tab on about phone.

    b) Then Tap 7 times on 'Build number' to create Developer Options.

    c) After that go back and Developer options will be created in your device.

    d) After that go to Developer options and Enable USB debugging in your device. (If you cant find developers option go to Settings/advanced settings, even if google it for your device model)

  2. Connect your phone to PC via cable.

  3. On your Android studio, your device will be shown in available devices.

  4. Click on run

Hope it helps!

Bensal
  • 3,316
  • 1
  • 23
  • 35
0

If the "java program" you are referring to is an Android Project made on Android Studio you have several solutions:

  • You can export it as an executable file (.apk) that you can launch directly on your phone. Details here.

  • You can plug your phone via USB directly on your computer and launch the app via the green triangle on the top right of Android Studio's interface. Explained here.

  • Another solution is to use the integrated emulator. See previous link for details.

romulax14
  • 555
  • 2
  • 12