|
6 | 6 | import android.net.ConnectivityManager; |
7 | 7 | import android.net.NetworkInfo; |
8 | 8 | import android.preference.PreferenceManager; |
9 | | -import android.util.Log; |
10 | 9 |
|
11 | 10 | import org.acra.ACRA; |
12 | | -import org.acra.ReportingInteractionMode; |
13 | | -import org.acra.annotation.ReportsCrashes; |
14 | | -import org.acra.collector.CrashReportData; |
15 | | -import org.acra.sender.ReportSender; |
16 | | -import org.acra.sender.ReportSenderException; |
| 11 | +import org.acra.annotation.AcraCore; |
| 12 | +import org.acra.annotation.AcraDialog; |
| 13 | +import org.acra.data.StringFormat; |
17 | 14 | import org.apache.log4j.Logger; |
18 | 15 | import org.syncloud.android.core.redirect.IUserService; |
19 | 16 | import org.syncloud.android.core.redirect.RedirectService; |
|
25 | 22 | import static org.acra.ReportField.*; |
26 | 23 | import static org.syncloud.android.core.redirect.RedirectService.getApiUrl; |
27 | 24 |
|
28 | | -@ReportsCrashes( |
29 | | - customReportContent = { APP_VERSION_CODE, ANDROID_VERSION, PHONE_MODEL, STACK_TRACE, LOGCAT }, |
30 | | - |
31 | | - mode = ReportingInteractionMode.DIALOG, |
32 | | - resToastText = R.string.crash_toast_text, // optional, displayed as soon as the crash occurs, before collecting data which can take a few seconds |
33 | | - resDialogText = R.string.crash_dialog_text, |
34 | | - resDialogIcon = R.drawable.ic_launcher, //optional. default is a warning sign |
35 | | - resDialogTitle = R.string.crash_dialog_title, // optional. default is your application name |
36 | | - resDialogOkToast = R.string.crash_dialog_ok_toast, // optional. displays a Toast message when the user accepts to send a report. |
| 25 | +@AcraDialog( |
| 26 | + resText = R.string.crash_dialog_text, |
| 27 | + resIcon = R.drawable.ic_launcher, //optional. default is a warning sign |
| 28 | + resTitle = R.string.crash_dialog_title // optional. default is your application name |
| 29 | +) |
| 30 | +@AcraCore( |
| 31 | + buildConfigClass = BuildConfig.class, |
| 32 | + reportContent = { APP_VERSION_CODE, ANDROID_VERSION, PHONE_MODEL, STACK_TRACE, LOGCAT }, |
37 | 33 |
|
38 | 34 | logcatArguments = { "-t", "500", "-v", "long", "*:D"}, |
39 | 35 | logcatFilterByPid = false, |
40 | 36 |
|
41 | | - reportSenderFactoryClasses = { AcraLogEmailerFactory.class } |
| 37 | + reportSenderFactoryClasses = { AcraLogEmailerFactory.class }, |
| 38 | + reportFormat = StringFormat.KEY_VALUE_LIST |
| 39 | + |
42 | 40 | ) |
43 | 41 | public class SyncloudApplication extends Application { |
44 | 42 |
|
45 | | - private String TAG = SyncloudApplication.class.getSimpleName(); |
46 | | - |
47 | | - public static String DEVICE_ENDPOINT = "device_endpoint"; |
48 | | - |
49 | 43 | private Preferences preferences; |
50 | 44 | private UserStorage userStorage; |
51 | 45 |
|
52 | 46 | @Override |
53 | | - public void onCreate() { |
54 | | - |
| 47 | + protected void attachBaseContext(Context base) { |
| 48 | + super.attachBaseContext(base); |
55 | 49 | ACRA.init(this); |
| 50 | + } |
| 51 | + |
| 52 | + @Override |
| 53 | + public void onCreate() { |
56 | 54 |
|
57 | 55 | ConfigureLog4J.configure(); |
58 | 56 |
|
59 | 57 | Logger logger = Logger.getLogger(SyncloudApplication.class); |
60 | 58 | logger.info("Starting Syncloud App"); |
61 | 59 |
|
62 | | - |
63 | 60 | super.onCreate(); |
64 | 61 | SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); |
65 | 62 | PreferenceManager.setDefaultValues(this, R.xml.preferences, false); |
|
0 commit comments