Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Redirect
locationhttps://www.jetbrains.com/help/idea/getting-started-with-android-development.html
HTML
<table width="100%" class="navigation">
<tr>
<td width="33%" align="left"><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/GettingPrerequisites+Startedfor+with+Android+Development+in+IntelliJ+IDEAdevelopment">Previous</a></td\|http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA%22%3EPrevious%3C/a%3E%3C/td\]>
<td width="33%" align="center"><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA">Top</a></td\|http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA%22%3ETop%3C/a%3E%3C/td\]>
<td width="33%" align="right"><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Import+an+Existing+Project">Next</a></td>
</tr>
</table>

The present tutorial assumes that you have installed IntelliJ IDEA 12 Community Edition and have the Android SDK configured to create applications for the Android 2.2 platform. A lightweight IDE for Java development, IntelliJ IDEA Community Edition comes out-of-the-box with a plugin for Android development.

Note

Note: Android 2.2 is a quite old version of the Android SDK but it ensures you can test-run your applications on a wide range of devices.

1.  Launch the Create New Project wizard

From the IntelliJ IDEA home screen, start launching the

Wiki Markup
{span:class=shortcut}Create New Project{span}
wizard.

The next step takes you to choose the type of project you want to create: choose the type of Android module you want to build. Each choice corresponds to a different project template being created.

2.  Select the project template

From the dialog box in the figure, you choose the project template and then enter essential information about the project to be created.

...

In case the Java SDK and/or the Android SDK are not installed or are configured in a bad manner, you may run into some troubles. To fix these possible issues and make IntelliJ IDEA point correctly to the Java SDK and Android SDK, you can click File|Project Structure:

Wiki Markup
{span:class=shortcut}File →&nbsp;Project Structure{span}
:

3.  Edit project properties

The dialog box below summarizes the application name and package name and allows you to set the target device and start-up activity.

...

The package name should be in the form com.xxx.yyy, where xxx usually stands for the company name and yyy is just the application name. You can use any names here, but the suggested pattern reduces significantly the risk of name conflicts with other applications.
IntelliJ IDEA offers to create a sample activity named MyActivity. In Android development, an activity is a plain Java class and an essential component of any Android applications.

4.  Set the target device  

The dialog box also gives you a chance to define how the sample application should be run by IntelliJ IDEA. There are three basic run configurations:

...

When ready, click Finish to have the project created.


 

HTML

<table width="100%" class="navigation">
<tr>
<td width="33%" align="left"><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/GettingPrerequisites+Startedfor+with+Android+Development+in+IntelliJ+IDEAdevelopment">Previous</a></td\|http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA%22%3EPrevious%3C/a%3E%3C/td\]>
<td width="33%" align="center"><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA">Top</a></td\|http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA%22%3ETop%3C/a%3E%3C/td\]>
<td width="33%" align="right"><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Import+an+Existing+Project">Next</a></td>
</tr>
</table>