title: How to get Device id for Admob
body: <p>i added admob ad in my application,
  the device id required for admob i find by following code,</p>
  
  <pre><code>String android_id = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID);
  device_id = md5(android_id).toUpperCase();
  
  public static String md5(String s) {
      try {
  
          MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
          digest.update(s.getBytes());
          byte messageDigest[] = digest.digest();
  
  
          StringBuffer hexString = new StringBuffer();
          for (int i=0; i&lt;messageDigest.length; i++)
              hexString.append(Integer.toHexString(0xFF &amp; messageDigest[i]));
          return hexString.toString();
  
      } catch (NoSuchAlgorithmException e) {
          e.printStackTrace();
      }
      return "";
  }
  </code></pre>
  
  <p>The problem with this is that its showing ads on some devices but on some devices it shows test ads. where am i wrong?? pls help</p>