Double back press to Exit – Android Example

This tutorial is about exiting the application after double back press. The users tend to press the back button offen. To avoid application close when the user presses the back button accidently, we can expect the user to press the back button twice. See the following steps: Override onBackPressed method. Set a static long constant.

person access_time March 5, 2015launch Read More

Checking Internet Connection Android Example

In this tutorial we are going to show how to detect the availability of internet connection. You have to check the internet connectivity before making any HTTP calls. See flowing Steps : Add the below permissions to the AndroidManifest.xml file. <uses-permission android:name=”android.permission.INTERNET” /> for Internet access. <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” /> to access the network state information. […]

person access_time March 4, 2015launch Read More

Progress Dialog – Android Example

Progress bars are used to show progress of a task. For example. When you are uploading or downloading something from the internet, it is better to show the progress of download/upload to the user. See the following : Use ProgressDialog to create progress bar You can set the button in AlertDialog with certain function.

person access_time March 3, 2015launch Read More 2

Custom dialog with user input – Android Example

Let’s learn how to create Customized AlertDialog with EditText See following steps : Create a custom alert dialog layout with EditText (XML file). Inflate the custom layout to AlertDialog.Builder. Attach the AlertDialog.Builder to AlertDialog. Show the custom dialog Display the user input in main activity

person access_time March 2, 2015launch Read More

Custom Dialog – Android Example

Let’s start with customizing the default AlertDialog. See the post Default Alert Dialog to learn how to use default alert dialog. See flowing Steps : Create a custom alert dialog layout with EditText (XML file). Inflate the custom layout to AlertDialog.Builder. Attach the AlertDialog.Builder to AlertDialog. Show the custom dialog

person access_time March 1, 2015launch Read More