Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

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...

Convert Bitmap to ParseFile in android

Hi, I am writing my method that convert Bitmap to ParseFile that we need to upload image on parse.com server. Below is the method in which we just pass our bitmap of image and we get ParseFile. We use ByteArrayOutputStream then convert i...

load text file content from assest folder to textview

If you want to read some file from assest folder of your project then first you have to get assest folder file named read.txt. InputStream class is used to read data or content from file, network or from memory, we can also use this input stre...

read phone call logs in android

Android provides Cursor interface to get all calls logs. A cursor interface provides read-write to get the result set by database query. Here stringOrder query will access phone calls date wise in desc order. Cursor loader basically perform q...

How to get device local ip address ?

Every android device has a local ip address and we can easily get that ip address for our backend purpose like we can save that ip address to our server. In below method NetworkInterface is a interface that provides many methods to get device ...

How to make Advanced Adapter in Android.

If you want to create Item view function check below example. In the below example I have created a Advanced class. By using Advanced adpater many opretions can be consumed. In Advanced adapter we can easily use view holder method. Adapter call t...

Get Android device Model programatically

The following method can help you to find device manufacturer name and model name. To get these details Android provides Build class to get system properties like Build.MANUFACTURER returns the device build name. Build.MODEL returns the model ...

Download a file programatically

In Android we can download a file from a given url so that we can use that file's data without downloading again and again so we save that file in internal or external storage of device. you can use this method to download your file, you have ...

How to make Draw on a Canvas in Android.

How to make Draw on a Canvas in Android. If you want to create Draw on a Canvas function check below example. In the below example I have created a Suraface class. Canvas works like as an interface. I have also used onDraw() method for drawing e...

Login into webview without using http requests

We know that if we want to login into some form we have to create a asyncTask to do that and then in background some lines of https requests codes and then we check for response. But by using webivew we can directly log in into our website wit...

unlock your android phone programatically

Do you want to unlock your device after some interval then you can do that by using following procedure - You have to create a alarm manager that will trigger after sometime of interval and then you can use KayguardManager class of android tha...

Add contacts programatically in android

In android we can easily share data across the applications and this is done by using ContactProvider. A contact provider class is a flexible java class that provides you multiple row contacts to access person data. we can also use contact pro...

Create a shortcut of your android application activity

Sometimes it is good to make a shortcut of your application activity so that we can access that activity directly. Assume that we have 10 activities in our application and all activity redirect one to another in order. And i want to see updates o...

Change image color programatically

If you want to change the color of an image then you can use the following code : public Bitmap changeColor(Bitmap srcBitmap, int color) { Bitmap resBitmap = Bitmap.createBitmap(srcBitmap, 0, 0, srcBitmap.getWidth() - 1, srcBitm...

Change application language programatically

Now its possible to change the application specific language programatically It is working by setting locale. But you have to set it in all activities. Here is a code you can try these code. you can get the local language using locale and can ...

Include Empty/Null Variable to Json while serialize with Gson Android

Are you using Gson for Serializing Json String from Java Bean/Model class? If yes then It may be useful for you. Gson ignore null/empty value while serialize Object to Json String. Like Gson gson = new Gson(); String jsonData = gson.to...

start one application from another

If you want to launch a application B from your application A then you can launch that by using intent Like this : First define application B package name so that we can set launch intent : Intent myIntent = getPackageManager().getLaunchIn...

kill android application all activities process

We know that on back press of button in any android application can finish the app or an activity but some process of application still works in background so if you want to kill all the processes of any application you can kill app process like ...

Run multiple async task simultaneously

Do you know that android version higher than gingerbread doesn't support multiple async task to run parellely but gingerbread ans lower version supports this functionality. So if you want to run multiple task at a time you have to check api ve...

Stop asyncTask in background

We know that asyncTask class has four override methods and three methods runs in main ui thread but one method doInBackground runs in background thread. In case if we want to stop this background service based on same condition then we can use th...

stop GCM notification

sometime its necessary to stop or unregister notification services in your app like from your setting screen then you can use these codes. you have to create a static handler in your gcm register class static Handler myHandler; and in...

get strength of wifi in your android device

If you want to get the strength of some wifi , you can use wifi manager class and can get list of available wifis like this WifiManager manager; manager = (WifiManager) getSystemService(WIFI_SERVICE); List<ScanResult> res = m...

How to make set Wallpaper in Android device.

Here I have created Set Wallpaper in device method. In the below example I have created two activity and two layouts and added some function code in Android Manifest. Below example will described you how to set Wallpaper in device. Step(1)-...

Check application screen visibility

Hey do you want to run some code on basis of screen visibility in your app..you can create an Application level class and can set every screen visibility in onResume or in onPaused like this : public class ThisApplication extends Application {...

Navigate into webview

Sometime it is required to navigate user in webview on back press button rather than to exit webview so for this you can use the following code : @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(event.getAction() == K...

Convert bytes to string and viceversa

As we all know all data are sent in form of bytes from one end and on another end we can read that bytes and convert back into original string. following code will help you to convert string to bytes and vice versa. public static String encod...

Deserialize object

This is required to deserialize an object or data while recieving data over the network. you can use following code to deserialize your object and return its encoded bytes like this : public static Object deserialize(String str) throws IOEx...

serialize object

This is required to serialize an object or data while sending over the network. you can use following code to serialize your object and return its encoded bytes like this : public static String serialize(Serializable obj) throws IOException ...

Restrict device to capture screen shot

For safety reasons in many application we need to restrict a user from capturing screen shot of a screen or an activity. In Android, we can easily restrict a user by applying FLAG_SECURE //Restrict screenshot getWindow().setFlags(WindowMana...

How to make Touch Listener Image in Android.

Here I have created and example of Touch Listener Image. In this example a image can pull left, right, up and down easily. It can be used to shift your mobile app icon left and right. For this in below code I have used MotionEvent() method. Below...

Re-using layouts with include and merge tags in Android

In most of the android application we have to reuse certain set of layouts. Every time writing same set of code(xml) slows down the user interface performance. To achieve the feature of re-usabilty in our application we have tags include and merg...

How to make Graphics app in android.

Here I have created graphic app. In below example I have used android.graphics.Canvas. The android.graphics.Canvas provides method to draw oval,rectangle,text,picture etc.And The android.graphics.paint holds the information of color and style. B...

Parse String in Date Format

In order to parse the String in date, first of all you need to check in which date format the String is coming. Then we will define date pattern accordingly. Following steps will guide you how to parse String in Date:- Step 1 Understand the ...
1 10 15
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: