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

Sample Barcode Scanner Application

Here is a sample code of simple **Barcode Scanner** app. Barcode scanner library is attached with this project you just have send an startActivityForResult to open Scanner like this. Intent intent = new Intent(getApplicationContext(),Captu...

how to detect swipe left or right function on listview item in android

If you want to detect swipe gesture from left to right or right to left on the list view item in android. than you just have to add this Class in your activity and perform any task by detecting any type of gesture in your list item in android...

Remove all the previous activities from the back stack in android

Whenever you switch from one activity to another using intent and specially in the case of logout and sessions related android applications you will find activity back stack issue. Here i will show you a small piece of code which will help you...

How to improve selection criteria of your app using Radio button?

Radio Button A radio button is a two-states button that can be either checked or unchecked. They are normally used together in a RadioGroup. When several radio buttons live inside a radio group, checking one radio button unchecks all the others....

Creating shapes,Boder,selector and Drawable using xml in Android

This blog will help you to Create shapes,Border,selector and Drawable using xml in Android. 1.Selector for a button: Create xml file named background_selector.xml in res/drawable and write the bellow code in that <?xml version="1.0" enco...

Getting roundedCorner for an Image in Android

Sometimes we need to display images with rounded corners in our several Applications, and this can be done very easily by writing some lines of code. To get roundedCorner for an Image use the following code: /** * This method is used to ...

Post in FaceBook using your Android device via feed dialog

In many applications we have to share content, links etc on Facebook. We can achieve this by using Facebook feed dialog. The following lines of code explains how to use feed/publish dialog. First you need to get the app id and create a meta da...

Save ArrayList of Object into Shared Preferences in Android

Sometime we need to save ArrayList of Objects into Shared preferences so that we can use that data in multiple Activities when required. We can do that easily as below: Suppose we have model Users as below: public class Users { privat...

Easy methods of incorporating Google maps for Android

First create a layout for Map Activity. The name of layout is activity_main.xml <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" class="com.google...

How to display multiple images one after another in some time interval

Sometimes we need to display ads in our application.To display the multiple images one after another in some time interval write the following code: Create a customTimerTask class that extends the TimerTask class public class customTime...

getting contact information from contact list in Android

We can get a contact information for any contact from contact list of an Android Device easily. For this follow the steps below: Write the permission to read Contact's data into your AndroidManifest.xml <uses-permission android:name="a...

Load Image From Url

How To Load a Image Form a url You can use this class in your application to load image . It can be use by calling its DisplayImage(String url, int loader, ImageView imageView) function.This function there are three parameters first is Str...

Use existing sqlite database in android

I will show you the easiest solution, by far, is to use SQLiteAssetHelper. You add your existing sqlite database in a specified location in your project's assets/ directory, then use SQLiteAssetHelper to access your database (much same as you wo...

Adjust Image view width dynamically according to the screen size in android.

It is very difficult to re-size the image-view width according to the screen without losing the quality of the image or you can say increase the width in proportionate to height of the image view. I will show you the trick how you can do tha...

Finding Current Location in Android

To find the current location, follow the steps below: Create a dialog box to display loading message while finding the location ProgressDialog dialog=new ProgressDialog(this); dialog.setMessage("Please wait while getting your location in...

Make String with different colors in Android

We will use SpannableString to add different colors to a string and will use the setSpan(Object what, int start, int end, int flags) method of SpannableString to change the color for defined range of characters in that string. Here is the cod...

Using ViewPager for Screen Slides in Android

ViewPagers have built-in swipe gestures to transition through pages You don't need to add any animation. sample code : Set your main Activity layout as: in mainactivity Layout xml file set relative layout,in it set the view p...

How to change the Image orientation in Android

To change the orientation of an image write the following code: BitmapFactory.Options o2 = new BitmapFactory.Options(); o2.inSampleSize = 2; // Get the original bitmap from the filepath to which you want to change orientation // fileName i...

Play YouTube videos and other Webview videos in Android.

In android playing videos from web-view is such a mess but now just using a small trick you can play all web videos of the YouTube, Daily-motions, etc. You just have to add this method in your web-view Activity. Here is the trick-: ...

How to make your Android Applications better by applying the Drag and drop functionality

Drag and Drop functionality provides user a facility to move a data (or object) from one view to another. This tutorial will help you with the development of the Drag and Drop functionality in your android application. For this you require API l...

Get Facebook messages in Android

Note- Facebook provides 25 latest message conversation. To get Facebook chat messages in Android, following steps are used: Define the 'read_mailbox' property as below: private static final List PERMISSIONS = Arrays.asList("read_mailbo...

Playing with date format in Android

We can change date format of a date as below: Here, I have defined different date formats: String FACEBOOK_DATE_FROMAT = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"; String MESSAGE_DATE_FORMAT = "MM/dd/yyyy hh:mm a"; String MESSAGE_DATE_TIME_FORMAT = "M...

Getting MMS from an Android Device programmatically

To get MMS conversation from an Android device, use the following code: ContentResolver contentResolver = getActivity().getContentResolver(); Uri uri = Uri.parse("content://mms"); Cursor cursor = contentResolver.query(uri, null, "thread_id ...

How to get SMS from an Android Device programatically

To get SMS conversation from an Android device we will use following code: ContentResolver contentResolver = getActivity().getContentResolver(); Uri uri = Uri.parse("content://sms/conversations/"); Cursor cursor = con...

Associate your actionbar popup menu with the hardware menu button in Android.

Google Kills Android Menu Button, Replaces It with Action Bar But still so many devices have hardware menu button so now we can combine hardware menu button along with action bar option popup menu by just doinig a small trick. When you clicks...

Steps to download a file in android using Asynctask

Five Steps for downloading a file using AsyncTask in android Declare the reference of ProgressDialog class in your Activity globally. Ex:- ProgressDialog mProgressDialog; Instantiate the above reference in onCreate() method of activity...

Dynamicaly load more items to the ListView

To dynamically load more items to the ListView when you scroll at the bottom, we implement onScroll() method in which we can find out the which item is visible when we will reach at bottom it will load more items. Following steps are used fo...
1 12 14 next
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: