Android Archive

How to get Accelerometer readings in Android

Author: | Categories: Android, Code Tricks, Quick Tips No comments
Hello all, Today we learn about getting Accelerometer readings in android application. We will use android SensorManager class to get readings from Accelerometer and show them on screen. First create a android project and create a file in layout folder as bleow in above file we are using three

How to change style of Horizontal ProgressBar in Android

Author: | Categories: Android, Code Tricks No comments
In this tutorial we will learn how to customize or change style of Horizontal Progressbar in Android. To change style of Horizontal ProgressBar we have to set a property android:progressDrawable with custom layer-list drawable in our layout file like:   and create progressDrawable like below in drawable folder (customprogressbar.xml)

Correct way to cancel an AsyncTask in Android

Author: | Categories: Quick Tips No comments
It is advisable to cancel an AsyncTask after it complete it’s execution or you have no need to keep continue it’s execution. That time you need a correct way to cancel an AsyncTask in Android. It may be a OnBackPress event of Activity or OnDestroyView of Fragment. Because AsyncTask

How to apply custom font on TextView Android

Author: | Categories: Android, Code Tricks, Quick Tips No comments
Some times we need to apply custom font on a TextView in our application. We can do this by setting typeface to out TextView as below. In case you have more than two TextView in your application(also in different activities/fragments) which uses custom font, Then it would be better

Generally Asked Android Interview Questions for Freshers

Author: | Categories: Android, Quick Tips No comments
Hello Friends, Some times we need a quick reference to general Android interview questions when we are going for an interview but do not have much time for preparation. Here we have selected some generally asked Android interview questions for you, On which you can have a quick look

Sending email with attachment programmatically in Android

Author: | Categories: Android, Code Tricks, Quick Tips No comments
If you want to send email with attachment in android application programmatically you can use below method for it. Just modify parameters according to your use and you are ready to go.

Method to check internet connectivity in android

Author: | Categories: Android, Code Tricks, Quick Tips No comments
Some times we need to check internet connection status of device when we perform any network tasks using our application in android application development. Below is a simple method to check internet connectivity in android. And here is an example how to use it in your code.  

Handling Activity state using Saved Instance State Bundle

Author: | Categories: Android, Quick Tips No comments
In this tutorial we will learn about handling Activity state using Saved Instance State in Android or in other words we can say How to retain Activity state with the help of Saved Instance State Bundle in Android. Because some time we need our application to run on both

How to show ProgressBar while loading a video in Android VideoView

Author: | Categories: Android, Quick Tips No comments
Tutorial for how to play video in Android VideoView and how to show ProgressBar while loading a video in VideoView. Android provides a widget VideoView to play video files. Here is the link for supported video formats for Android. http://developer.android.com/guide/appendix/media-formats.html#core In this tutorial we will learn how to play

Android WebView Tutorial

Author: | Categories: Android, Quick Tips 1 Comment
Basic tutorial for how to use android web view in android application. In this Android WebView Tutorial we will learn how to implement a basic WebView in Android application. We will also learn how to load a dynamic web page, How to load a local web page and how

Android ListView Tutorial

Author: | Categories: Android, Quick Tips No comments
In this Android ListView Tutorial we will learn how to use Android ListView to show array data as row wise scrollable view. The each row can be a View or a ViewGroup. The data is added to ListView using an Adapter. We will show names of cities in ListView,

Android Login Screen Tutorial – Part 2

Author: | Categories: Android, Quick Tips No comments
Welcome to the second part of android login screen tutorial. In this tutorial will learn how to handle an Android login screen events for an android application or basic validation used in an android login screen. As we learned in our previous tutorial of this Android Login Screen Tutorial

Android Login Screen Tutorial – Part 1

Author: | Categories: Android, Quick Tips No comments
In this android login screen tutorial we will learn how to design a login screen for an android application, as we seen in many applications like facebook twitter as shown in below image. Login screen basically used to validate user credential to use some application.The basic design of login

Show ProgressDialog Android

Author: | Categories: Android, Quick Tips No comments
In this tutorial we will learn about how to use / show ProgressDialog android. While performing some time taking tasks we need to show a loading indicator on screen like loading.., please wait.., etc. We can use built in android feature ProgressDialog,  it is easy to use loading indicator class