Android How to Apply Material Design Theme

Following steps will help you applying the material design theme to your app. 1. In Android Studio, go to File ⇒ New Project and fill all the details required to create a new project. When it prompts to select a default activity, select Blank Activity and proceed. 2. Open build.gradle and add android design support …

Android How to Download and Make Volley.jar

If you are using Android Studio, adding volley support can done just by adding ‘compile com.mcxiaoke.volley:library-aar:1.0.0‘ to gradle.build dependencies module. However if you want to generate the volley.jar manually, below steps will helps you in getting it done. Downloading & Making volley.jar We will start with installing tools required to clone and build volley project. …

How to Add Google Play Services to Android Studio Project

In Eclipse, if we want to add Google Play Services to a project, we’ll simply import the play services project to workspace and add it as a library project. But in Android Studio, if you want to add play services, follow below steps. Open your project’s build.gradle file and add below line under dependencies module. …

Android How to Check if the App is in Background or Foreground

In some cases you might want to check whether you app is running in background or foreground. An example use case would be, you want to show push notification message only when the app is in background. The following method will be very useful to know app running state. First add the GET_TASKS permission to …

Android showing Push Notification in Multiline

When you show longer text in notification message, you can notice that the text is stripped away. So if want to show the full text in multiple lines, you need to use additional setStyle() method while your building the notification builder.

Android getting Activity from Context

Sometimes we pass context of an activity as a parameter to some other function and later we might want the activity too. So instead of passing the activity also to that function, we can get the activity from context itself. Method 1 You can get the activity from the context by type casting the context …

Page 1 of 3123