Intellij
This is the main IDE used for android programming now, and you won't get far without it i'm afraid.
Note
Intellij opens a windows per projects, so don't search for the projects tree.
Installation
The first thing to notice is that intellij fails to notice the JAVA_HOME variable, and you have to install that by hand. And it also set's the java version to 1.3 so we change that as well.
problem
Some messages pointing to that :
Warning:java: source value 1.3 is obsolete and will be removed in a future release
!!! error "Error:(208, 2) java: annotations are not supported in -source 1.3 (use -source 5 or higher to enable annotations)"
fix
- File -> Project Structure
- Platform Settings -> JDK home path : browse your jdk installation
- Project Settings -> Projects SDK -> set it to the one installed, in my case 1.8
- Projects Settings -> Project Language level -> this is set to 1.3, match it with your sdk (8)
These are project settings so i fear you will have to do that for each project ;(
import gradle projects
When importing a build.gradle file, intellij asks for the Gradle Home directory. On OSX when installed with brew it is something like :
| osx | |
|---|---|
But here is a quick script that helps. For some reason it failed in my home directory, so maybe do it in an empty directory: Create a build.gradle file containing this :
Now run it with :
| run | |
|---|---|
and it will dump some warnings but also the value you want :
And still it does not work, but i'm fed up with intellij for a while again...
ideavim
You will have to install a plugin though. Go to :
"Intellij Idea" -> "Preferences" -> "Plugins" -> "Install jetbrains plugin"
Then choose ideavim and press install, a restart of intellij will be needed.
Note that ctrl-N and ctrl-P do not work, they are assigned to other mappings. Here is the instruction that worked. BOTH These are needed :
Could not get CTRL-N and CTRL-P to work after mapping them to "Cyclic Expand Word" and "Cyclic Expand Word (Backward)" in IDEA 2016.2.5 (while running IdeaVIM). Both keystrokes just did nothing. (settings -> keymap , type 'cyclic' in the search window)
The solution was to select "Settings" from the File Menu, then "Other Settings" -> "Vim Emulation", and set the "Handler" for Ctrl+N and Ctrl+P to "IDE" instead of "Vim".
keyboard hang and setting env vars in launcher
I don't want to accuse ideavim, but sometimes the keyboard completely hangs in intellij. You can get the control back with the following command in another xterm:
| keyboard freeze | |
|---|---|
To get rid of it altogether (but you lose national characters), set this before the command with which you start idea :
| sync mode | |
|---|---|
However, this would become a line like this in the launcher entry for idea (by the way it will end up in (/home/kees/.config/mate/panel2.d/default/launchers//idea.sh.desktop)
Two time = = will cause the command to never even start. You need to use env in front of it to work:
| startup | |
|---|---|
Note
You will have to do that in the desktop/topbar item, changing the file seems to do nothing.
So for instance left click the android studio icon and alter the command to say :
| script | |
|---|---|