Posts Tagged ‘android’

Android Logcat Support in Maia

Friday, September 4th, 2009

In Maia you can find a new Android Logcat window that lets you see all log messages and exceptions when you are debugging an Android application.

The Logging level list allows you to select what messages are displayed in console:

  • Verbose — lowest priority, all messages
  • Debug
  • Info
  • Warning
  • Error
  • Fatal
  • Assert — highest priority, assertions only.

Logcat supports stack trace navigation and messages highlighting (you can customize colors for various log levels in the IDE Settings dialog (Ctrl+Alt+S). Note that Logcat is available only in debug mode.

Android Resource Management Features

Friday, September 4th, 2009

Maia provides a number of smart features to make working with Android resources simpler.

  • Convenient navigation from XML resource descriptors to appropriate Java fields in an R.java class…

    … and from Java code to resource files.

  • Usage search for resources. That is, when you are searching for usages of res/drawable/android.png resource file you will find both XML (@drawable/android) and Java references (R.drawable.android). By the way, searching for usages of R.drawable.android Java field yields the same results.

    Note that you can find usages of value resources (represented by XML tags) by pressing Shift+F6 when caret is positioned just before a tag:

  • Rename refactoring. When you rename a resource file (i.e. res/drawable/android.png), all XML and Java references are updated automatically. Renaming of R.drawable.android Java field, as you may have guessed, has the same effect. Note that now renaming of a resource represented by an XML descriptor is possible only through renaming an appropriate Java field.

Code Completion in Android XML Files

Thursday, August 27th, 2009

Maia provides code completion for AndroidManifest.xml and other XML resource files:

  • AndroidManifest.xml file:

  • Other XML resource files:

  • For any Android XML file you also get completion of references to local and system resources:

Developing Android Applications in Maia

Wednesday, August 26th, 2009

Maia supports development of applications for Android operating system. To begin creating an Android application, open the File menu, click New Project, click Next, and then select Android Module type:

Now you need to create Android SDK — just specify its location folder and build target. IntelliJ IDEA will create a new global library for it (to which you can later attach sources or javadoc for better coding assistance).

For that you can either click View Classpath in the Android Facet configuration (which is automatically added to your module) or edit it just as any other library. Note that Android sources and javadoc are added automatically if they are located in default locations: <sdk dir>/src and <target dir>/src for source code and <sdk dir>/docs/reference and <target dir>/docs/reference for javadoc.

You can create Activities, Services, Broadcast Receivers and Remote Interfaces (AIDL files) from popup menu (Alt+Insert). IntelliJ IDEA automatically registers them in an AndroidManifest.xml file and provides syntax highlighting for AIDL code.

To create a new Android Resource, select the res folder (or any of its specific child folders) and press Alt+Insert:

To launch an Android application you can either use an Android run configuration (created automatically when Create ‘Hello, World!’ project option is selected in Android Facet settings), or just press Ctrl+Shift+F10:

You can use external JARs in your application by just adding dependencies via Project Structure dialog, Ctrl+Shift+Alt+S. Java module dependencies can be added in a similar way.