0% found this document useful (0 votes)
19 views13 pages

Android Studio Productivity Tips

The article provides productivity tips for Android Studio, highlighting features such as local variable types inlay hints, implicit receivers and parameters inlay hints, and the use of plugins to streamline repetitive tasks. It also discusses live templates and file templates to enhance coding efficiency. These tools and settings can significantly improve the development experience by making code more readable and reducing repetitive actions.

Uploaded by

brinagec
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views13 pages

Android Studio Productivity Tips

The article provides productivity tips for Android Studio, highlighting features such as local variable types inlay hints, implicit receivers and parameters inlay hints, and the use of plugins to streamline repetitive tasks. It also discusses live templates and file templates to enhance coding efficiency. These tools and settings can significantly improve the development experience by making code more readable and reducing repetitive actions.

Uploaded by

brinagec
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Android Studio Productivity Tips

Michal Ankiersztajn · Follow


Published in ProAndroidDev
4 min read · Oct 28, 2024

Listen Share More

In this article you’ll learn about some of the most helpful and productive settings
within Android Studio!

1. Local variable types inlay hints


What does it do?
It’s a hint for the developer to know the type of a specified variable. This makes code
more readable most of the time, especially when you’re working with multiple
functions and types. Here’s how the code looks with the option disabled:

Local variable types DISABLED

Here’s how after enabling it:

Open in app

7
Search

Local variable types ENABLED

It might be helpful because we know it’s a long-to-int conversion and the result.
Now, we could reuse it somewhere.

How to enable it?


Place your cursor on the local variable, click alt + enter, then choose “Enable the
option ‘Local variable types’ for ‘Types’ inlay hints”.

This means you can enable/disable it on the fly, depending on the code you’re trying
to analyse.
2. Implicit receivers and parameters inlay hints

What does it do?


It works much like the previous setting but for lambdas. Frequently, it’ll be much
more helpful:

Lambda variable types DISABLED

Now, when we enable it:

Lambda variable types ENABLED

We immediately both know the type of internalVariable and that doSomething takes
in Int as input. This might not seem like a big deal, but it can be a lifesaver in
bigger classes and functions.

How to enable it?


Place your cursor on the { of lambda and click alt + enter, then choose “Enable
option ‘Implicit receivers and parameters’ for ‘Lambdas’ inlay hints”.

This means you can enable/disable it on the fly, depending on the code you’re trying
to analyse.
Enabling both 1 and 2 might be overwhelming, so it’s best to see which you should
turn on for yourself.

3. Plugins
It would be best to use some plugins as shortcuts for repetitive tasks. I’ve already
covered these in detail:

Top 5 Android Studio Plugins


Top plugins to boost productivity and make development more fun!
medium.com

Here’s a list of top 5:

1. Kotlin Fill Class

2. ADB Idea

3. Android Drawable Preview

4. Key Promoter X

5. IdeaVim

4. Live Templates
When working with code, you’ll find yourself repeating similar actions repeatedly.
Maybe you need to add some boilerplate to keep up with clean architecture or have
a coding style. With this, you’ll write your code much, much faster!

An example of how you can show Toast using a live template(it’s bundled within
Android Studio from the start):

Live template example

How to add your templates?


One of the best features of live templates is that you can define them yourself by
going into Settings | Editor | Live Templates. Find out more about them in the
documentation.

5. File Templates
The idea is similar to live templates, except here, you’ll create a file or a group of
files with multiple things in common. You’re able to swap parts of the names, etc.

Here’s an example of using a File Template for ViewModel:

File Template for HiltViewModel

How to add your templates?


Like with Live Templates, you can create your templates by going into Settings |
Editor | File and Code Templates. Find out more about them in the documentation.

1 fun thanksForReading() {
2 if (learnedSomething) {
3 followForMoreContent()
4 clap()
5 } else {
6 commentHowToImprove()
7 }
8 }

ThanksForReading.kt hosted with ❤ by GitHub view raw

Android Studio Android Productivity Android App Development Android


AndroidDev

Follow

Published in ProAndroidDev
69K Followers · Last published 16 hours ago

The latest posts from Android Professionals and Google Developer Experts.

Follow

Written by Michal Ankiersztajn


9.3K Followers · 4 Following

Android/Kotlin Developer & Applied Computer Science Engineer

Responses (4)

What are your thoughts?

Respond

See all responses


More from Michal Ankiersztajn and ProAndroidDev

Michal Ankiersztajn

Android Quality Automation: Decrease App Size With This Script


There are over 17_000 devices on Android, and each can have different sizes and dimensions.
It’s time to take advantage of it!

Jan 13 55 1
In ProAndroidDev by Jaewoong Eum

Designing Effective UI Components in Jetpack Compose


Since Google announced the Jetpack Compose 1.0 stable release, many companies have
adopted Jetpack Compose to leverage its numerous…

Feb 7 308

In ProAndroidDev by Dobri Kostadinov

The Elephant in the Room for Android Devs: Jetpack Compose and Edge-
to-Edge on Android 15
How Android 15’s Edge-to-Edge Feature Impacts Jetpack Compose Development

Jan 17 281 2
Michal Ankiersztajn

Top 3 Android Development AI Tools


AI tools are relevant; they’re changing the world as we see it. Take advantage of this to boost
your Android Development.

Aug 12, 2024 25 1

See all from Michal Ankiersztajn

See all from ProAndroidDev

Recommended from Medium


In Towards Dev by Gaurav Kumar

10 Jetpack Compose: Best Practices for Building Complex Android UIs


with Real-World Examples 🚀
Jetpack Compose has redefined how Android developers approach UI design, offering a
declarative and intuitive way to build apps. But with…

Jan 12 76 2

Vineet Nigam

Dynamic SSL Pinning in Android with OkHttp


Dynamic SSL pinning is an advanced security mechanism used in Android applications to
ensure that the app communicates securely with a…

Sep 23, 2024 38 2

Lists

Medium's Huge List of Publications Accepting Submissions


414 stories · 4555 saves

Staff picks
815 stories · 1626 saves

Ranjeet

🚀 Advanced Android Interview Questions for Mid-to-Senior Level


Developers
A successful Android developer at the mid-to-senior level must possess a robust
understanding of Android architecture, performance…

Feb 1 17
In Level Up Coding by Jacob Bennett

The 5 paid subscriptions I actually use in 2025 as a Staff Software


Engineer
Tools I use that are cheaper than Netflix

Jan 7 9.3K 212

Haris Weitani

The UseCase Lie: What Android Developers Need to Know


UseCase is not always good
Sep 6, 2024 385 11

Robert Jamison

Simplify Kotlin. Use Amper


or how I built an app with only two lines of code

Dec 7, 2024 47 2

See more recommendations

You might also like