title: How to get path/location of adb in android programatically
body: <p>I am trying to get path/location of adb in android -
  by this code -</p>
  
  <pre><code>String adbLocation = System
          .getProperty("com.android.screenshot.bindir");
  if (adbLocation == null)
   {
      adbLocation = System.getenv("ANDROID_HOME");
      if (adbLocation != null) {
              adbLocation += File.separator + "platform-tools";
   }
  </code></pre>
  
  <p>Now getting the path /location in log by</p>
  
  <blockquote>
    <p>Log.e("adbpathTag - ","adb: -"+adbLocation);</p>
  </blockquote>
  
  <p>but the output I am getting is -</p>
  
  <blockquote>
    <p>adbpathTag -     adb: - null</p>
  </blockquote>
  
  <p>how I can get right Path of adb here ?? Is there any other way through which I can get adb path/location</p>