• 16 November

    OCAJP Encapsulation mock questions

    This is another post in the series of mock questions for . One of the exam objective is “Apply encapsulation principles to a class”. This exam objective tests your knowledge on how to write a class that meets the encapsulation principles and validate your understanding. I have prepared a set of good mock questions for […]

  • 15 November

    How to enable or disable Wifi in android programmatically

    In this post, we will see how to enable or disable Wifi in android programmatically. It is very simple to enable or disable wifi from android code. For enabling WiFi: [crayon-67839dd51a324274228103/] For disabling Wifi: [crayon-67839dd51a329247320560/] So you can enable or disable WiFi using WifiManger class. You need to add extra permissions in AndroidManifest.xml to enable […]

  • 15 November

    Check battery health in android programmatically

    Sometimes when you are developing an android application, you may want to get current battery health In this post, we are going to see how to get current battery voltage in android. You can use intent.getIntExtra(BatteryManager.EXTRA_HEALTH,0) to get information about current battery voltage. Source code: Download click to begin 20KB .zip Step 1 : Create an android […]

  • 15 November

    How to enable or disable Bluetooth in android programmatically

    In this post, we will see how to enable or disable Bluetooth in android programmatically. It is very simple to enable or disable bluetooth from android code. For enabling Bluetooth: [crayon-67839dd51b276798386930/] For disabling Bluetooth: [crayon-67839dd51b27c219679387/] So you can enable or disable Bluetooth using BluetoothAdapter class. You need to add extra permissions in AndroidManifest.xml to enable or […]

  • 14 November

    get battery voltage in android programmatically

    Sometimes when you are developing an android application, you may want to get current batter voltage In this post, we are going to see how to get current battery voltage in android. You can use intent.getIntExtra(BatteryManager.EXTRA_VOLTAGE,0) to get information about current battery voltage. Source code: Download click to begin 20KB .zip Step 1 : Create an android […]

  • 14 November

    Get battery temperature in android programmatically

    Sometimes when you are developing an android application, you may want to get current batter temperature For example: Lets say if battery temperature is too high, you may want to close some application. In this post, we are going to see how to get current battery temperature in android. Source code: Download click to begin […]

  • 09 November

    get battery level and state in android programmatically

    Sometimes when you are developing an android application, you may want to get current batter level or state. For example: Lets say you want to make a rule that if battery level is less than 15%, turn off all background processes in android. In this post, we are going to see how to get current […]

  • 09 November

    Create first android app using Android studio

    In this post, we are going to create first android app which will show result of multiplication of two user input numbers. We have already created Android hello world example before but it was too basic. We are going to design our screen as below: We are not going to put much validations here. We […]

  • 07 November

    Android Project Structure in android Studio

    In previous post, we have created hello world android application. In this post, I am going to explain structure of android application to understand it better. When you created android application, your folder structure will look similar to below. Lets understand above folder structure. ApplicationManifest.xml: ApplicationManifest.xml resides in src/main/. Every application should have ApplicationManifest.xml in […]