# My journey building an Android Studio Plugin

It all started back in 2020 when we suddenly had to start working from home (we all know the cause). At the time I was working on [LEGOLife](https://play.google.com/store/apps/details?id=com.lego.common.legolife), an app supporting both phone and tablet form factors. In our office, we had access to tablets, but most of us didn't have any at home which turned out to be a problem quite quickly as we had to ensure our code changes in LEGOLife looked great on both form factors.

I started relying even more on a handy Android developer tool (present on all Android devices) called "Smallest width" to toggle between the two modes:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675847172912/797d1cac-c04f-46e1-ad6e-f7ebe42b8864.png align="center")

* Phone (Pixel 1): 411dp for Pixel 1
    
* Tablet: tablets start at sw600dp, so any value &gt;= would turn your device into a tablet
    

Even though this tool was and is working just fine, it became cumbersome so I was thinking how could I achieve the same with just a simple click of a button, preferably inside the IDE. That's when I started looking into the [JetBrains Platform SDK](https://plugins.jetbrains.com/docs/intellij/welcome.html) and after reading the following:

> \*One of the best ways to contribute a larger piece of code, adding extra functionality to IntelliJ IDEA, is by writing a plugin. (\*source: [https://www.jetbrains.com/opensource/idea/](https://www.jetbrains.com/opensource/idea/))

I decided to develop my own plugin.

Fast forward to June 2020, after using it for some time and gathering feedback from [Péter Pandula](https://github.com/pandulapeter) (thanks a ton mate) I decided to launch it on the JetBrains Marketplace: [Android Form Factor Toggler](https://plugins.jetbrains.com/plugin/14410-android-form-factor-toggler) 🎉.

My colleagues and I have been using it since and it turned out to be quite a handy tool. I'm kindly asking you to give it a try and possibly share your feedback. Thank you 🙂

PS It just reached little over 1K unique downloads in the Marketplace so I thought it is worth writing a blog post about it. Also huge thanks to [István Elekes](https://dribbble.com/istvan_elekes) for creating the plugin icon [🙏](https://emojipedia.org/folded-hands/)!

[![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677099947100/8da02e4a-560f-46b3-b6e4-28023fe689e2.png align="center")](https://plugins.jetbrains.com/plugin/14410-android-form-factor-toggler)

PPS Note that Android Studio Electric Eel brings the superb [Resizable Emulator](https://developer.android.com/studio/run/resizable-emulator) 🎉! It requires you to have a specific emulator compared to [Android Form Factor Toggler](https://plugins.jetbrains.com/plugin/14410-android-form-factor-toggler) which can toggle real devices as well. Choose whichever suits you best!
