As an Android developer, you are probably using Android Studio with Gradle, the new build system for Android applications (which can be slow but I’ve found somewhat of a solution). One of the cool advantages is the dependency management that automatically downloads artifacts from a repository and makes them available to your application. Basically, you just add one line into your build.gradle file and your library is included. Pretty easy, right?
But do you know precisely that line?
For this purpose I’ve created ALFI:
gem install alfi
Why did I feel the need to create it?
Lets take a look at the alternatives…
Searching via Android Studio
- Right click the desired android module;
- Select the properties option;
- Go to the dependencies tab;
- Click the ‘+’ on the bottom left;
- Type the name of the library;
- Hit enter to initiate the search;
- Move the mouse to the desired library and select it;
- Click the OK for accepting the selected library;
- Click the OK on the project properties.
Is it just me or this sounds like a relatively time consuming process?
Alternative: Gradle, please
It’s pretty straight forward, you just go to the site, type the name of the library you want and hope for the best because… it only gives ONE result, what if the library you need is the 2nd or 3rd?
- Open a terminal (which you should have always open anyway) / click the terminal tab on android studio (if you don’t have it already opened);
- Type: alfi NAME_OF_THE_LIBRARY
- Hit enter;
- Copy the desired library;
- Paste in your build.gradle.
Almost half the steps, no UI interaction required and up to 20 results at once!
gem install alfi
... and search away ☺:
Hit me up on @cesarmcferreira if you have any questions or want to suggest a feature ☺