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
Image Crop in Android
Image cropping in Android, there is a support in some devices by default for cropping image but its not reliable, so here is some code to get rid of this problem.
Step 1. Declare crop activity in your manifest like this :-
<activity an...
How to catch changing of View Pager slides
After creating a ViewPager (as I also described here ViewPager) we need to catch the changing of slides event.
To do this we have a listener OnPageChangeListener i.e, ViewPager.OnPageChangeListener that invokes whenever we chance the page or i...
How to upload large apk size on play store using Expansion Library Tutorial
Its usage: To break the barrier of apk size to upload on Play Store
Libraries needs to be installed: Google Play Licensing Library package
Google Play APK Expansio...
How to create OverShoot Image animation function in android
In the below example I have created Overshoot animation function. Here I have added Button and ImageView in actvity_main.xml layout then I have created new directory (anim). In anim directory I have created overshoot.xml layout and In MainA...
How to create linear Image animation function in android
In the below example I have created linear animation function. Here I have added Button and ImageView in actvity_main.xml layout then I have created new directory (anim). In anim directory I have created linear.xml layout and In MainActivity I ha...
How to add title, subtitle and Image in List View
In the below example I have created a ListView in ListView I have added title, subtitle and image. Here first I have added ListView in activity_main.xml layout, then I have created new list_item.xml layout here I have created Relative...
How to create cycle Image animation function in android
In the below example I have created cycle animation function. Here I have added Button and ImageView in actvity_main.xml layout then I have created new directory (anim). In anim directory I have created cycle.xml layout and In MainActivity I have...
How can used volley library & volley methods in android app
In the below example I have created simple demo app used with volley library. First I have added volley support library in build.gradle file, Then I have added Button and Listview in activity_main.xml. I have created a new list_view.xml layout an...
How to create anticipate Image animation function in android
In the below example I have created anticipate Image animation function. Here I have added Button and ImageView in actvity_main.xml layout then I have created new directory (anim). In anim directory I have created anticipate.xml layout and In Mai...
How to detect whether the android device has Internet connection or not?
If your android app is dependent on internet then you need to check whether your device is having internet connection or not at the starting of your app, so to check the same copy the code below :-
To know the Network state in your app you nee...
How can used Static JSON Parsing in Android
In the below example I have created Static JSON Parsing program in android. First I have added two TextView within RelativeLayout. In MainActivity I have used JSON object and JSON array JSON object within curly bracket ({) and J...
Image slides using ViewPager
To show slides of images, we use ViewPager in android that provided by the support library.
First of all add images that we want to show in drawable folder.
Then create array of these images.
private int[] mResources = {
...
What is Daemon thread in java ?
In java any thread can be a Daemon thread. Basically daemon thread are those that works in background to support or to provide services for users threads running in same process.
If there are no any user threads available while daemon threads ...
How to create CollapsingToolbar function
In the below example I have created Collapsing Toolbar function. Here I have created CoordinatorLayout and created all layout in CoordinatorLayout. Now I have added AppBarLayout, CollapsingToolbarLayout, ImageView, Toolbar, RecyclerView and Float...
Sting Builder vs String Buffer in java
We know that Strings are immutable or constants but String builder and String buffer are basically used to provide dynamic implementation of Strings.
But String Builder is not thread safe that means more than one process can access or modify t...
How to create CollapsingToolbarLayout with using Recyclerview
In the below example layout I have created CollapsingToolbarLayout with using Recyclerview. Here first I have created CoordinatorLayout created all layout in CoordinatorLayout. Now I have added AppBarLayout, CollapsingToolbarLayout, ImageVi...
What is anonymous inner class in java and how to implement interface in annonymous class ?
Anonymous means no name, a class with no name called as Anonymous class. But is has advantage like to create an instance of class in one step.
We can'e create an object of this class since it has no name.
An anonymous class can implemen...
Transient varialbe in java
We know that serialization is the process that converts java objects or data into bytes stream on one end and on other end we deserialize it that means convert bytes into orignal data.
Serialization means to save data after serializa...
How to use different font style in android.
To make use of different font style in your android project follow the steps mentioned below:-
1) Create an Assets resource directory in the main Directory of your project.
2)Now download the font style that you wish to use in your project ...
How to create Circular Reveal Animation And Ripple Effect
In the below example I have created Circular Reveal Animation like chat app(Whatsapp). First I have created activity_main.xml layout, here I have added FrameLayout, all layout and attributes like LinearLayout, ImageButton, TextView, Vie...
How to create Bounce Text animation function in android
In the below example I have created a Bounce Text animation function. Here I have added Button and TextView in activity_main.xml layout then I have created new directory (anim). In anim directory I have created bounce.xml layout and in MainActivi...
How to add RecyclerView in dialog box
In the below layout example, I have created a dialog box with RecyclerView. Here I have added first RecyclerView dependency to Grandle file. Now in next step I have Created a Main RelativeLayout. All layout added in Main RelativeLayout then creat...
How to move to next image through swipe in android
For changing the image on swipe can be done by implementing the ViewPager in your android app.
For implementation of ViewPager we need to follow the steps mentioned below:-
1) Create ViewPager tag in your xml file .
activity_main.xml
...
Android app development for Beginners 1
In this tutorial following points are covered:
1. Getting started with Android application development
2. Installing Java JDK
3. Installing Android studio
4. Creating android studio project
BroadcastReceiver in Android Tutorial
What is a BroadcastReceiver: Application component
Its usage: Notify the receiver for an event
How we can register broadcast: Static & dynamic
Lifecycle of a BroadcastReceiver
Key points while implementi...
How to create Toolbar text animation in android
In the below example I have created Toolbar text animation function. Here In activity_main.xml layout first I have created Toolbar and added a TextView, then In MainActivity I have used ObjectAnimator class. You can see below program it will clea...
Copy Text from android application
I am writing code to copy specific content on any event.
Android provides clipboard-based framework to do this task.
Clipboard is represented by ClipboardManager class. To instantiate it, we need to call getSystemService(CLIPBOARD_SERVICE)
T...
How to design Business details layout in android
In the below example I have created Business details screen layout. Here, first I have created LinearLayout and added all layouts in this Main(Parent) LinearLayout, After this I have added ScrollView for page scrolling. I have also used Tex...
How to create ListView in android.
To create ListView in your android app follow the steps mentioned below:-
1) Define ListView in your xml file where you wish to show list view.
activity_main.xml
<LinearLayout
xmlns:tools="http://schemas.and...
How to create Accelerate image in android
In the below example I have created a Accelerate image function. Here I have added Button and ImageView in activity_main.xml layout then I have created new directory (anim). In anim directory I have created accelerate_decelerate.xml layout ...
Pop Up Menu Android
Pop up menu simply show Menu in a pop up window anchored to a View.
It displays the pop up below the anchor view if it finds space otherwise above the anchor view.
If we touch outside of it, then it will dismiss the pop up menu.
First, w...
How to design New user Sign Up form layout
In the below layout code I have created a new user Sign Up form page. Here I have created first LinearLayout all layout added in this Main LinearLayout, In below code I have also added ScrollView, Relative layout, ImageView, TextView. In dr...
Logout parse.com android
When we login through parse.com so at the time of logout, we need to clear the current user.
We need to simple use method logOut() of parse.
Below is the code
ParseUser.logOut();
ParseUser currentUser = ParseUser.getCurrentUser(); // ...
How to create custom toolbar and use the same in different activity in android.
Here we will learn how to create custom toolbar and use it in different activity using <include> tag in xml file of the activity.
1) We will design the layout for the toolbar in our project's layout directory, I have named it as mtoo...
How to create activity as a dialog?
We know that Alert dialog boxes are used to show some popup to user so that user can perform some action. But with Activity dialog you can manage the visibility of dialog based on activity life cycles.
To create an activity as a dilaog we have...
Button always showing text in uppercase-solution
I found that sometimes button showing text in upper case.
I have found the solution that we just need to define property textAllCaps in the xml file.
For example
<Button
android:layout_width="match_parent"
...
Delete a row from a table in parse.com
Hello,
It is very simple to delete an item or row from any parse table from the code.
First, we need to create the object of the table that points that particular row and then delete it.
I create an object using object id and t...
How to use SignalR Library in android at client side?
This tutorial help you to create a real time chat applications using SignalR library.
SignalR Lib is an open-source lib introduced by .Net Framwork. Its very easy to use for building applications that require live user interaction or real time...
How to pass data from one fragment to another in Android?
To pass data from one fragment to another in android we simply make use of Bundle .
In this example I am sending three String from MainActivityFragment(Fragment) to SecondFragment(Fragment) with the help of Bundle.
Below i...
How to create Floating Action Button Animation in android
In the below example I have created Floating Action Button Animations. Here I have added four FloatingActionButton, then in second step I have created button_open, button_close ,rotate_forward, rotate_backward xml layouts ...
How to create a Spalsh Screen in Android.
Since we know that the "Splash Screen" just appears for the few seconds as the app get start so we need to add the time for how much second the splash screen would be shown, so to add Splash screen in Android app follow the step...
How to open Camera using intent on button click.
Here we will learn how to open camera in android, to open Camera in the android app we have to add
<uses-permission android:name="android.permission.CAMERA"/>
permission in our manifest file.
In this example I&...
How to create popup layout
In the below example I have created popup layout. In popup.activity layout, First I have created LinearLayout, In LinearLayout I added a TextViw and Button, then in step second I have created rounded.xml layout & in drawable folder, here I ha...
How to create dialog with cross button layout in android
In the below example I have created a dialog button layout. Here I have created a main.activity layout, In main.xml layout first I have created Relative layout and added all layout in this Main Relative layout then I have create...
How to open Calendar on clicking the EditText and set the date.
To open Calendar on Clicking the EditText follow the steps mentioned below:-
1) Create a Edit Text in your xml file.
activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="ht...
Access Main ui from background thread in android
We know that in android only main thread can touch the UI but there are some severals methods that can touch the UI from background thread that are following as :
1. Handler
2. PostDelayed
3. RunOnUIThread
4. AsyncTask
1. Handler i...
How to create 9Patch Image
A 9 patch image is an image that has stretchable areas defined. These areas are defined in a special 1 pixel wide border around the area. Add black pixels to the top and left of this border to describe
where the image can be stretched horizontal...
What is Thread pool in Android and how to use it ?
Thread pool basically manages the pool of worker thread or it manages the collection of runnable and worker threads execute Runnable from queue.
Here is an example of creating threads 20 times and calling its runnable methods like this :
...
How to make custom button in android
To make Custom Button in android follow the steps mentioned below:-
1) Create a drawable resource file in your drawable folder and name it custom_button.xml.
2) Add the code written below in your custom_button.xml file .
custom_but...