Category Archives: ANDROID

Loading webpages using JavaScript in Android WebView / Executing JavaScript functions from Android

By | December 30, 2016

I think everyone has checked my previous post on how to improve Android WebView performance. If not, check it here Improve Android WebView Perfomance Now we will see how we can load a webpage textfields with our custom values in Android WebView. For this I am using a sample HTML file which is stored in… Read More »

Understanding Shared Element Transition in Android.

By | December 25, 2016

Hi all, In Today’s tutorial we will see how we can do a shared element transition between activities in android. What we will do. We have two activities First activity has a TextView and two images. Second activity with two images. We will animation between corresponding images. Check out the video below to see what… Read More »

Material Design Circular Reveal Animation Demo in Android.

By | December 24, 2016

Material Design has changed the way users interact with the apps. Reveal is a new animation introduced in Android L that animates the view’s clipping boundaries. Reveal animations provide users visual continuity when you show or hide a group of UI elements. This animation is often times used in conjunction with a floating action button.… Read More »

Important Steps to improve WebView Performance in Android

By | December 23, 2016

A Quick note on WebView A View that displays web pages. This class is the basis upon which you can roll your own web browser or simply display some online content within your Activity. It uses the WebKit rendering engine to display web pages and includes methods to navigate forward and backward through a history,… Read More »

Introduction to Android Canvas – Simple Example

By | December 17, 2016

The Canvas can be used to draw graphics in android. It provides methods to draw oval, rectangle, picture, text, line etc. The Paint class is used with canvas to draw objects. It holds the information of color and style. In this example, we will draw some 2D Shapes. We will create class that extends View… Read More »

How to Solve No matching client found Error in Android Studio

By | November 23, 2016

No matching client found Error usually comes when you are using the FireBase SDK in your project. This is because you are missing the the ‘google-services.json’ file in your project. You may have added it, but in the wrong path. Android Studio will try to search for it in the ‘app’ directory. The Solution is… Read More »

Android studio : Gradle project sync failed error – How to Solve

By | November 23, 2016

This is the most common errors that we see in Android Studio and very often it is easy to fix. Just follow these simple steps File -> Invalidate caches / Restart Shutdown Android Studio Rename/remove .gradle folder in the user home directory Restart Android Studio let it download all the Gradle stuff it needs Gradle… Read More »

How to create a simple repeating Job using JobScheduler in Android.

By | November 22, 2016

JobScheduler class is used to schedule Jobs in Android. JobScheduler was added recently in API 21, so below that it will not work. Here is a simple example… Create JobScheduler Service We need to create the JobSchedulerService class at first. AndroidManifest Just like a service, we need to add this service in the AndroidManifest. Create… Read More »

onRequestPermissionsResult not called on Fragments in Android

By | October 12, 2016

This is a common mistake that people make when coding for marshmallow. When in AppCompatActivity, you should use ActivityCompat.requestPermissions; When in android.support.v4.app.Fragment, you should use simply requestPermissions (this is an instance method of android.support.v4.app.Fragment) If you call ActivityCompat.requestPermissions in a fragment, the onRequestPermissionsResult callback is called on the activity and not the fragment. If you… Read More »

Custom SeekBar in Android With Labels in Bottom.

By | August 9, 2016

In this article I will be making a SeekBar as shown in the below screenshot. CustomSeekBar Class We will create a custom class for creating the custom Seekbar. I named it “CustomSeekBar.java” Usage Here is the layout. This is how you use it in your Activity. You are adding the CustomSeekbar to a LinearLayout. So… Read More »

Simple Example on using CAMERA Access permission in versions greater than Android Marshmallow.

By | July 29, 2016

Below example asks for camera permission in versions greater than Android Marshmallow. Watch Video Tutorial Add Camera permission to the manifest For asking for permission you can call like this. To Check if the user has permission to access camera.   Now the Callback if the User has performed any action. if the user clicks… Read More »

Analysing, Inspecting and Generating Code Reports using SonarQube in Android Studio

By | July 1, 2016

SonarQube, formerly known as Sonar, is a platform to analyze code quality. Installing SonarQube Go to http://www.sonarqube.org/downloads/ and download the latest release. Unzip the archive to the directory of your choice. Starting SonarQube Go to your downloaded SonarQube. Open bin/[folder corresponding to your OS] Open up a terminal window and navigate to bin/[folder corresponding to… Read More »

CRUD Operations in SQLite using SQLiteOpenHelper – Android

By | June 26, 2016

We do SQLite operations in Android by extending the SQLiteOpenHelper Class. I will create an Employee table with three fields id name company. I have a model class same as the database table Employee. Employee.java Lets see How we can do the CRUD (Create, Read, Update and Delete) Operations. CREATE We create a class that… Read More »

Geofencing in Android, A Simple Example.

By | June 20, 2016

What is Geofencing? Geo-fencing is a feature in a software program that uses the global positioning system (GPS) or radio frequency identification (RFID) to define geographical boundaries. A geofence is a virtual barrier. Today we will discuss how we can implement Geofencing in Android with a single location. First You need to provide the permissions… Read More »

Downloading Multiple files(Images etc..) in Android Simultaneously/or in Batches in Android using ThreadPoolExecutor.

By | June 10, 2016

CPUs with multiple cores have almost become the standard in Android devices. This means multiple operations doesn’t have to wait to be executed on a single thread. They can rather run on multiple threads in parallel where each threads gets executed on a single processor. For example imagine an operation where multiple images have to… Read More »

Implementing Google Analytics in your Android app – Track User Activities.

By | June 5, 2016

Implementing Google Analytics can help you find out how users are using your app. Which page is being visited regularly.You can also Know about the crashes happening in your app. How many users are currently using your app in real time and which page is currently being used more. Lets see how we can implement… Read More »

Custom Loaders with SQLite in Android

By | June 1, 2016

Introduced in Android 3.0, loaders make it easy to asynchronously load data in an activity or fragment. Loaders have these characteristics: They are available to every Activity and Fragment. They provide asynchronous loading of data. They monitor the source of their data and deliver new results when the content changes. They automatically reconnect to the… Read More »

Using Loaders in Android Using SimpleCursorAdapter in Android.

By | May 20, 2016

Introduced in Android 3.0, loaders make it easy to asynchronously load data in an activity or fragment. Loaders have these characteristics: They are available to every Activity and Fragment. They provide asynchronous loading of data. They monitor the source of their data and deliver new results when the content changes. They automatically reconnect to the… Read More »

Filtering a RecyclerView with Custom Objects.

By | May 13, 2016

This demo will show you how you can filter a RecyclerView with your Custom Objects. If you are new to RecyclerView, then please go through this post to get a glance. Check out the Demo Video ( 7 seconds) Here I am using a CustomClass called “ListItem” which has three members. ListItem MainActivity We have… Read More »