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
Inspect Code Android
Java code file is neccesary to run the particular project and sometimes java file contains 100 lines of code or more and in that case,there are more possibilities to get error(on in future,will get error).So in this case,Android provide a feature...
How to search from a list in android?
We have a search edit text and a list in layout , activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_...
Easy way to add RenderScript Supprot in Android Studio
RenderScript is used to run high performance tasks in Android. RenderScript is plateform- Independent.
RenderScript added from API-17 but added support later.
For adding support for RenderScript in Android Studio add below lines in build.gr...
How to create a thread ?
Thread is basically used to execute something in android. Thread class provides start method to start a new thread as well as we can also use Runnable interface to create some thread.
So there are two way to create a thread that are :
1. By...
What is looper in android ?
We know that a normal thread doesn't maintain any message queue they runs one after another but in case we want to performs more thread then we used looper class to maintains all runnable messages in queue and runs them one by one .
Here i...
What is main and background thread and how to touch ui from background thread ?
Multithreading is a meachanism where a one user can access more than one process or you can say that an operating system can perform more than one operations simultaneously.
In Android we have two types of thread that are Main thread and...
Creating Keystore from Terminal or command Prompt for android
Now a days android studio has provided pretty simple and easy GUI for creating key-store from the IDE itself but in case if you have some need for creating it through the command line here is a simple tutorial for the same.
Step 1. &...
How to show the full size image in popup on clicking the image in android
Below is the code that will show the full size image in a dialog box popup without defining layout xml file .
In the code below I have taken two imageview named profile_pic and pro, to get the OnTouchListener action of particular ima...
Deletion of node from binary search tree in java
Like a linked list we can also delete a node from binary search tree. This operation perform O(log(n)) time complexity.
Here is an example of deletion :
private TreeNode delete(TreeNode rootNode, int k)
{
// create a node to store tem...
How to make multi pane layout for Mobile Phone and Tablet
In this example,we will have a layout in which there are two fragments in an activity.
In our mobile phone,we will show only one fragment but in tablets,we will show both fragments simuntanously.
activity_main.xml (for mobile phon...
How to add Volley in Android Studio?
In 3 basics steps,you can add volley to your project:
Step 1:First, you need to get the Volley source code:
Use Git to checkout the source code for Volley, preferably to the filesystem where your Android project lives.
git cl...
How to keep your android app popular even after launch?
Imagine that your android app has been launched in Google Play Store for users to download and install it on their android phones or android tablet computers and the app has been doing well in the market. Your app has started to generate interest...
Tutorial on Services in Android
Below points are covered in this tutorial
What is a service
Usage of a service
Services Vs AsyncTask
Types of services
How to create rotate animation buttun in android
In the below example I have created rotate animation button. In below code I have used scale and translate effect on rotate animation button. Here I have added Button in button i have used an img and added a TextView in activity_main xml la...
How to create alpha effect animation button android?
In my previous blog I have explain how to create animation button in android. Now in this below example I have created new animation button which is alpha effictive.
Here I have added Button and TextView in activity_main xml layout then I have...
How to create Animation button in android
In the below example I have created a animation button. 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 new anim_traslate.xml layout. In MainActivity I ...
Binary search tree insert item implementation in java
Binary search tree is an extension of linked list data structure that contains node. Insertion in tree is easy. This tree contains a root and child node where left hand sided node always lesser than parent node and right hand sided node always ha...
How to add new element in ArrayList.
The below example will help you to add new element in arrayList. So, when we have new element list item shifts the element currently at that postion and any subsequent elements to the right which will help to insert new element at the speci...
How get user input on same xml. Layout in android
In the below example I have created a demo page for user input. Here when user will enter name and phone number then user name and number will show on same page. Here I have created first Relative layout then in relative layout added ...
Vector Graphics in Android.
Hello Friends,
In this blog we will learn about VectorDrawables and change icon color on Runtime.
From Android Studio 1.4 Google release new feature to support Design library.
VectorDrawable has introduced in API 21(has support for lower v...
Queue implementation using linkedlist in java
We know that linkedlist is type of Data structure using linked list we can store item of same type.
Queue can be also be implemented using linkedlist.
In this example we have two node that are head(Front) and trail(rear) where we can insert...
Queue implementation using Array in java
Queue is a kind of Abstract data structure that holds items in same order. Queue follow FIFO mechanism for operations like insertion and deletion of items.
Note :
- One end is always used to insert data called enqueue.
- Other end is alw...
running apps over wifi
Getting messed up with usb cables on your desk or tired of buying new usb cables every week ??
Here is a new way for running your apps and debugging them without connecting them to your pc using usb cable.
Just a set of commands and yo...
Stack implementation in java
Stack is used to store particular type of data. Stack is a memory area where we can store all local variables and parameters used in our functions.
In Stack we can perform three operations that are :
Push - to add something in stack with co...
traverse and reverse double linked list in java
Traverse and reverse a linked list takes time complexity of O(n).
Traverse a double linked list requires only node next reference until it reach to trail or null value :
public void traverseLinkedList(){
Node<T> tempNode = st...
Deletion in double linkedlist in java
Deletion of item from double linked list st known position takes O(1) complexity while deletion at some specified position takes O(n) time complexity.
In deletion we basically removes the pointer of that item. First of all check the reference ...
Insertion in double linked list in java
Double linked list is a type of data structure that contains data in linear way but its different from single linked list because we can traverse in both direction in list. This provides previous and next pointer and node value.
Insertion in d...
How to remove item from ArrayList
The below example will help you to remove an Arraylist item using the element index. To remove an item from an arrayList I have used Object remove (int index) method. This method returns a reference to the item that was removed. You can see below...
Screenshot with Frame in android
Android studio gives a feature to create frame for your Screen-shots. It is useful and looks good at the time of publishing app on GooglePlay.
Here are the steps to take Screen-shot with frame in Android Studio.
1. Open DDMS from Android Mo...
Screen Recording with Android Studio
Hello Friends,
Sometime we need to record Android Screen as Movie. This is very useful for Bug reporting and for app promotion.
Android Studio has ability to record device's Screen as movie. Android studio give button in DDMS to record vi...
How to make Custom Animation switching Activity
In the below example I have created Custom Animation while Switching Activity. Here I have created two activity, In first activity I have added left and right xml using methodTransition() and in Second activity I have added top and bottom xml. Al...
How to make Publication Article page layout in android
In the below example I have created PublicationArticle layout. Here Frist I have created LinearLayout and then created all layout within main layout after then I have added scrollbar in main layout, In scrollbar I have added TextView, Image View,...
How to reverse linkedlist in java ?
There are two way to reverse a linked list that are using recursion or using iteration.
This operation takes O(n) time complexity during iteration method.
Here is the code to reverse linked list using iterator :
public void reverseLinked...
How to merge linked list in java
If we have two sorted linked list and we want to merge both in a new list without creating new node space then we can use recursive approach for this . This approach takes O(max(m,n)) time complexity for merging.
Like we have a linked list nam...
Deletionin linkedlist in java
A linked list is type of data structure that contains items in linear order. Deleting an item from linked list performs O(n) time complexity. you can perform two type of deletion from linked list either you can delete first item of list or in any...
How to create registration screen design in android
In the below example I have created registration page layout. Here FIrst I have created LinearLayout and then all layout within a main LinearLayout after then I have added Toolbar, scrollbar, TextView, ImageView I have also used RelativeLayou...
Linked list implementation in android
Linked list is a type of data structure that is a collections of nodes where nodes linked to one another using some pointer or reference. linked list is efficient for insertion operations because it uses two pointer head and trail that make it ea...
How to change icon and color of FloatingActionButton
Here I am writing the way to change the color and icon of FloatingActionButton.
If I talk about icon of the action button, we need to fulfill of requirement and purpose of Floating button.
So we need to change the icon of the FloatingActionBu...
Slide Top to Bottom View Animation
To show animation on any view like on ImageView, I am implementing animation to show slide a view from top to bottom.
We need to create an xml file in anim folder. Here name top_bottom.xml
<?xml version="1.0" encoding="utf-8"?>
<s...
How to get your latitude and longitude in android.
Follow the steps mentioned below to get your location latitude and longitude
1) Create a class and name it LocationManger.java and impliment GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener in ...
ImageView takes Full Width
Below is the code to adjust ImageView taking full width.
It is mainly required when we need to show cover photos which take the full width of the screen.
The images that are in landscape looks ok, but we find a problem with the portrait pic...
Open facebook, twitter and linkedIn user profile using username
Sometimes we need to open user profile of Facebook, Twitter or LinkedIn by using the username in android.
To do this, we just create a uri to open the profile.
We can implement this in onclick() of any view.
For Facebook:
String url =...
Creating Svg in Android
Creating Svg images reduces the effort of putting different resolution drawable (png's).
Steps to Create Svg images.
Right Click on drawable folder,Select New ,Select Vector Image. (view attachment vector_asset.png).
Choose the material ...
Saving data into internal storage location in Android
Android provide many ways to store or save data of an application, like Shared Preferences, internal storage,external storage, SQLite database and storage on network.
Here we will learn how to save data in the internal memory of the android de...
Shared Preferences in Android
Android provide many ways to store or save data of an application, one of the method is using Shared Preferences. Shared Preferences are used to store and retrieve primitive data information(such as int, boolean, and String). The data is stored i...
Activity and its life cycle in Android?
An activity represents a single screen with user interface(UI) i.e.,a window with which you interact with your android phone.
It is a pre-defined class in Android and every android application which has a UI must inherit it to create a window.Us...
How to Draw path between two locations
In the below example I have created Drawing Polyline and Markers along the tapped position in Google Map. Polyline is a list of points where line segment are drawn between consecutive point. Here I have created fragment attribute in activity_mai...
How to change particular text font size in class using ttf file
In the below example code I have changed particular font size by using ttf file. Here I have added ttf file in assets folder using TypeFace class, I have also included zont zip file. You can see the below example it will clearly describe you How ...
How to set text in Toolbar in android
In the below exmaple I have created Toolbar. Here I have used In activity_main xml.layout a toolbar and TextView, and In MainActivity I have used toast function. You can see the below example it will clearly describe you how to create Toolbar wi...
How to create Floating action button using single LinearLayout layout
Hello Friends,
In my last blog I have explained about how to create floating action button using CoordinatorLayout, LinearLayout, TextView and FloatingActionButton. But in this tutorial I have created a new floating action button layout using s...