Android Code

How to disable back button in android

When user presses back button to Disable Back Button in android and you want to perform any of the action instead of exit from the app. Like you have seen in many app when user presses back button to exit an app a toast message is displayed with message “press again to exit” or a 

Continue Reading…

Android How to convert Dp to Px and Px to Dp

If you are developing an android application that is based on inflating views at runtime and are dependent on height and width of the screen. You often need to Convert Dp to Px android and convert between real pixel (px) and device independent pixel (dp, dip). Most of the use case of converting dp to 

Continue Reading…

What is Context in Android

What is Context in Android? Android is an interface to global information about an application environment. This is an abstract class whose implementation is provided by the Android system. It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities, broadcasting and receiving intents, etc. Different ways of 

Continue Reading…

How to Get Current Screen Orientation in Android

Android devices have both landscape and portrait modes and can flawlessly move between these modes. The Android working framework naturally handles these progressions for your application. You can also detect in which orientation is your android device. The natural orientation of a device is the orientation in which the orientation is 0 on all the 

Continue Reading…

Android How to Get Phone Unique Device Id

Sometimes it is required to get the unique ID of android device while developing the android application. This is necessary in cases when the you wants to track the unique device installations of the application. There are many ways to get android device unique ID so below method is a relevant way to get ANDROID_ID 

Continue Reading…

Android How to Check Internet Connection Status

If you are developing an android application that perform internet related operations like calling web API, loading web page in Web View, uploading profile pic and etc. So before performing any internet related tasks it is better to first check that your device is connected to internet or not . Android provides ConnectivityManager class to 

Continue Reading…

Show Buttons
Hide Buttons