Previous  | Next  | Home

Android Studio Tips and Customization


 

Android Studio (AS) is a powerful Interactive Development Environment (IDE) that greatly facilitates the development of Android apps. This Appendix gives some tips and customizations that may be useful in getting the most out of AS. The remarks refer specifically to Android Studio 2.1.1 on Fedora Linux, but other versions on other platforms will likely be similar.

 

General

Some general features and tips are collected here, in no particular order.

A more extensive discussion of using Android Studio and its features may be found in this book.

 

Configuring Android Studio

Android Studio installs with a set of default options that can be customized for your particular usage. First, there are various settings that can be found under File > Settings and File > Other Settings. In a somewhat confusing manner, there are also more technical settings that can be found under Help > Edit Custom VM Options, which edits a configuration file for the Java virtual machine. The options that can be set and and physical location of this file may be found at Configuring Android Studio. For example, you can increase the memory allocation for AS there, or change the location of the temporary directory that Android Studio uses for downloading updates (see the following box). The name and physical location of the file being edited through the AS interface depends on the installation. On my Fedora Linux systems the file is /home/guidry/.AndroidStudio2.1/studio64.vmoptions, for example.


One potential problem that can be cured by editing the vmoptions file is that Android Studio updates use a temporary directory to download, unzip, and backup files during the update, and in some cases the space required may be larger than the size of the default temp directory. Then the update will fail and it may lock up parts or all of your system because now the temp directory that the system uses for other things has no space left. I have encountered this on Fedora Linux systems, for example, where the default directory that AS uses for updates is a /tmp directory with a capacity of 4 GB, which isn't enough for the largest updates.

There is a simple solution: In the file edited by Help > Edit Custom VM Options you can add a line that changes the temp directory used for updates to one with more space. For example, creating a new directory in my home directory /home/guidry/tmp and then adding a line

-Djava.io.tmpdir=/home/guidry/tmp
to the vmoptions file switched the temp directory for updates to the new directory (with 201 GB available when created), so there is no problem with even large updates.

 

Editors

For the Android Studio editor.

 

Version Control

It is highly recommended that you use version control software to keep track of your projects. Android Studio supports several version control systems: GitHub, Git, Subversion (SVN), CVS, Google Cloud, and Mercurial. The basics of using Git and the GitHub repository for version control with Android Studio are described in the Appendix Version Control.

Last modified: June 10, 2016


Previous  | Next  | Home