code: public static String generateUserAgentString(Context ctx) {
          String packageName = null;
          int packageVersion = 0;
          try {
              packageName = ctx.getPackageName();
              packageVersion = ctx.getPackageManager().getPackageInfo(packageName, 0).versionCode;
  
          } catch (PackageManager.NameNotFoundException e) {
              CAT.e(e.getMessage());
          }
  
          String userAgent = packageName + " Android/" + packageVersion;
  
          Locale locale = java.util.Locale.getDefault();
          if (locale == null) {
              userAgent += " (" + Locale.US + ");";
          } else {
              userAgent += " (" + locale.toString() + "); ";
          }
          userAgent += "Android/" + Build.VERSION.RELEASE + "; ";
          userAgent += Build.MODEL + "/" + Build.VERSION.SDK_INT + ";";
          return userAgent;
      }
docs: Construct a user-agent string based on the running application and
  the device and operating system information. This information is
  included in HTTP requests made to the Evernote service and assists
  in measuring traffic and diagnosing problems.