Wednesday, July 8, 2015

Can Android Studio be used to run standard Java projects?

Can Android Studio be used to run standard Java projects? - Hallo sahabat Google Android Developer Tutorial, Pada Artikel yang anda baca kali ini dengan judul Can Android Studio be used to run standard Java projects?, kami telah mempersiapkan artikel ini dengan baik untuk anda baca dan ambil informasi didalamnya. mudah-mudahan isi postingan yang kami tulis ini dapat anda pahami. baiklah, selamat membaca.

Judul : Can Android Studio be used to run standard Java projects?
link : Can Android Studio be used to run standard Java projects?

Baca juga


Can Android Studio be used to run standard Java projects?

http://stackoverflow.com/questions/16626810/can-android-studio-be-used-to-run-standard-java-projects


Tested on Android Studio 0.8.6 - 1.0.2
Using this method you can have Java modules and Android modules in the same project and also have the ability to compile and run Java modules as stand alone Java projects.
  1. Open your Android project in Android Studio. If you do not have one, create one.
  2. Click File > New Module. Select Java Library and click Next.
  3. Fill in the package name, etc and click Finish. You should now see a Java module inside your Android project.
  4. Add your code to the Java module you've just created.
  5. Click on the drop down to the left of the run button. Click Edit Configurations...
  6. In the new window, click on the plus sign at the top left of the window and select Application
  7. A new application configuration should appear, enter in the details such as your main class and classpath of your module.
Now if you click run, this should compile and run your Java module.
My usage case: My Android app relies on some precomputed files to function. These precomputed files are generated by some Java code. Since these two things go hand in hand, it makes the most sense to have both of these modules in the same project.


Demikianlah Artikel Can Android Studio be used to run standard Java projects?

Sekianlah artikel Can Android Studio be used to run standard Java projects? kali ini, mudah-mudahan bisa memberi manfaat untuk anda semua. baiklah, sampai jumpa di postingan artikel lainnya.

Anda sekarang membaca artikel Can Android Studio be used to run standard Java projects? dengan alamat link https://googleandroiddevelopertutorial.blogspot.com/2015/07/can-android-studio-be-used-to-run.html

Artikel Terkait

Can Android Studio be used to run standard Java projects?
4/ 5
Oleh

Berlangganan

Suka dengan artikel di atas? Silakan berlangganan gratis via email