Can Android Studio be used to run standard Java projects? -
for times when want isolate java , give quick test..
can run non-android java projects in android studio in eclipse?
tested on android studio 0.8.6 - 2.1
using method can have java modules , android modules in same project , have ability compile , run java modules stand alone java projects.
- open android project in android studio. if not have one, create one.
- click file > new module. select java library , click next.
- fill in package name, etc , click finish. should see java module inside android project.
- add code java module you've created.
- click on drop down left of run button. click edit configurations...
- in new window, click on plus sign @ top left of window , select application
- a new application configuration should appear, enter in details such main class , classpath of module.
- click ok.
now if click run, should compile , run java module.
my usage case: android app relies on precomputed files function. these precomputed files generated java code. since these 2 things go hand in hand, makes sense have both of these modules in same project.
Comments
Post a Comment