First of all Your Moto G must be charged to atleast 60% ( I suggest a 100%) Backup all data on your Moto G (since unlocking will erase everything on the phone) Install the Android SDK on your PC (Download/Installation link) Install the latest Motorola drivers for your PC (Download/Installation link) Enable USB Debugging on […]

Download the superuser here

Remove the battery. Replace the battery but do not power the device on. Hold down the Volume Down AND the Home buttons then press the Power button. Hold these buttons until your phone turns on then release the power button but contnue to hold the other two until it boots into hboot/recovery. Your phone will […]

Hold reference of Service handler

You can go to File -> Settings -> Editor -> Auto Import -> Java and make the following changes: change Insert imports on paste value to All mark Add unambigious imports on the fly option as checked

In order check the Internet connection in Android java code: public boolean checkConnectivity() { boolean enabled = false; ConnectivityManager connectivityManager = (ConnectivityManager) this .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); NetworkInfo wifiConn = connectivityManager .getNetworkInfo(ConnectivityManager.TYPE_WIFI); NetworkInfo mobileConn = connectivityManager .getNetworkInfo(ConnectivityManager.TYPE_MOBILE); try { if ((wifiConn.getState() == NetworkInfo.State.CONNECTED) || ((mobileConn != null && (mobileConn.getState() == NetworkInfo.State.CONNECTED)))) { enabled = […]

This function will parsing JSON feeds in Android java: public JSONArray parsingDatawithURL (String url) { try { HttpClient httpclient = new DefaultHttpClient(); HttpResponse response = httpclient.execute(new HttpGet(url)); StatusLine statusLine = response.getStatusLine(); if (statusLine.getStatusCode() == HttpStatus.SC_OK) { InputStream inputStream = null; String json = null; // get entity from response HttpEntity entity = response.getEntity(); // get […]

  • First of all, download factory image for your nexus device from here
  • Step 1: Download the ADB/Fastboot files and the USB drivers for Windows based PC first.
    • Extract the contents of the ADB/Faew folder called ‘google’ on your desktop. Extract and transfer the contents of the factory image inside this folder as well. The list of files will include a ZIP file containing the codename of your Android device, two files with “flash-all” names, and a bootloader image file. All the extracted contents of the factory image should be inside the same folder as the ADB and Fastboot file, otherwise you will get a file not found error.
    • Make sure to install the ADB drivers as well if you are running a Windows based PC.
  • Continue reading

    Referenced from this article.

    Here is source code to check Android device rooted.

       /**    * Checks if the device is rooted.    * @return <code>true</code> if the device is rooted, <code>false</code> otherwise.    */

    Continue reading

    This is a 7-minute in-depth video of overviewing and look at the newest Google phone – LG Nexus 5. It has been rumoured to be announced on October 15th. Here is the video: