How do I set up IntelliJ IDEA for Android applications?
I've spent a day on trying to put all the pieces together, been in hundreds of sites and tutorials, but they all skip trivial steps.
So here's the full guide:
- Download and install Java JDK (Choose the Java platform)
- Download and install Android SDK (Installer is recommended)
- After android SD finishes installing, open SDK Manager under Android SDK Tools (sometimes needs to be opened under admin's privileges)
- Choose everything and mark Accept All and install.
- Download and install IntelliJ IDEA (The community edition is free)
- Wait for all downloads and installations and stuff to finish.
New Project:
- Run IntelliJ
- Create a new project (there's a tutorial here)
- Enter the name, choose Android type.
- There's a step missing in the tutorial, when you are asked to choose the JDK (before choosing the SDK) you need to choose the Java JDK you've installed earlier. Should be under
C:\Program Files\Java\jdk{version}
- Choose a New platform ( if there's not one selected ) , the SDK platform is the android platform at
C:\Program Files\Android\android-sdk-windows
. - Choose the android version.
- Now you can write your program.
Compiling:
- Near the Run button you need to select the drop-down-list, choose Edit Configurations
- In the Prefer Android Virtual device select the ... button
- Click on create, give it a name, press OK.
- Double click the new device to choose it.
- Press OK.
- You're ready to run the program.
How do i set up IntelliJ IDEA for android applications on a MAC
Please refer to the JDK Configuration question I've replied earlier.
See also another question related to setting up Android support in IDEA.
Android sdk for Intellij IDEA
Same problem I have with IDEA 2017.1.1. I installed tools_r25.2.3-windows.zip and managed to install them.
I've done:
- unzipped it to C:\Android\android_sdk\
- renamed "tools" folder to "tools-sdk"
- executed
C:\Android\android_sdk\tools_inst\bin>sdkmanager --update prepared file my_file with lines:
build-tools;24.0.0
platforms;android-24
tools
emulator
- Executed:
C:\Android\android_sdk\tools_inst\bin>sdkmanager --package_file=my_file
Then gave IntelliJ IDEA folder C:\Android\android_sdk as Android SDK Home Folder.
Then IDEA asks to install something additional. The test android project compiles and runs on emulation (AVD Manager works). I had to install 22 Platform and Build Tools though because android-24 virtual device asked for a password.
The only problem is I still have no SDK Manager with GUI interface.
Intellij Run as Android application missing
Check the toolbar of Intellij. There is a drop down menu (next to it are the "play" button and the "bug" button to start the debugger). You need to setup an Android configuration for your project first.
Check this site
http://www.jetbrains.com/idea/webhelp/creating-and-editing-run-debug-configurations.html.
Although I have a configuration for my project, like you I can't see it in the menu your screenshot is showing. But I can use the mentioned run button to run my project without any problem.
Good luck.
IntelliJ Idea fails to create a new Android application project
Thank you @CrazyCoder for your answer as in comment.
I added a new variable in Environment Variables called JAVA_HOME
with JDK path - C:\Program Files\Java\jdk1.7.0_25
as value.
Now IntelliJ Idea creating new Android Projects successfully.
Developing a Visual Kotlin Application in IntelliJ Idea
You won't lose anything switching to Android Studio, because it's built on a same platform core as intellij idea.
But there should probably be a way, probably you have to set everything up in:Settings -> Appearance & Behavior -> Android SDK
Then in top menu barTools -> Android
you will have an AVD and SDK managers.
Full guide for setting project android up in Intellij Idea
Set up Android testing in Intellij IDEA
You can find some help in the IDEA forum thread.
Tests for Android application should be located in a separate module with its
own AndroidManifest.xml file. To find out how to create tests for your
Android application, you can use samples in Android SDK (i.e. "Snake"
sample).
Create IDEA project from existing sources. 2 modules with
Android facets will be created automatically: base module and "tests". Then
add dependency between these module and compile. If compilation is
successful, open some test class (i.e. "SkeletonAppTest" in "Snake" sample)
in editor and select Run->SkeletonAppTest (with Android icon) in the popup
menu: tests will run on emulator or device. You can create Android
Tests run configuration to run tests in different scopes.
Unfortunately, IDEA 9 doesn't have an option to create test module for some
base Android module. You can create it using SDK command-line tool.
Related Topics
Null Check Chain VS Catching Nullpointerexception
What Exactly Is a Context in Java
Android: How to Handle Button Click
Get a JSON Object from a Http Response
Jar Mismatch Found 2 Versions of Android-Support-V4.Jar in the Dependency List
What Kind of Ocr Java Library Should I Use in Android
Is It Possibile to Set Hint Spinner in Android
Ksoap2 Org.Xmlpull.V1.Xmlpullparserexception Expected Start_Tag Error
Dx Bad Class File Magic (Cafebabe) or Version (0033.0000) with Adk14
Android Microsoft Office Library (.Doc, .Docx, .Xls, .Ppt, etc.)
How to Serialize Object to JSON
Android:Change App Label Programmatically
Java - Ignore Expired Ssl Certificate
Dynamically Get Drawables by Id
Android Onconfigurationchanged Not Being Called
Android Unable to Instantiate Activity: Didn't Find Class on Path
How to Convert Image to Byte Array in Java
How to Parse Date from Gmt Timezone to Ist Timezone and Vice Versa in Android