Android Studio – useful notes (1)

Having worked for years with Eclipse (and some time with Netbeans), I have to admit that using Android Studio (based on InteliJ) I’m fining harder that what it should be. Where’s all my key shortcut combinations!

Whenever I use Netbeans, I use the Eclipse keymappings option in the settings, so I don’t have to remember any new key shortcuts. I’m not sure if Android Studio/IntelliJ has this option as well, but in the meantime, here’s some notes for useful things to remember.

Organize Imports (Eclipse: shift-Ctrl-O) / Optimize Imports: Ctrl-Opt-O

Jump to definition (Eclipse: F3) : Opt-Cmd-B

Fix error with popup suggestion: Opt-Return

 

Other useful Android development related posts:

http://stackoverflow.com/questions/17252870/how-to-show-compilation-errors-in-android-studio

http://stackoverflow.com/questions/2364811/how-do-i-write-outputs-to-the-log-in-android

 

Migrating Eclipse ADT Android project to Android Studio

It’s been a couple of years since I’ve done any Android development. In the meantime I was aware that Android Studio was coming along, but apparently now Eclipse and the ADT plugins are no longer supported, so time to migrate source from some existing apps I was working on to Android Studio.

First issue: remove paths from .classpath and project.properties files otherwise ADT library references are not resolved on import.

Next issue: “Unsupported Gradle DSL method found: ‘compile()’!” – luckily this issue and the solution is described exactly here. This is my first experience with Gradle too, so got some more learning to do 🙂

Installing latest Nvidia 361 drivers on Ubuntu / Linux Mint

I’ve posted a few times about installing the nvidia-304 legacy drivers on Linux Mint, which I’ve been using on an HP desktop which has nvidia 6150 graphics on the motherboard.

I just upgraded to a shiny new geforce 750ti card which runs in this same HP, powered through the PCI-E slot so and doesn’t need any additional power (which would have required ugrading the PSU too).

To upgrade my nvidia drivers in Linux Mint, it seems the latest 361 drivers are not available in the main apt-get repos, and even if you add a ppa, it seems they’re not there yet either. Luckily, to install from the download on the nvidia site it’s pretty easy.

To summarize the steps I took based on the instructions here:

  • remove the current nvidia drivers:
    sudo apt-get purge nvidia*
  • kill the current Mint DM:
    sudo service mdm stop
  • sudo the driver .run executable downloaded from the nvidia site.. chmod +x it if needed. Reboot, and done! Running the latest drivers!