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

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

There is an Application to Receive the Intent or not in Android

Hi friends, For Implicit intent, we dont need to declare the name of the class but we declare the action that we are doing to perform. Like here we make a call Uri callUri = Uri.parse("tel:100"); Intent intent = new Intent(Intent.AC...

Get Country name without using location

Hi... Usually we get country name by using our location via GPS settings. But somehow on situations we need to get country name without using GPS. For these situation, Android provides Locale to get our device's country name. We are us...

How to get IMEI number,serial number and software version of your phone

Hello... Sometimes we need to know the country code, IMEI number, subscriber of a phone. Their is very simple solution, For this android gives facility to know it by providing TelephonyManager class. TelephonyManager have many methods t...

Logging in android

A very nice system is use for logging in android, usually called a centralized system. Developer can filter log statements by using android tools. We can create log statements by using android.util.Log class. Log class have so many methods l...

Generate SHA1 Key in android

In android we need to generate SHA1 key fingerprint to get Google Api key for Google Map. It just a one line command to generate SHA1 key. First of all create your .keystore file and sign to your app and take down this keystore lo...

Check Network Availability on android

We know that Its not possible that our android device should be always connected with a network. It might be a situation when we would not connected with any network, So to check it whether we are connected with any network or not. We check...

How to make listview scrollable inside ScrollView

If you apply ListView inside ScrollView, then the items of ListView will not scroll. By default the scrolling of ListView will not work if defined inside ScrollView. To make the scrolling work, use the onTouchListener. Below is the code to make l...

How to correctly use the AlarmManager class to execute a task at fixed intervals?

This Post ll help you to manage your alarm : AlarmManager am=(AlarmManager)getSystemService(ALARM_SERVICE); Intent alarmintent1=new Intent(MainActivity.this, AlarmReceiver.class); PendingIntent sender1=PendingIntent.getBroadcast(SpeedMotor...

Dp to Px converter and vice-versa

As we all know that Android works with dp size. But what to do if we have px values and want to check corresponding dp value ?. Don't worry try this - public static int pxToDp(int px, Context ctx) { DisplayMetrics displayMetrics = ctx.getRes...

Custom Toast in Android

Android give facility to change the view of a Toast. Sometimes we need to show message on a better way to user . Here I am writing code to implement custom Toast. I make a separate layout for Toast . Here I am showing a ImageView and TextVie...

How to implement a ListView in your Android application ?

This video tutorial describes how to implement ListView A ListView is a view group that displays items in a scrollable list. By the help of adapter, list items are automatically inserted into the list. We just need to set the adapter using setAd...

Scan Wifi networks in your App

Android give facility to access the Wifi Network in your Application. You can access nearly every information of the connection. Android have WifiManager API to handle all Wifi Connectivity.You can use it like this: WifiManager wifiManagerO...

Run Multiple AsyncTask on a Single Time

In android, thread pool pattern is use in AsyncTask. Early the size of the pool was 1 i.e, there was no support for parallel bunching of AsyncTasks.But from HONEYCOMB version Android allows multiple Asynctask at a time. We just have to use...

How to install android apk file on Emulator in Linux

To install apk file on Emulator Follow the below mentioned steps: 1.Go to platform-tools in android-sdk and Copy the apk file in it. 2.From your Terminal navigate to platform-tools folder in android-sdk. 3.Then use this command ./adb ...

Inserting data in android SQLITE table

Hi again, Here we are going to learn how to insert data in the already created table in android SQLITE. You will find it useful if you are aware of the basic terminology of the android SQLITE, if not and you want to create a table so it will be...

Creating a table in android SQLITE

There are situation when we need to maintain(store) data at our application level, this is mainly done when we try to execute functionalists at offline mode. So for these kind scenarios android sdk has provide us class known as SQLiteOpenHelper w...

How to send email using Intent in android

This tutorial is about sending the Email from your android code using implicit intents. Following is the code to send an Email- Intent emailIntent = new Intent(Intent.ACTION_SENDTO , Uri.fromParts("mail...

Android Powerful and optimized Image loader - Glide

Hi, Are you still working with Image Loader or Universal Loader library for lazy loading of images in listview. if yes then you should know that sometimes these libraries could give out of memory exception if you are fetching lots of images o...

Activity Context and Application Context in Android

Below are the differences between Application context and Activity context Application context and Activity context are the instances of Context but both of them are tied to different life cycles. Instance of Application context is tied to App...
1 12 14
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: