How to Set Up Intellij Idea for Android Applications

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:

  1. Download and install Java JDK (Choose the Java platform)
  2. Download and install Android SDK (Installer is recommended)
  3. After android SD finishes installing, open SDK Manager under Android SDK Tools (sometimes needs to be opened under admin's privileges)
  4. Choose everything and mark Accept All and install.
  5. Download and install IntelliJ IDEA (The community edition is free)
  6. Wait for all downloads and installations and stuff to finish.

New Project:

  1. Run IntelliJ
  2. Create a new project (there's a tutorial here)
  3. Enter the name, choose Android type.
  4. 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}
  5. 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.
  6. Choose the android version.
  7. Now you can write your program.

Compiling:

  1. Near the Run button you need to select the drop-down-list, choose Edit Configurations
  2. In the Prefer Android Virtual device select the ... button
  3. Click on create, give it a name, press OK.
  4. Double click the new device to choose it.
  5. Press OK.
  6. 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:

  1. unzipped it to C:\Android\android_sdk\
  2. renamed "tools" folder to "tools-sdk"
  3. executed
    C:\Android\android_sdk\tools_inst\bin>sdkmanager --update
  4. prepared file my_file with lines:

    build-tools;24.0.0

    platforms;android-24

    tools

    emulator

  5. 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 bar
Tools -> 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



Leave a reply



Submit