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

How to Search in a List using Search Button in ToolBar?

1)In your XML,make a ListView: <ListView android:id="@+id/mylist" android:layout_width="match_parent" android:layout_height="match_parent"></ListView> 2)Go to menu.xml and add a Search Button: <item an...

How to make Toast in android ?

Here I have created Toast function in android. Toast function can be used to display information or message for the very short period of time. In the below code I have explain how to make Toast function. lvList.setOnItemClickListener(new Adap...

Add items to RecyclerView at runtime

To add data to RecyclerView at runtime follow the steps mentioned below:- 1) Start a new project and add support library dependency <compile 'com.android.support:recyclerview-v7'>. 2) Declare layout for your activity(MainActiv...

How to get Latitude and Longitude On a button click using GPS?

1)Firstly in your XML,Make a Button and TextView : <Button android:id="@+id/btnMyLocation" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/mylocation"/> <TextView ...

How to make AlertDialog in android ?

Here I have created AlertDialog function in android. We can use alertdialog for choice to continue or discontinue. AlertDialog can be used to display the dialog message with OK and Cancel buttons. Android AlertDialog is the subclass of Dialog cla...

How to make Spinner in android ?

Here I have created spinner function in android. Spinner can be used to display the multiple options to the user in which only one item can be selected by the user. Android spinner works like dropdown menu. In dropdown menu there will be multiple...

How to add and remove items to RecyclerView in android ?

Here I have created a RecyclerView app in android. In this app we have added item in RecyclerView and when we click on the item in RecyclerView the item will be removed. In this recycler view I have used notifyItem Inserted() and notifyItemRemove...

How to create Registration form in android ?

Here I have created a registration form in android. In my registration form i have used validation function to check inputs like email ,name,age etc. And I have also used check box , radio button and spinner function. Therefor below example will ...

How to make Fragment app in android ?

Below I have created fragment app in android. In Fragment class we can insert a fragment into our activity layout by declaring the fragment in the activity's layout file. Fragment Features- 1. Fragment has its own layout and its own behavior w...

Retrieving Objects parse.com android

Hi, After saving object Saving Object parse.com Android Now I am writing here how to retrieve object using some key here using objectId. If you have objectId then it is very easy to retrieve object value. parseObject use ParseQuery to han...

Phone number Regex Java

Regex for mobile number validation with prefix of '+' ^[+][0-9]{12,13}$ Regex for mobile number validation with optional '+' ^[+]?[0-9]{10,13}$ Use in Code:- Pattern.matches("^[+][0-9]{12,13}$",mobilenumber); Ha...

Saving Object parse.com Android

Hi, Here I am writing way to save object to the parse cloud. Parse provides ParseObject to handle to saving object. ParseObject has saveInBackground() method that need to invoke to save. Let's consider you have to save EmployeeInfo. ...

Android Parse.com Simple SignIn

Hi, Here I am writing simple way to login after creating user in parse. Tutorial for Sign Up ParseUser handles all sign in and sign up functionality. We login through logInInBackground() method of ParseUser. We need to pass username and...

How to Save Data in Android

In below example I have created a save data app code in android. In this save data we can save our data and then load the back-up. In this I have also described how to make save data. public class MainActivity extends Activity { EditTex...

How to read sms from a particular date in Android

You can create a method readSMS() as shown below where you can pass date and time to read the sms from that particular date. private void readSMS(String date, String time) { // Now create a SimpleDateFormat object. SimpleDate...

Device Art Generator

To show your screenshots of device more attractive and you want to wrap the screenshots in a particular device artwork so it is very easy. Visit here submit png screenshot. and drag your screenshot png image in the device which you want t...

Android Parse.com Simple Signup

After set up and integrate parse.com on your project the important thing is to sign up or can say create users. Parse provides facility to their users to access their information in a secure manner. ParseUser is the class that handles muc...

Clipboard Android

Android gives us the facility to copy and paste the data by providing clipboard. We can copy text, binary stream, images or other data. Android provides ClipboardManager to handle all this. We have to instantiate the object of ClipboardMana...

How to generate debug SHA1 in android

Here I write command by which we can get debug SHA1 that is use to generate debug SHA1 in android. This SHA1 further use for Google Map V2. Below is the command keytool -list -v -keystore ~/.android/debug.keystore -alias androidde...

How to make ListView in Android studio ?

Here I have create a ListView app in android. In the Listview numbers of items shown in vertical scrollable list. In Listview items are automatically inserted to the list and In ListView Adapter pulls content and image from a source database cla...

How to make RecyclerView in Android studio?

Here, I have create a RecyclerView app in android .The RecyclerView is new advanced widget and flexible version of ListView.Below i have described step by step recycler view .. Step(1)- In (build.gradle) folder Add first dependencies . ...

Simple way to convert Json data to Java Model/Bean/Pojo

There is easy way to create Pojo/Bean class for any Json scheme. http://www.jsonschema2pojo.org/ Convert json data to Gson Pojo class: Copy and paste Json text to http://www.jsonschema2pojo.org/ Enter package name and class name f...

Phone number validation using libPhoneNumber Library

libPhoneNumber libphoneNumber Library is used to validate the phone number and it is a google's library mostly used by google products and Whatsapp phone number validation is important for app so that you can get valid number from your use...

Using Parcelable in Android

In simple words , Send the complete object to other views like (switching b/w different Activity). What if you need to send 50 value to other Activity, Don't write 50 putExtra to your code as it will increase the size of code ,just use Parcel...

Deep Linking for App content Android

Deep Linking enable user to enter into app from Search. For enable Deep Linking we must add intent filters for the relevant activities in application manifest. These intent filters allow deep linking to the content in any activity of applicat...

Butterknife (Easy way to Eliminate findViewById)

Remove findViewById calls by using @Bind on widgets and fields. Remove the click listeners by annotating methods with @OnClick and others. class MainActivity extends Activity { @Bind(R.id.user) EditText username; @Bin...

Code Analysis using FindBugs Plugin in Android Studio

Android has Lint for checking errors in Java and XML code. Lint release with every new SDK. But Lint is not find most type of bugs,exceptions and performance issue. I found one plugin for static analysis tools to analysis android Java cod...

Pull to Refresh using SwipeRefreshLayout like Gmail

This blog provide you simple Pull to refresh functionality with SwipeRefreshLayout. First of all create new project. Open xml layout file and create ListView/ScrollView/Gridview. Wrap ListView/ScrollView/Gridview with "android.support.v...

Snackbar in android

Basically snackbar use to show message like a Toast but here the advantage is we have event to interact in it. It shows message on the bottom of the screen. And it will remove when we swipe off. First of all add this in your gradle file d...

Built in Place Picker in Android.

Android has now a built in Place picker, where user can pick the places. Developer can only send an intent and get result in OnActivityResult. Requirements -Google play service greater than 7. public void onPickButtonClick(View v) { //...

Add custom ringtone on Notification

In our application, we can add notification ringtone as we want. Here is the solution. First of all we need to create a folder named raw in /res/ file. After creating the folder put your ringtone in raw folder. Then put this code when you...

How to know the call state in Android

Android provide us the facility to know the call state. Android gives this feature by providing Telephonymanager class. We need to implement PhoneStateListener interface that has one method onCallStateChanged(). Below is the example. publ...

Sliding animation when switch to other activity

We can add animation on activity switching. First thing that we need to do is to create xml for animation. Here I am using two xml for in and out. animation_in.xml set xmlns:android="http://schemas.android.com/apk/res/android" android:sh...

How to capture a video for particular time interval in Android

If you are looking to capture a video for particular time interval using default camera, then follow the below code to achieve the same. Record video from camera for 60 seconds private void captureVideoFromCamera(){ Intent intent = ne...

Custom EditText - Clear all text in Editext

It is very common that the Android's Edit text needs to clear all filled data in one hit, rather than clearing every single text using keyboard's 'X' button. It is a good practice that enable user to clear all the text using Edit Text drawable...

New Location Dialog from Android Settings API

Enable a system location dialog ,asking user that app needs to find the current location This dialog is from Android Settings API public class LocationData implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedL...

DVM in Android

DVM i.e., Dalvik Virtual Machine is basically a virtual machine for android and specially made for mobile devices. DVM was written by Dan Bornstein. Now a days JVM has improved so much that it provides amazing memory management and better p...

ATTACH SQLite Database

Hi, Sometimes, we have many database and we need to use any one of them. In this situation we use SQLite ATTACH DATASE statement to choose a specific database. Syntax of the command: ATTACH Database YOUR_DATASE_NAME As Alias-Name; ...

Animation to DialogFragment in android

Hi, Here I am adding sliding animation to DialogFragment First I am adding animation xml in res/anim folder. Then creating custom style that add to the particular fragmentdialogs's onStart() method. slidestart.xml <set xmlns:a...

Automatically move to next edittext in android

Hi, In android, we have TextWatcher interface to keep track of input that we are typing. Usually it is very useful when we need verification on the basic of text length and content also. It has method onTextChanged(CharSequence s, int star...

Spelling Checker in Android

Android provides a special feature for checking spelling and it is easy to implement in your App. Android provides SpellCheckerSessionListener listener that handles spelling checker. For spelling checker, we have to implement SpellChe...

Custom Fonts in Android

Android gives us the facility to customize our strings font. For this we need to keep .ttf files of the specific font in assets/fonts folder. We can easily download ttf from internet that we want to apply. Then we use Typeface class t...

Communication between Fragments

Here I will explain how we can communicate between two fragments in an Activity. There are many situations where we have to communicate two fragments like we have to pass data between fragments in some events. Here I will communicate through Inte...

Add Dynamic Layout in Android

Generally we add layout from xml but sometimes we need to add layout using java. Here I am adding linear layout from java file. I am creating LinearLayout class which is provided by Android and add params on it. We have methods to set orientation...

Different Language Support in Android

Android gives us the facility to support different languages in your application. The solution is very easy, you just have to define separate values folder for each language and define every String there. You need to add a hyphen and ISO language...

TextClock in Android

Hi Friends, TextClock is used to show the current time or/and date. In TextClock we use formatted String to show the time or/and date. Basically it is a digital clock added from Api level 17 replacement of DigitalClock. By using this method we ge...

Change brightness of the device in Android

Hi, Here I have written this code to change the brightness of the device in our application. I use the seekbar to change the brightness of the device. To handle the System Settings I use ContentResolver class and to handle current window referen...

Analog clock in Android

Hi Friends, Analog clock is a two handed clock, one shows hour and other shows minutes. It looks like a normal clock. Android provides AnalogClock to show the time. Here is the code :- Button buttonClock = (Button) findViewById(R.id. chang...

Setting listview and pager together in a scrollview

Putting listview and viewpager or anyother view together in Scrollview is not good habit but sometimes it's necessary to do So in that case we can use that following method to set listview height at runtime so that we can scroll listview as well ...

Gradient Drawable in Android

To make Button,TextView,Images and other android components looks better and stylish, we create Gradient drawable. For using Gradient drawable, we can make shading effects and make better GUI. We need to create drawable folder inside the re...
1 12 14 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: