当前位置: 首页>>代码示例>>Java>>正文


Java CrashManagerListener类代码示例

本文整理汇总了Java中net.hockeyapp.android.CrashManagerListener的典型用法代码示例。如果您正苦于以下问题:Java CrashManagerListener类的具体用法?Java CrashManagerListener怎么用?Java CrashManagerListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CrashManagerListener类属于net.hockeyapp.android包,在下文中一共展示了CrashManagerListener类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkForCrashes

import net.hockeyapp.android.CrashManagerListener; //导入依赖的package包/类
@SuppressWarnings("NonBooleanMethodNameMayNotStartWithQuestion")
private void checkForCrashes()
{
    CrashManagerListener listener = new CrashManagerListener()
    {
        public String getStringForResource(int resourceID)
        {
            switch (resourceID)
            {
                case Strings.CRASH_DIALOG_TITLE_ID:
                    return getResources().getString(R.string.crash_dialog_title);
                case Strings.CRASH_DIALOG_MESSAGE_ID:
                    return getResources().getString(R.string.crash_dialog_message);
                case Strings.CRASH_DIALOG_NEGATIVE_BUTTON_ID:
                    return getResources().getString(R.string.crash_dialog_negative_button);
                case Strings.CRASH_DIALOG_POSITIVE_BUTTON_ID:
                    return getResources().getString(R.string.crash_dialog_positive_button);
                default:
                    return null;
            }
        }
    };
    CrashManager.register(this, HOCKEY_KEY, listener);
}
 
开发者ID:VHAINNOVATIONS,项目名称:Mobile-Distance-Hearing-Aid-Application,代码行数:25,代码来源:MainActivity.java

示例2: checkForCrashes

import net.hockeyapp.android.CrashManagerListener; //导入依赖的package包/类
public static void checkForCrashes(Activity context) {
    CrashManager.register(context, BuildVars.DEBUG_VERSION ? BuildVars.HOCKEY_APP_HASH_DEBUG : BuildVars.HOCKEY_APP_HASH, new CrashManagerListener() {
        @Override
        public boolean includeDeviceData() {
            return true;
        }
    });
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:9,代码来源:AndroidUtilities.java

示例3: registerCrashReport

import net.hockeyapp.android.CrashManagerListener; //导入依赖的package包/类
public static void registerCrashReport(Context context){
    final String hockeyappToken = KeyUtilities.getToken(context, "hockeyapp");
    if (hockeyappToken != null && !hockeyappToken.equals("")) {
        if (!BuildConfig.DEBUG) {
            CrashManager.register(context, hockeyappToken, new CrashManagerListener() {
                public boolean shouldAutoUploadCrashes() {
                    return true;
                }
            });
        } else {
            CrashManager.register(context, hockeyappToken);
        }
    }
}
 
开发者ID:Microsoft,项目名称:ProjectOxford-Apps-MimickerAlarm,代码行数:15,代码来源:GeneralUtilities.java

示例4: checkForCrashes

import net.hockeyapp.android.CrashManagerListener; //导入依赖的package包/类
private void checkForCrashes() {
  final String appId = Build.isExternal()
    ? Secrets.HockeyAppId.EXTERNAL
    : Secrets.HockeyAppId.INTERNAL;

  CrashManager.register(this, appId, new CrashManagerListener() {
    public boolean shouldAutoUploadCrashes() {
      return true;
    }
  });
}
 
开发者ID:kickstarter,项目名称:android-oss,代码行数:12,代码来源:KSApplication.java

示例5: checkForCrashes

import net.hockeyapp.android.CrashManagerListener; //导入依赖的package包/类
private void checkForCrashes() {
    CrashManager.register(this, HockeyConfig.HOCKEYAPP_ID, new CrashManagerListener() {
        @Override
        public boolean shouldAutoUploadCrashes() {
            return HockeyConfig.HOCKEYAPP_AUTOSEND;
        }
    });
}
 
开发者ID:easyredmine,项目名称:mobile_app_android,代码行数:9,代码来源:BaseActivity.java

示例6: init

import net.hockeyapp.android.CrashManagerListener; //导入依赖的package包/类
public void init() {
   CrashManager.register(application, application.getString(R.string.hockey_app_id),
         new CrashManagerListener() {

            @Override
            public boolean shouldAutoUploadCrashes() {
               return true;
            }
         });
   application.registerActivityLifecycleCallbacks(this);
}
 
开发者ID:kupferwerk,项目名称:BaseAndroidApp,代码行数:12,代码来源:CrashTracker.java

示例7: Save

import net.hockeyapp.android.CrashManagerListener; //导入依赖的package包/类
public static String Save(Throwable exception, CrashManagerListener listener) {
        final Date now = new Date();
        final Writer result = new StringWriter();
        final PrintWriter printWriter = new PrintWriter(result);

        String rv = "";
        exception.printStackTrace(printWriter);

        try {
            // Create filename from a random uuid
            String filename = UUID.randomUUID().toString();
            String path = Constants.FILES_PATH + "/" + filename + ".stacktrace";
            Log.d(Constants.TAG, "Writing unhandled exception to: " + path);

            // Write the stacktrace to disk
            StringWriter write = new StringWriter();

            // HockeyApp expects the package name in the first line!
            write.write("Package: " + Constants.APP_PACKAGE + "\n");
            write.write("Version Code: " + Constants.APP_VERSION + "\n");
            write.write("Version Name: " + Constants.APP_VERSION_NAME + "\n");

            if ((listener == null) || (listener.includeDeviceData())) {
                write.write("Android: " + Constants.ANDROID_VERSION + "\n");
                write.write("Manufacturer: " + Constants.PHONE_MANUFACTURER + "\n");
                write.write("Model: " + Constants.PHONE_MODEL + "\n");
            }

            if (Constants.CRASH_IDENTIFIER != null && (listener == null || listener.includeDeviceIdentifier())) {
                write.write("CrashReporter Key: " + Constants.CRASH_IDENTIFIER + "\n");
            }

            write.write("Date: " + now + "\n");
            write.write("\n");
            write.write(result.toString());

            if (listener != null) {
//                writeValueToFile(limitedString(listener.getUserID()), filename + ".user");
//                writeValueToFile(limitedString(listener.getContact()), filename + ".contact");
//                writeValueToFile(listener.getDescription(), filename + ".description");
                write.write("Description: " + listener.getDescription());
            }

            write.flush();
            write.close();
            rv = write.toString();
            last_error = rv;
            Io_mgr.Instance.SaveFilStr(Constants.FILES_PATH + "xowa_crash_log.txt",  rv);
        }
        catch (Exception another) {
            Log.e(Constants.TAG, "Error saving exception stacktrace!\n", another);
        }
        return rv;
    }
 
开发者ID:gnosygnu,项目名称:xowa_android,代码行数:55,代码来源:OfflineCrashLog.java

示例8: onCreate

import net.hockeyapp.android.CrashManagerListener; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // http://stackoverflow.com/questions/2280361/app-always-starts-fresh-from-root-activity-instead-of-resuming-background-state
  if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
    // Activity was brought to front and not created,
    // Thus finishing this will get us to the last viewed activity
    finish();
    return;
  }

  // Regular activity creation code...

  Log.d(this.getClass().toString(), "*** onCreate ***");

  if (OtherUtils.isDebuggable(this)) {
    Log.d(this.getClass().toString(), "OtherUtils.isDebuggable(), not using crash reporting");
  } else {
    Log.d(this.getClass().toString(), "This app is NOT debuggable, so setting-up crash reporting!");

    String crashReportingId = SKApplication.getAppInstance().getCrashManagerId();

    CrashManager.register(this, crashReportingId, new CrashManagerListener() {
      @Override
      public boolean shouldAutoUploadCrashes() {
        return true;
      }

      @Override
      public void onConfirmedCrashesFound() {
        Log.d(this.getClass().toString(), "*** CrashManagerListener onConfirmedCrashesFound ***");
      }

      @Override
      public void onCrashesNotSent() {
        Log.d(this.getClass().toString(), "*** CrashManagerListener onCrashesNotSent ***");
      }

      @Override
      public void onCrashesSent() {
        Log.d(this.getClass().toString(), "*** CrashManagerListener onCrashesSent ***");
      }

      @Override
      public void onNewCrashesFound() {
        Log.d(this.getClass().toString(), "*** CrashManagerListener onNewCrashesFound ***");
      }
    });
  }

  final Activity ctx = this;

  if ((SKApplication.getAppInstance().getShouldAppShowTermsAtStart() == false) ||
      (SKATermsOfUseWithButtonActivity.sGetAreTermsAccepted(this) == true)
      ) {
    LoginHelper.openMainScreenWithNoTransitionAnimation(ctx, FragmentActivityMain.class);
    this.setTheme(android.R.style.Theme_NoDisplay);
  } else {
    // Show the main screen!
    LoginHelper.openMainScreenWithNoTransitionAnimation(ctx, SKATermsOfUseWithButtonActivity.class);
  }
}
 
开发者ID:SamKnows,项目名称:skandroid-core,代码行数:64,代码来源:ActivityInitiate.java


注:本文中的net.hockeyapp.android.CrashManagerListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。