Image for post
Image for post
Awesome pic from

TL;DR: For the lazy souls

Below are some of the tips that I have learnt about Android Development over the last few years. Have a look, they might help you as well to become a better Android Developer.

Its been two years since I decided to start with Android Development and without a doubt that has been one of the best decision I have taken. On my journey to become an Android Developer, I have made various errors and learnt a couple of things from it.

So I would like to share with you’ll those tips and tricks that I have learnt on the way so that it can help someone who is just starting out or is struggling to develop android apps. …

Image for post
Image for post
Photo by rawpixel on Unsplash


In software engineering, dependency injection is a technique whereby one object (or static method) supplies the dependencies of another object. A dependency is an object that can be used (a service).

That’s the Wikipedia definition but still, but it’s not particularly easy to understand. So let’s understand it better.

Before understanding what it means in programming, let’s first see what it means in general as it will help us understand the concept better.

Dependency or dependent means relying on something for support. …

The part-1 of this article can be found here,

Till now we have successfully applied CheckBoxPreference in our app and now we will apply ListPreference and EditTextPreference.

ListPreference and EditTextPreference look like this:

Image for post
Image for post

So lets get started.

Step 7:

Add the following code to your settings_pref.xml file for ListPreference

Here the two new attributes are,

android:entries : The human-readable array to present as a list. The labels red, blue, green that users will see.

android:entryValues : The array to find the value to save for a preference when an entry from entries is selected.

Keep in mind that the order of entries and entryValues should be the same.

To store the arrays we have created an arrays.xml file in values and added the following…

Many a times we need certain settings in our app, like setting default language, theme(light or dark), customizing notifications, etc. In this tutorial we will be creating a simple app with settings to change text visibility, text size and color. For this we will be using Shared Preferences.

Final Output:

Image for post
Image for post
Final App

In this tutorial we will be creating the first setting that is making the text visible or invisible by CheckBoxPreference and in next article we will dive into ListPreference and the EditTextPreference.

Step 1:

Layout Code for our Main Activity

Step 1:

Create a Settings Activity in which will add our settings menu. To create a menu and add items to it, first create a menu folder and add a menu resource file it. …


Bhavya Karia

Meddling with java. Android Developer at Upwards.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store