Android Open Source - HexNanoController_Android System Util

From Project

Back to project page HexNanoController_Android.


The source code is released under:

Code license GNU GPL v2 Content license CC BY-NC-SA 4.0

If you think the Android project HexNanoController_Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.hexairbot.hexmini.util;
//from   w  ww.  ja  va2 s  .co  m
import java.text.SimpleDateFormat;
import java.util.Date;

import android.content.Context;
import android.util.Log;

public class SystemUtil {

    private final static String TAG = "SystemUtil";

    public static String getCurrentFormatTime() {
  SimpleDateFormat format = new SimpleDateFormat("HH:mm");
  String nowTime = format.format(new Date());
  return nowTime;

    public static boolean isDebugModel(Context context) {
  PackageManager mgr = context.getPackageManager();
  try {
      ApplicationInfo info = mgr.getApplicationInfo(
        context.getPackageName(), 0);
      return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) == ApplicationInfo.FLAG_DEBUGGABLE;
  } catch (NameNotFoundException e) {
      Log.e(TAG, e.getMessage(), e);
  return false;

Java Source Code List