Tips & Tricks For App Development Using Android Studio

Android application development using Android Studio is comparatively easier when compared to using eclipse as IDE for android development. In this tutorial we will see few tips and tricks related to using Android Studio.

Below are few tips and tricks.

1) Increase the memory size for Android Studio

Open the file located at /bin/studio.vmoptions and change the content from

-Xms128m
-Xmx800m

to

-Xms256m
-Xmx1024m

Xms specifies the initial memory allocation pool. Your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory.

Save the studio.vmoptions file and restart Android Studio.

2) Improve Gradle performance

Create a file named gradle.properties in below location if not already there.

From side menu, click Gradle and check Offline work under Global Gradle setting and hit OK button.

Again, Go to file>settings and click Compiler from side menu and then type –offline in the command-line options box and hit OK button.

Note: After completing above steps restart your Android Studio.

4) Enable Auto IMPORT

For Windows/Linux, you can go to File>Settings>Editor>General>Auto Import>Java and make the following changes.

Change Insert imports on “paste” value to “All”.

Check unambigious imports on the fly option as checked.

5) Use Shortcuts during App development

Following are some short cuts/shortkeys for Android studio.

Command look-up (autocomplete command name)
CTRL + SHIFT + A

Reformat code
CTRL + ALT + L

Show docs for selected API
CTRL + Q

Jump to source
F4

Search by symbol name
CTRL + ALT + SHIFT + N

Navigate open tabs
ALT + LEFT/RIGHT

Design to text view and text view to design
ALT + SHIFT + LEFT/RIGHT

To got back to last edited location
CTRL + SHIFT + BACKSPAC

Show Usage
ALT + F7
CTRL + ALT + F7 (on the place)
CTRL + CLICK

Extract Method
CTRL + ALT + M

Inline extraction
CTRL + ALT + N

You can also manage your shortcuts and create your own from here – File>Settings>Keymap. This will list all the shortcuts and the profile, i.e: Eclipse or Android studio.

So these were few important tips for using Android studio to assist you in Android application development. Post your important tips for Android app developers in comment section, so the list gets further expanded and this post works as a one stop link for tips and tricks of using Android Studio. 🙂

Android Team @ WeblineIndia

We have developed lots of Android apps for various domains like – Business, Social, Medical, News, Sports, Education, etc. We also have expertise in custom SDK development.

Following well defined standard development processes, coding standards, tools and techniques, it has always helped us to provide best mobile apps to our clients. Our main focus has always been to exceed client expectations and deliver easy to use technically strong apps. On the side, we also love contributing back to the community.