Android is so popular today, there are billions of android devices in the market from mobile phone to television. There are also so many android app exist in the app store market. If you want to learn how to develop android app, please read this tutorial, it will provide you a lot of examples about android app development.
- Android Frequently Asked Questions
Collect all popular android questions from internet, and provide short and effective answers.
- Android Hello World Example
This article will show you how to use android studio to create android Hello World example. It also explains the main example files and their role and relation.
- Android LogCat And Logging Best Practice
This article will show you how to write log in android application. It also tell you how to get crashed log data from logcat to text file using adb.
- Android Development Environment Setup
Before you can develop android app, you should first setup android development environment. This article will show you how to do that step by step.
- How To Create Android Virtual Device (AVD)
Before debugging and testing android application, you should create an android virtual device ( AVD ) to start a simulator. You can specify special configurations for your avd, and then start it for debugging and executing applications.
- How To Create New Android Studio Project
This article will show you how to create a new android studio project. You should read article Setup Android App Development Environment first to learn how to install android studio in your computer.
- How To Open, Close, Save Android Studio Project
This article will show you how to Open, Close or Save android studio project. It will also show you how to browse project folder or file’s physical hard disk directory in android studio.
- How To Create Activity In Android Studio
Activity is a very important component in android application development. It represent a screen which is used to interact with phone user.
- How To Create Java Class In Android Studio
In android development, java class is commonly used to implement business logic process such as database access, send email, send short message etc. We always use one java class to encapsulate some related functions.
- How To Run / Debug Android App In Android Studio
Android applications can be executing or debugging in either virtual device or real device. But it can be executed or debugged in only one device at the same time. This article will show you how to do that.
- Debug Android App With Android Studio Examples
When you execute an Android app after coding, you may always meet bellow error in device simulator. The simulator popup a dialog to tell you the android application has been stopped.
- How To Create Android App Publishable APK File
When you finish your Android app coding and testing, if you want to publish it to google play store, you should create a publishable apk file. This article will show you how to create publishable apk file step by step.
- How To Enable USB Debugging Mode On Android Device
If you want to run android app automation test using Appium in physical android device such as phone or pad, you need to first enable USB debugging mode in your physical android device and then connect it with your PC using data line.
- How To Use Android Debug Bridge (ADB)
ADB is a powerful tool, it is abbreviation of Android Debug Bridge. It is located in
C:\Users\Jerry\AppData\Local\Android\sdk\platform-tools. It provide a lot of useful sub commands for android developers to operate between android physical or virtual device and computer.
- Android ADB Install / Uninstall App Examples
This example show you how to install / uninstall android apps use android debug bridge (ADB) or android device control panel.
- How To Define Custom Color Variables
Besides android built-in color constants, you can also create custom color variables yourself, this article will tell you how to do that.
- How To Read String Value Array From strings.xml In Android
This example show you how to define string value and string array value in android strings.xml. It also explain how to read those string values in both xml file or java source code.
- How To Auto Import All Class In Android Studio
This article will tell you how to configure android studio to automatically import all classes in java source code.
- How To Change Minimum Sdk Version In Android Studio
This article will tell you two methods to to change both android minimum sdk version and target sdk version in android studio.
- Android Explicit Implicit Intent Example
This example introduce explicit and implicit intent for android. It also demontrate how to create and use explicit and implicit intent to start Activity.
- Android Activity Lifecycle Example
This article introduce android activity life cycle and contains examples to show different life cycle methods of activity.
- Android Save Retrieve Activity Instance State Example
This article will show you how to store and retrieve activity instance state data with examples.
- Activity Launch Mode – Standard SingleTop Example
This article contains examples to introduce use activity in standard and singleTop launch mode.
- Activity Launch Mode – SingleTask SingleInstance Example
This article introduce other two singleTask and singleInstance activity launch mode with examples.
- Android Activity Best Practice
This article introduce three best practices when develope andorid activity.
- Android Broadcast Overview
Introduce android broadcast principle, type and receiver registration with example code.
- How To Register BroadcastReceiver In Android Activity
This example show you how to register / unregister broadcast receiver in android acivity programmatically. It also shows how to open android settings panel programmatically.
- How To Register Android BroadcastReceiver Statically
This example tell you how to register android broadcast receiver statically in AndroidManifest.xml file.
- Android Keep Broadcast Receiver Running After Application Exit
This example tell you how to run broadcast receiver in android background service object.
- Android Send Custom Broadcast Example
This example demo how to implement both normal and ordered custom andoird broadcast. It also shows how to abort broadcast in ordered broadcast receiver chain.
- Android Local Broadcast Manager Example
This example show you how to use android.support.v4.content.LocalBroadcastManager to send in-app broadcast internally.
- Android Force Logout Use Service And Broadcast Example
This example shows how to use background service and broadcast receiver to implement force logout in android login feature.
Android Content Provider
- Android Content Provider And ContentResolver Example
Introduce android content provider and contenresolver and how to use them to share data between different android apps to make app data safety.
- Android Contacts Database Structure
Introduce all android contacts tables and table structures with example.
- Android Contacts Fields, Data Table Columns And Data Mimetype Explain
Explain which data column is used to save what android contact field info by contact data mimetype.
- Android Add Contact Programmatically Example
With examples about how to use ContentResolver to read exist android contact list and add new contact.
- How To Add Contact In Android Programmatically
This article show you examples about how to add each android contact field info into contact data table.
- How To Get Contact List In Android Programmatically
Tell you how to read android contacts programmatically and how to avoid database cursor index out of bounds exception.
- How To Update Delete Android Contacts Programmatically
Examples about how to update, delete android contacts use content provider programmatically.
- Android Custom Content Provider Introduction
Tell you how to implement a custom content provider to share data to other apps to access.
- How To Create Android Custom Content Provider Example
This article show you how to implement a custom android content provider with examples.
- How To Invoke Custom Content Provider In Other Apps Examples
This article tell you how to invoke above custom android content provider with examples.
- How To Open Camera In Android Programmatically Using Intent
Example about how to invoke android camera and show camera taken pictures in image view.
- How To Use Android FileProvider To Share Files Between Apps
Example about share files between dfferent android apps through FileProvider class.
- Android Pick Multiple Image From Gallery Example
This example tell you how to pick multiple images in android app programmatically.
- How To Get Real File Path From Android Uri
Tell you how to retrieve android file chooser returned document uri’s real local file path.
- Android Multiple Fragments In One Activity Example
This article introduce android Fragment and how to use it. It also includes examples about how to communicate between Fragment and Activity.
- Android Add Fragment To Activity Dynamically Example
This article show you how to use android Fragment dynamically with examples.
- Android Fragment Back Stack Example
This article contains example about how to use fragment backstack to save and return fragments.
- Android Fragment Save / Retrieve Instance State Example
This article has an example about how to save or retrieve instance state data in Fragment.
- Android Fragment Lifecycle
This article introduce android Fragment lifecycle and related callback methods with examples.
- Android Fragment Menu Example
This article introduce how to add menu items for android Fragment and how to handle and distinguish menu item click event between fragment menu item and activity menu item.
- Simple Android News App Compatible With Phones and Tablets
This example show you how to use RecyclerView, Fragment, Qualifier, PercentRelativeLayout to implement a simple android news reader app.
- Android Play Local / Web Audio With ProgressBar Example
Show how to play audio file and show it’s progress in android. The audio file can be local file or a web file located by url.
- How To Grant Write Settings Permission In Android
This example show you how to resolve android security error do not has WRITE_SETTINGS permission.
- Android Marshmallow Runtime Permission Example
This article introduce android runtime permissions from android 6.0 (Marshmallow). Contains examples about how to use them.
- Android Change Screen Brightness Programmatically Example
This example tell you how to change android device screen brightness programmatically.
- Android Change Screen Brightness Use Seekbar Example
This example shows how to use android seekbar to adjust screen brightness.
- How To Create, Start, Stop Android Background Service
Tell you what is and how to create and start, stop android background service component.
- Android Device Monitor Cannot Open Data Folder Resolve Method
This article tell you how to use android device monitor and how to reolve data folder can not open in android device monitor.
- Android Read Write Internal Storage File Example
This article tell you how to read write android internal file for general files and cache files.
- Android Read Write External Storage File Example
Show you how to read write android external storage files with examples.
- Android Shared Preferences Example
Introduce what is android SharedPreferences, and how to use it to save and retrieve data.
- Android Sharedpreferences Save/Load Java Object Example
This example tell you how to save / retrieve java objects use Sharedpreferences.
- Android SQLite Database Introduction
This article introduce where android sqlite db located, how to create it and how to manipilate it’s table and data.
- Android SQLite CRUD Operations Examples
This article show you how to use SQLiteOpenHelper and SQLiteDatabase class to implement create, read, update and delete operations in android SQLite.
- How To Write Reusable Code For Android SQLite Database
This example show you how to write reusable java class to operate different android SQLite database and tables. Includes database create, upgrade, insert, update, delete and query table data.
- How To Show Data From SQLite Database In Android ListView
This example tell you how to use android ListView to load, add, edit, delete and refresh data from SQLite database.
- Android Update UI From Child Thread Example
Tell you how to use Handler and Message object to update android UI in child thread.
Android UI Design
- Android Custom View And OnTouchListener Example – Move View On Touch Move
This example will show you how to create android custom view component and how to use OnTouchListener to create a color ball follow user finger’s move.
- Android Radio Button Example
This example will show you how to use RadioGroup and RadioButton to implement radio button UI component.
- Android CheckBox Example
android.widget.CheckBoxclass is used to implement CheckBox UI component. This artcile will show you how to use it and how to register event listener on it to process checked change event.
- Android AutoCompleteTextView Example
android.widget.AutoCompleteTextViewclass is used to create auto complete user input component. This article will show you an example about how to use it.
- Android Multi AutoComplete TextView Example
This example show you how to use MutiAutoCompleteTextView class to implement multiple auto complete input text box. And how to modify it’s attributes both in xml and java code.
- Android SpannableString Example
This example show you how to use SpannableString to implement some colorful and diverse String effect in TextView.
- Android ReplacementSpan Example
This example will show you how to customize span content in spannable string use a sub class of ReplacementSpan class.
- Android ToggleButton Example
This example show you two examples about how to use ToggleButton widget in android app.
- Android Spinner Example
This article contains examples about how to use android Spinner properties and how to customize Spinner adapters.
- Android Splash Screen Example
This article contains two examples about how to implement splash screen for both fix show time and uncertain show time.
- Android Progress Bar Example
This article will tell you android progress bar properties and sytles. It will also show you example about how to customize progress bar for your needs.
- Android SeekBar Example
This article will show you how to use and customize seek bar in android.
- Android Custom RatingBar Example
This article include examples about how to use and how to customize rating bar.
- Android Shape, Selector Examples
This example show you how to create Shape and Selector drawable object in android. And how to use them as button background.
- Android Layer-List Example
This article include some layer-list examples that help you to understand how to use it.
- Android Button Selector Example
This example show you how to use android selector drawable as a button background. The button color will change in different button state.
- Android Tab, Shadow Button Example
This article show you how to use android selector, layer-list, shape to implement tab and shadow button effect.
- Android ListView Example
This example show you how to use ArrayAdapter, SimpleAdapter and BaseAdapter to render customized ListView items.
- Android Custom ListView With CheckBox Example
Show you how to add checkbox for each listview item. How to implement select all, disselect all, reverse select and delete selected listview items.
- Android ExpandableListView Example
This example show you how to create and use an ExpandableListView in android.
- How To Improve Android ListView Performance
This article tell you how ListView behaves and how to improve it’s performance with three examples.
- Android GridView And ImageSwitcher Example
This example show you how to use GirdView and ImageSwitcher to create an image browser with fadein and fadeout image animation.
- Android RecyclerView Example
This article show you how to use RecyclerView to implement ListView, GridView and StaggeredGridView.
- Android Chat App Example Using RecyclerView
This example shows how to use RecyclerView to implement a chat app in android.
- Android ListActivity Example
This article contains examples about how to use ListActivity to create a single ListView activity.
- Android TabHost Example
This article show exampls about how to use android.widget.TabHost to craete a Tab android application.
- Android Enable / Disable Button By EditText Text Length
Show you how to change button state and text by EditText text length in code.
- Android Alert Dialog Example
This article contains examples about how to use android.app.AlertDialog to create various style alert dialogs in android.
- Android Custom Layout AlertDialog Example
This article show you how to use SimpleAdapter to custom list item in alert dialog and how to use custom view in alert dialog also.
- Android Popup Window Animation Example
This article tell you how to create and use PopupWindow in android. It also explains the difference between PopupWindow and AlertDialog.
- Android Progress Dialog Example
This example show you how to use android.app.ProgressDialog to build progress popup window.
- Android Snackbar Example
This example show you how to use Snackbar to prompt and interact with income messages.
- Android Custom Notification Example
This article includes 5 examples about how to create different type of android notifications.
- Android Notification Advanced Usage
This article tell you some advanced usage of android notification such as play sound, vibrate, LED light, show long text, show big picture and set notification priority etc.
- How To Add Images In Android Studio Drawable Folder
When develop android application, you always need to add images in it. This article will show you how to add images in your android application, there is also an example which will show you how to load and use the added images.
- Android ImageView Examples
This example will introduce you android ImageView properties and usage. There are two ImageView object and 11 buttons, each button shows one image effect.
- Android ImageView Matrix Rotate, Scale, Skew, Translate Example
This example will introduce
android.graphics.Matrixclass and how to use it’s method to implement image rotate, scale, skew and translate process.
- Android GridView And ImageSwitcher Example
This example show you how to use GirdView and ImageSwitcher to create an image browser with fadein and fadeout image animation.
- Android Custom Gallery Example
This example will use a Gallery and an ImageSwitcher widget to create an image gallery application.
- Android Nine Patch Image Example
This example tell you what is android nine patch image and how to create and use it in android application.
- Android Actionbar Example
This example contains two android activity, they all have action bars and menus. They use action bar menu to interact with each other.
- Android ActionBar SearchView Autocomplete Example
This example show you how to use SearchView to implement search box function in action bar. It also demonstrate how to use ShareActionProvider to popup share window when click an menu item.
- Android ActionBar Spinner (Dropdown List) Example
This example tell you how to add a Spinner style (Dropdown) menu list in actionbar.
- Android ActionBar Tab Navigation Example
This article contains example about how to make android actionbar tab navigation style.
- Android Custom ActionBar Style Example
This example show you how to use style to custom actionbar background.
Android Date Time
- Android AnalogClock, DigitalClock, TextClock Example
This example will show you how to use AnalogClock, DigitalClock and TextClock in android. It also tell you the advantage and disadvantage of them.
- Android Chronometer Example
This example will show you how to use adroid Chronometer to create a time counter. How to use it to create a count down timer.
- Android CountDownTimer Example
This example show you how to use android CountDownTimer to implement send verification code button. It also introduce CountDownTimer class key methods.
- Android DatePicker TimePicker Example
This example will show you how to use android DatePicker and TimePicker to show and let user select custom date and time in their timezone.
- Android DatePickerDialog TimePickerDialog Spinner Example
This example will tell you how to use DatePickerDialog and TimePickerDialog in both calendar, clock and spinner mode.
- Android LinearLayout Example
This article introduce android LinearLayout and it’s properties such as orientation, layout gravity and layout weight with examples.
- Android LinearLayout OnTouchListener OnClickListener Example
This example show you how to add OnTouchListener OnClickListener to LinearLayout.
- Android RelativeLayout Example
This article introduce android RelativeLayout properties and usage examples.
- Android Frame Layout Multiple Views Example
This example show you how to organize multiple View components position in a FrameLayout component. It include an example app which implements neon effect.
- Android PercentFrameLayout PercentRelativeLayout Example
This article show you how to use PercentFrameLayout and PercentRelativeLayout to set components width, height or margin in percentage.
- Android Custom Widget Example
This examples show you how to create a custom android widget by extends LinearLayout.
- How To Support Multiple Screen Size In Android
This article show you how to use android qualifiers to show different layout for different screen size devices. It also tell you how to customize minimum width or height qualifiers.
- Android Flexbox Layout Example
This example show you how to use open source FlexboxLayout.
- Android AsyncTask Example
This article will introduce android.os.AsyncTask class methods and usage. Also with examples about how to implement asynchronous tasks use it.
- Android Handler Example
This article tell you how the messages are managed by Looper and Handler in android system. It also show you an example about how to correctly send messages from child thread to main thread use Handler also.
- Android Thread Message Looper Handler Example
This article will introduce android message queue, message looper and message handler. It also show example about how to add looper for child thread and how to communicate between different thread use messages.
- How To Resolve Package R Dose Not Exist Error In Android Studio
- Button Listener Key Listener And Browse Url Example
- Android Activity Example – Switch Between Screens