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
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...
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 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.
...
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...
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...
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...
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...
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-
...
Android Studio Tips and Tricks: Keyboard Commands
Programming key commands
Action
Android Studio Key Command
Command look-up (autocomplete command name)
CTRL + SHIFT + A
Project quick fix
ALT + ENTER
Reformat code
CTRL + ...
How to use SharedPrefrence in Android
SharedPrefrence help us to store private primitive app data in form of key value pairs, but the data is lost when you uninstall the application or you clear application data through settings.To use the SharedPrefrence in your android app follow t...
Structure of Android Manifest file
In every android application AndroidManifest.xml is the necessary part. Manifest file contains every essential information about your appliucation. It contains information about your package, activities, permissions, services, brodcast receiver a...
How to load string array value from string.xml in android
Using below code I have created a load string array value from string.xml. String is a simple resource using the value provided in the name attribute. So we can combine string resources with other simple resourecs in the xml file. Below code will...
How to detect Android Softkeyboard
When user hits the BACK-Button on his android device, the keyboard disappears. How can I catch that event? In order to track softkeyboard is open or not, this tutorial is helpfull for you, and you will easily dissmiss the softkeyboard by pressing...
How to make pdf viewer function in android
Using the below code I have created pdf viewer function. Here I have created pdf Viewer Activity and used string download_token,publication_heading,download_info and pdf data fetch data in DatabaseHelper. I have also used DownloadManger fuction....
How to make Radial Gradient in android
Using below Layout code you can create a Radial Gradient, Here I have created a Gradient.xml layout by using shape and gradient property. By using GradientDrawer we can make smooth transition between two or three colors in liner, radial or sweep...
ListView populate from bottom
To populate a listview from the bottom, we just need to add the attribute stackFromBottom on listview from xml file.
Then set it to true
like this
<listview
android:stackfrombottom="true">
</listview>
Multiple Combined Or Queries using Android Parse Android
To implement "OR" feature on the query we need to merge two queries.
First, create a list of queries and add the queries that you want to implement.
And then ParseQuery.or() methods to make a final query.
Below is the code
ParseQuer...
Swipe to delete to ListView items in android
In many situations, we need to add swipe menu functionality to make our listview attractive.
Here I am using a library that makes it so simple.
Firstly, we need to add a dependency to gradle file
compile 'com.baoyz.swipemenulistview:libr...
How To Make Navigation Drawer in android.
Using below code you can create a android DrawerLayout, a FrameLayout and Linearlayout. The Linerlayout is divided in three linerlayout for using image and text. In this Navigation Drawer when I will click navigation menu the navigation menu w...
How to make Animate a Bitmap app
In the below example I have created Animate Bitmap program. By using animated bitmap function we will get the position and distance along a path. In below, code will animate image on screen. In my below code I have clearly describe how to make A...
How to implement custom GridView in Android with Images and Text
In this blog I am going to show how to make GridView or GridView function. In the below example I have created a adapter class , item class and Created another layout for GridView image. In values folder I have created color.xml file for color co...
Getting status bar height
Hello everyone ,
I was working on status bar and found that we could get the height of the navigation bar at runtime.
following is the code to get the height of the status bar.
private int getStatusBarHeight() {
int result = 0;
...
How to make Email validation function in android
Here I have created a Email validation function .By used this function we can check user input value like example (sachin@gmail.com)in this example validation function checked string value are proper format or not .In my below code I have clearly...
Is there any choice to kill the application unless there is a menu option in to kill it?
Quit Application by Menu Item
Hello readers,
While Goggling I found this question on stackoverflow, So I thought to share it here,
many users searches for "Dose user have any choice to kill the application unless we put a menu option in...
How to use Shared Perference in android?
Here I have created Shared Perference function. Shared PerFerence is used to display a screen with some text fields. Shared Perference saved value is used when we close application. The below code will clearly describe you how to use Shared Perfe...
How to make Text View with Rounded Corners in android?
In the below example I have created a Text View with Rounded Corners function. Here I have defined style to change background to textview. Below example will clearly describe how to make TextView with Rounded Corners.
Step(1)-MainActivity-
...
SpeechRecognizer.ERROR_NO_MATCH:
Hello guies,
As i was working on and speech recognition module i encountered a mysterious bug while the listener called for the second time to listen for voice input.
Bug detail :-
When you call the listener of the SpeechRecognizer ins...
CoordinatorLayout
Coordinator Layout
Coordinator Layout one of the finest example of the design and intelligence goolge has introduced yet .
This new layout is all about set of rules defined in Behaviors, we can define the views inside Coordinator Layout t...
How to make custom toast in android.
In the below example I have created a custom toast Function in Android, the toast will open in center of the screen. Here I have used a image, image shown below contains a toast at the bottom of the screen. For more see the below code, in which I...