Java Android-如何在Android中使用Arca作为bug报告器?
我试图在我的Qt Android项目中使用ARCA作为bug报告程序。我阅读了教程,在项目中添加了.JAR文件,在项目中创建了新类(ReportApp.java) ReportApp.java:Java Android-如何在Android中使用Arca作为bug报告器?,java,php,android,qt,bug-reporting,Java,Php,Android,Qt,Bug Reporting,我试图在我的Qt Android项目中使用ARCA作为bug报告程序。我阅读了教程,在项目中添加了.JAR文件,在项目中创建了新类(ReportApp.java) ReportApp.java: package org.qtproject.example.myApplication; import org.acra.*; import org.acra.annotation.*; import android.app.Application; @ReportsCrashes( form
package org.qtproject.example.myApplication;
import org.acra.*;
import org.acra.annotation.*;
import android.app.Application;
@ReportsCrashes(
formUri = "http://********/report/reportpath.php",
formUriBasicAuthLogin = "root",
formUriBasicAuthPassword = "***************",
mode = ReportingInteractionMode.TOAST,
forceCloseDialogAfterToast = false, // optional, default false
resToastText = R.string.crash_toast_text)
public class ReportApp extends Application {
@Override
public void onCreate() {
super.onCreate();
ACRA.init(this);
}
}
在AndroidManifest.xml中编辑了此行:
而不是使用
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="@string/app_name" android:icon="@drawable/icon">
而不是
public class ReportApp extends Application
但它也不起作用
<string name="crash_toast_text">Ooooops ! I crashed, but a report has been sent to my developer to help fix the issue !</string>
<?php
$fileName = date('Y-m-d_H-i-s').'.txt';
$file = fopen($fileName,'w') or die('Could not create report file: ' . $fileName);
foreach($_POST as $key => $value) {
$reportLine = $key." = ".$value."\n";
fwrite($file, $reportLine) or die ('Could not write to report file ' . $reportLine);
}
fclose($file);
?>
public class ReportApp extends org.qtproject.qt5.android.bindings.QtApplication
public class ReportApp extends Application