Featured
-
Android O Released with Top 7 New Features for App Developers
Android was founded by Andy Rubin, Rich Miner, Nic
by sudhanshu.tripathi -
An Overview of Android Activity - Video Tutorial
As far as Android platform is concerned, the funda
by amit.rai -
How to get IMEI number,serial number and software version of your phone
Hello... Sometimes we need to know the country
by shahbaz.ahmmod -
Search location by using place on google map
Here below is the code for searching places by usi
by shahbaz.ahmmod -
How to know free space in sdcard android
I have written code to know free space in sdcard
by shahbaz.ahmmod
Tags
Refreshing a ListView or GridView using Vertical Swipe Gesture
We can refresh a ListView or GridView by vertical swipe using SwipeRefreshLayout class. The SwipeRefreshLayout should be used whenever the user can refresh the contents of a view via a vertical swipe gesture. We need to add an OnRefreshListener t...
CountDownTimer in Android
CountDownTimer is an abstract class available in android. This class contains two abstract method i.e. onTick(long) and onFinish().
onTick(long millisUntilFinished): Callback fired on regular interval.
onFinish() : Callba...
Post JSON object in server
To send JSON object in server you have to do the following steps:-
1) Create JSON object
2) Set the header of HttpPost to "Content-Type", "application/json"
3) Now call postJsonObjectToServer method(define below) :-
public static String p...
Connection string for connecting Android(java) app to MariaDB
Here is the simple connection string to connect the android with Maria DB on linux.
you need to have MariaDB configured to the default port:3306
try
{
Class.forName("org.mariadb.jdbc.Driver");
Connection cntn = DriverManager.getConne...
Find your lost android device using android device manager
if your android device is lost, and you use another android device, you can locate it using Android device manager app, what all you need to do is to follow the simple steps.
Step 1:On your device that you have, open the Android Device Manager ...
Styling the ActionBar with Search field in Material Theme
In this blog we use Toolbar, it is more generalization form of ActionBar. It support more feature than ActionBar.
Toolbar is added in API level 21 but the good thing is we can use it in the below version by using supporting library.
First you ...
Autostart service after device reboot in android
Sometime you need to register your own android application or service to start automatically when the device has been Rebooted to perform particular task.
Here we will learn the simplest way to start an Android service or an application at dev...
Solution of EditText font in password mode
When an EditText is in password mode, It looks that its font is different.
When we change typeface in xml , It dosent work.
There is a solution :
We should change it from java like this
<EditText
android:id...
How to pic contacts name from device's contacts list in android
This is very important tutorial to READ EXISTING CONTACTS from device contacts list .There are some following steps to do this process.
Step-1 - Add a permission to open and read contacts from contacts list to your manifest xml file.
<u...
Styling the AlertDialog like Material Theme
By the help of Supporting library we can show the AlertDialog like we have in Lollipop on below version.
For this you need to import AlertDialog from
import android.support.v7.app.AlertDialog;
And then show a AlertDialog like we do norma...
Custom Dialogs in android using DialogFragment
Custom Dialogs in android using DialogFragment:
DialogFragment is the fragment that shows dialog window on top of your activity.
We have to override DialogFragment class and implement onCreateView(LayoutInflater, ViewGroup, Bundle) to use ...
How to identify the network usage of your particular application in android?
If you wanted to monitor the data usage of your particular application than you need to know the pakage name of that application which you want to monitor.
So just add the method getDataUsage given below in your utility class and pass the conte...
SmsManager to Send SMS
SmsManager use for SMS operations like sending information to the any given mobile device. We create this object by the below method.
SmsManager.getDefault()
SmsManager sManager = SmsManager.getDefault();
Then we can send any data by u...
How to identify the current opened application name in android devices?
If you need to monitor your android device activities and you want to identify the current opened application name in that case you can simply create the method given below in your utility class. And call it whenever you want to get the current ...
how to identify the network type in android?
There are various network type available in android, for example- 2G,3G GPRS etc.
If you need to find-out the current network type of your android device, than you just need to implement the method given below in your utility class :-
pu...
Create EditText on button click in Android
This blog will help to create a custom edit text on button click.This tutorial includes a xml file which hold a button after click on button create a layout parmas for edit text. Each edit text has different id and every times when you click, a b...
Load html file from assets folder in a WebView
By doing following steps you can load the HTML file from the assets folder inside your application:-
1) Copy that HTML file inside your assets folder.
2) Define a WebView in your layout, like this
<WebView
android:id="@+id/webvi...
How to get the MAC Address of the access points
Please note that every device that needs to be connected has a MAC address associated with it, be it a phone or the router. The MAC address for the device can be seen in the WiFi settings in case of the phone. For getting the MAC address of the r...
How to Get/Crop the visible portion of ImageView
In many application we set the scaleType of large image to "CENTER" or the scaleType is set to "MATRIX" and the bitmap is translated and scaled. Therefore parts of the image are not visible. Now in order to get the visible part you just need to e...
How to resize a custom view by drag side of view in android
This tutorial will help to resize a custom view by dragging of view's side and provide drag functionality also. Here is the step by step code.
Step 1- Create a xml file res/activity_main
<LinearLayout xmlns:android="http://sch...
How to create multiple view with drag and drop functionality in Android
This tutorial will help to the develop the Drag and Drop functionality, individual can create multiple view in their android application. Each view will have different onTouchListener and onLongClickListener.
Step 1- Create a XML file res/acti...
How to search in a ListView via ArrayAdapter?
ListView with searching feature is very common in applications. You just need an EditText at the top of the ListView or as per your designs.
Below are the steps-
First you need to initialize the ListView and EditText
countryCodelistVie...
Draw shapes using canvas in Android
We can create custom view by extending View class. The most important part of custom view is its appearance. We can give any shape to a custom view by overriding onDraw(Canvas canvas) method. Canvas class provide us many method which help us to d...
PayPal Integration in Android
PayPal Integration :
I am introducing step by step points for integrating paypal into your application with understanding of different terms used in programing.
Creating developer account in paypal :
a. For development purpo...
Hide/Show a View with slide up/down animation in Android
In android, we simply hide a view by setting its visibility. We can do this either in programming or in xml.
In programming (we can say in Activity, Fragment etc) there is setVisibility(int) method to set or control the visibility of the view.
...
Working with Intent
An Android Intent is an object that carries message from one component to another component with-in the application or outside the application.
There are three fundamental cases where one can use the Intents:
case 1:- To start an activity
...
How to store data in external files in android ?
In android data can be stored in external storage, where apps can save files. And these files can be accessed by other applications or user can extract them by connecting the device to a computer via USB.
By using getExternalStorageState() w...
Android speech to text
It is now very easy to use the speech to text feature provided by Android. Please follow the following steps to know hoe to use this feature:
Create an activity and with a textview to show the text and a button to initiate the speech to text...
How to extract images from device on the basis of date
Some times there will be kind of requirement when you need to extract the images or the media files from the device. So here is a method you can use for fulfilling the same.
private void getImagesInDuration(String startDate, String endDate){
...
How to make Bluetooth Connection in Android?
Bluetooth connectivity in Android is achieved through the APIs provided by Android itself. You need a broadcast receiver to keep checking for the Bluetooth devices.
With the help of broadcast you will get to know whether your device get connect...
App Submissions On Google Play Now Reviewed By Staff
App Submissions On Google Play Now Reviewed By Staff, Will Include Age-Based Ratings
Google Play, Googles marketplace for Android applications which now reaches a billion people in over 190 countries, has historically differentiated...
Android XMPP Library Integration
This blog covers how to integrate aSmack (Smack with some patches to support in Android). Also SMACK 4.1 provides native support for Android which is currently in beta development stage.
Following jar files are requires for the XMPP integratio...
Sell digital content in Android through Google Play In-app Billing Service Version 3
Products which you can sell in your application falls into these categories :
1.Standard in-app products(one time billing) eg: Premium Upgrade, Ads free version of the app.
2.Subscription(recurring,automated billing) eg: Game currency, music ...
Andorid FireBase Integration
Firebase is a real-time database. It is a NoSQL database which stores data as simple JSON. Benefit of using firebase is, it sync data by itself. Suppose if we update some data in the database then we will get listeners in our code to listen for t...
Google Now card full api for Developers
Hi Developer,
Google is coming with the new set of api with Google Now card,Api was released some time before in January this year. Check below url for more information on this.
Google Plans To Release Open API For Google Now Cards
At So...
Material design in lollipop
Designing the perfect Lollipop.
I found this blog interesting, Please have more information on this link given below.
http://officialandroid.blogspot.com/feeds/4671909951652311934/comments/default
How to write a test case using Robotium in android
Today we are going to learn something about J-Unit testing in android. We will be implementing an automation library known as Robotium, for genreating the test cases for testing the various functionalities in our app. First of all you need to add...
How to implement Expansion Library in Android
Android has some of its policies due to which it don't allow you to upload apk more than the size of 50 MB. Many Apps contains too many media files that may increase the size leading to the exceeding the limit of 50 MB.
So if your App's apk i...
How to open a url inside inapp browser efficiently ?
Below is a simple android activity which shows you clearly how to open a particular url inside our native application. In here we have taken a single xml i.e. "show_web_view" which is used as a layout of this activity in which only a WebView is d...
Customised Day Dreaming
A new feature called DayDream is introduced in Android. The Daydream is basically an interactive screensaver. When an Android device is left idle while charging or when is in a dock mode then screen-saver automatically get activated only if y...
Customised Home Screen
In Android when the phone starts then the screen that appears first is the "Launcher Home Screen". We can write an application to create this home screen and can replace the default home screen with our own created one.
You can create many att...
Custom Auto TextView in Android
If you want to create custom auto textview components you have to extends widget class like TextView,Button etc.Its very simple create your own class and write constructor corresponding to the constructor of the base class.
CustomFont class
...
How to create a Live Wallpaper
Follow the below steps to create Live Wallpaper
create a xml file which will describe your wallpaper screen.
edit manifest file and add service
code
create a service class which extends
WallpaperService class
create xml folder ins...
Monetize your Application by adding Ad banners in your android application
Adding ad banners into you app
To monetize your app you can add advertisements and earn revenues based on viewers visiting the ads. You'll see below how easily you can add advertisement banners through Admob.
Admobs is a Google acquired company...
How to deal with Out of Memory Exception in Android ?
How to deal with Out of Memory exception in android:
In android we encounter with out of memory exception many times. The reasons are we don't have expanding memory and completely dependent on device
the memory available on phone. So we don't...
Push Notification using GCM in Android
For Push Notification using GCM in Android, use the following steps:
Create the Google Api Project on Google Console.
Note down the project number which will be used as GCM Sender Id.
Enable the GCM service by turn on the toggle for Google...
Deep Linking for App in Android
Deep Linking for App contents means allowing user to enter your app through the search results. For the deep linking to be enabled for your app you must use relevant intent filters in your Android manifest file.
For Example: Suppose a user is...
APK Expansion File
Google play currently has a restriction that we can not upload an APK greater than 50 Mb. This is the plenty space for most of the application but for some application this space is not sufficient. So Google play gives you a facility to attach ad...
An insight into the latest mobile OS by Google - Android Lollipop 5.0
Android Lollipop- 5.0 is latest operating system launched by Google for smart phones, tablets and smartwatches. The new nexus 6 and Nexus 9 Tablets will be among the first devices to run on it and before the end of this year (2014) it will be set...
Getting the connected Wi-Fi name in Android.
If you need to display the connected Wi-Fi name in your application than you just have put this method getConnectedWiFiName in your utility class and call it whenever you need the Wi-Fi network name.
public static String getConnectedWiFiName...