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
How to create Swipeable View in android
In the below example I have created View Pager (View pager slider). Here I have added ViewPager in activity_main.xml layout, after that I have created slide_page xml layout, in that I have added a textview and in next step I have created fo...
How to create RippleDrawable button in android
In the below example I have created Ripple Drawable clickable button. Here first I have created RelativeLayout In Relative layout I have added a Button, after then I have created two xml layout in drawable folder first is one.xml layout in ...
Keep the Screen On
There are certain situations when we need to turn screen ON such as live map games, routing, movie, tv apps.
Basically, to avoid battery draining android device fall asleep after some time, but to accomplish this task we have to keep screen ON...
How to Add Title, Subtitle and Image in RecyclerView
In the below example I have created a RecyclerView, in RecyclerView I have added three category (Image, Title and Subtitles). I have also added four diffrent item in RecyclerView. First I have added RecyclerView dependency to Grandle file. and in...
Multidex with Gradle
When our application and libraries references reaches their limits, then we get some errors that shows we reached the limit of built architecture.
Like this
trouble writing output:
Too many field references: 131000; max is 65536.
You may ...
How to show the web page within your application using webview in android.
If you want to show web pages without opening browser application in your android application then make the use of webview as I have done below:-
1) to make your application access the internet use the permission"<uses-permission andro...
Detecting camera hardware
If we don't specify we require camera using manifest declaration, so we can check it at runtime that the camera is available or not.
To do this task, we have PackageManager class.
PackageManager has hasSystemFeature() method to check it...
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 = {
...
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...
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...
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 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 :
...