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
How to make SMS sent confirmation program in android
If you want to create sms delivery app you can use my below code. In the below code I have used Intent , PandingIntent and Broadcastreceiver. In the below code I have also used Toast function to deliver SMS notification. See the below example it ...
How to make Status bar Notification in Android
If you want to create Status bar Notification you can use my below code. Notification are used to alert users on some events that requires their attention. The NotificationManger is service used to manage Notification. In below code i have also u...
Features of Android 5.0 version
New major features added in 5.0:
Introduced Material design ,new widgets, custom shadows, vector drawables and custom animations.
ListView is now replaced by RecyclerView and use of CardView, with better optimization.
You can now add more ...
Trick to change text color inside setError method of EditText?
If you want to customized the error message of EditText than you can simply use the code given below.
Using below code you can declare your edit text
// Declare your edit-text.
EditText editText=(EditText)view.findViewById(R.id.editText);
...
How to block all incoming calls in android
To block all incomming calls in your android device we have to use a class Broadcast Receiver. Broadcast Receivers simply respond to broadcast events from other applications or from system itself. All the events are notified once the event occure...
Relationship between Activity lifecycle and asynctask
An Asynctask doesn't depend on Activity life-cycle that contains it. Like if we start an AsyncTask inside an Activity and then we rotates the device, the Activity will be destroyed at that point but the AsyncTask will remain same or not die until...
Check for target activity available or not
We know that implicit intents are used to perform an action that your application can't but others can do.
Like to send some sms we uses this intent :
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(In...
How to make Sensor in android
If you want to create Sensor function you can use my below example code. The android platform supports three categories of sensors. 1st Motion Sensors, 2nd Environmental sensors and 3rd is Position sensors. In the below code I have used SensorEve...
How to make ViewFlipper in android
In the below example i have created ViewFlipper function. Here I have used ViewFlipper attribute in main.xml layout. ViewFlipper can be used to slide views in and out on the users current view port. I have used two buttons When we will click next...
How to remove item from RecyclerView DataBase Sqlite helper class(RecyclerView)
Here I have created a method in DataBase helper(sqlite) to remove Items from RecyclerView. In the example code first i have created deleteCallDetail method and after then In Adpter class I have used ClickListener, so that when we click on cross(I...
Use of Drawable folder in Android Application
Whenever we create an android app we have many folders in out solution which are used for building application in android.
Drawable folder in android app is mainly used to change or set the background image of an android application .In t...
Get Facebook profile pic url by user id using graph api
It is very easy to get the url of profile picture from facebook if we have user id.
We just create a url like this:
Here id is the user id of the Facebook account.
try {
// Type may be normal,large or small
...
How to make Call State in android
Hello friend's
If you want to create a Call State function in Android see the below code example. Here I have used TelephonyManger method to get the information of call state And I have used PhoneStateListener. In AndroidManifest.xml I have a...
Use of Server Side Script in android
Script File in Android
While building android application we have situations where we want to post data onto the server. Sometimes we need response from the server and based on that response action will be performed.
For doing that we will ...
How to create Reading & Writing program in android
Hello'friend's
If you want to create Read and write function you can take help from below example. In below example i have created two buttons and one TextView.
Step(1)-MainActivity-
public class MainActivity extends Activity {
p...
How to make ImageSwitcher in android
In my last blog I have described about how you can create a TextSwitcher. So in continuation of that in this blog I will help you in craeteing a ImageSwitcher.
Firtsl of all you shoud know what ImageSwitcher is, ImageSwitcher a class which al...
Vibrate Animation to ImageView
To give imageview / button vibrate animation, need to follow these steps.
create xml file "vibrate_anim.xml" in anim folder
<!--?xml version="1.0" encoding="utf-8"?-->
<rotate xmlns:android="http://schemas.android.com/ap...
How to restrict application for Tablets only
Some applications are only made for tablets. So in order to restrict the application to download only in Tablets, we can use supports-screens tag inside the manifest file inside manifest tag.
<manifest ... >
<supports-screens an...
How to make BadgeCount on the menuItem on toolbar
If you are looking to create BadgeCount view in android toolbar, here is the way to code it:-
Step 1:- Create badgeCount layout file say badgecount.xml :-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
...
How to make menuItem visible and invisible
If you are looking how to create menuItem and make them visible or invisible on certain condition, here is way to create menuItems:-
Step 1:- Create items on menu.xml:-
<menu xmlns:android="http://schemas.android.com/apk/res/android"
...
How to start an Activity with Shared Element Transition Animation
A view that moves from one activity to another in a smooth motion is possible with the help of Shared Element Transition. Its a type of animation when user clicks on certain view in one activity the view smoothly expands to the next activity. Whe...
How to make TextSwitcher in android
TextSwitcher is useful to animate a label on screen. TextSwitcher animates the current text out and animates the new text. In below example Frist I have created a main layout, In main layout I have added TextSwitcher attributes. See the below exa...
How to create Zoom-In & Zoom-Out function in android
If you want to create Zoom-In and Zoom-out of an image using Touch events function check my below example. In below example First I have created a main layout named xml.layout then in xml.layout I have added 2 attributes, first is FrameLayout att...
How to use Intent to send data from one Activity to another in Android
Below I have written the code for how to send data using Intent in Android from one Activity to another.
Intent i = new Intent(getActivity(), UploadWeldService.class);
i.putExtra("mCapturedImagePath", mCapturedImagePath);
...
How to set selector in android
If you are looking to change the image or color of the widget when it is clicked or focused, Here is the code snippet that explains it:-
Step 1:- set the widget in an XML file for which you want to applying selector:-
<ImageView
...
How to create Circular Reveal Effect like WhatsApp in Android
While sending a photograph/audio/video/contact through WhatsApp in Android, we have to use a attach button at the top right corner, clicking on that button makes a circular reveal effect. To show or hide a group of UI elements we called it a Reve...
How to create ShareActionProvider function in android
If you want to create Share Action Provider function check my below example. Here I have created frist main.xml. After creating main.xml I have added attribute to the menu item. In MainActivity created onCreateOptionsMenu method I sets the share ...
How to apply Ripple Animation in Android XML file
If you want to implement Ripple effect for buttons and other views, then this tutorial is helpfull for you. Ripple is like a wave, when user interact with the UI elements, material design provides a visual effect at the point of contact. Ripple a...
How to make WebView function in android
Hello friend's
If you are looking to created WebView function in android below example will help you. WebView is used for display web pages inside your application and it turns application to a web application.
Here I have added <webview&g...
how to create Custom font function in android
If you are looking to make Custom Font in android check the below code example. For this first download the required fonts on your system and then place it in fonts folder. After putting fonts in the assets/fonts folder then I have used java code...
Importance of Services in Android Application
To perform long running operations on background without any disturbance with the application we use Services in android. Services are workable even if the application is destroyed. Service base class have various callback methods onCreate(), onB...
how to use Bitmap in Android
Below I have written the code for getting the Image using Bitmap in your Android App. Here we have passed two parameters in the method the first one is the Image View and second one is the url of the image that is to be shown on the image view.
...
How to make Text to Speech app in android
TextToSpeech convert your text into voice. Android provide TextToSpeech class, here we need to instantiate an object of this class and also specify the InitListener. Below code will describe you how to create Text to speech app.
public class M...
Difference between UnBound Service, Bound Service and Intent Service
Here I am writing few differences between UnBound Service, UnBound Service and IntentService.
UnBound Service:
1.Basically used for long repetitive task.
2.startService() is the method use to start unbound service.
3.stopService()...
Closing applicaiton
Facing problem while closing application here is a simple solution.
Now no need to use the lengthy way like using broadcast receivers.
Scenario :- if you have an application in which multiple activities are opened and you want to close you...
How to create Geo Location coding in android
Geocoding is the process of finding the geographical coordinates of the given location, So if you looking help to create Geo Location function see code example below. Here I have created edit text using place name for users. When User enters any ...
How to create BigPictureStyle Notification in Android
To show large-format notifications in android notification bar similar like Flipkart, Mobikwik, Paytm applications. The style of large icon notification bar is called BigPicturestyle Notifications. Mostly the BigPicturestyle Notification is used...
how to parse xml file in android?
If you are looking to parse an xml file in android here are its steps :-
Step 1:-Getting XML content by making HTTP request
public String getXmlFromUrl(String url)
{
String xml = null;
try
{
DefaultHttpClient...
Copy to clipboard programatically
Clipboard is just a type of register where you can save some temporary data. you can't store data permanently here so its nice place to store temp data.
For this you have to create a edittext from where you will copy text and then you have to...
How to create Pending Intent function in android
If you want to create a pending intent function check my below example. Here I have created MainActivity class and MyReciver class to show get data and in this class I have used toast function. Below code will clearly described you how to create ...
How to implement Animation using Android TextSwitcher
To animate a particular label in android we have to use TextSwitcher on screen. TextSwitcher layout is similar as the other layouts in android, like Textview and Edittext. TextSwitcher is used to swap current text with the new one. We can also pe...
How to turn on Bluetooth in Android app
If you wish to turn on Bluetooth in android when your app run then use the code written below .This code will ask you to turn on your mobile Bluetooth if the Bluetooth is off.
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAda...
how to send email via intent
Here is a way by which you can send the email via android-intent.
The below code opens a dialog showing email related apps e.g. Gmail, Yahoo Mail etc. if installed in your device. In case your device is not installed with mailing applications t...
Vibrate Phone programmatically
In Android you can also use vibration method of android. There is an abstract class named Vibrator that helps you to implement vibrations in your own applications.
method vibrate will vibrate with a given pattern.
public class MainActivity...
How to show SMS in Device
If you want to create a function to Show SMS on your device check below simple example. Here I have created a ListAdapter, by using this class sms will be showing on list and in this I have also created a SmsFormat class In which I have set value...
Make phone call programmatically
Its easy to make a phone call by using intent in android for this example we can user an editText and button with property of editText is set to inputType="phone" that ll accept only numbers.
On basis of intent an action to be performed i.e AC...
Difference between px, dip and sp
If you are looking to know about the difference between px,dp,sp , here it is:-
px(Pixels) :-
px corresponds to actual pixels on the screen.
Pixel is the smallest element of a picture represented on the screen.
dip Density-...
Login Authentication
Below i have written the code for Login Authentication, this code will check that weather the entered name and password are there in database or not.
The following code will return true boolean value if the entered name and password exist in dat...
Lazy loading in android RecyclerView
Step 1:- create an xml file image_recyclerview.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_h...
How to make Linkify function in android
Using below code i have created Linkify function. Here I have created MainActivity class and In main.xml layout I have added Text View property. Below code will clearly described you how to make Linkify function.
Step(1)-Create MainActivity-
...