Migrating ACRA from annotations to pluginconfigurations #1095
-
I use ACRA 5.8.4 and I want to update it to 5.9.6 but @annotations are deprecated and I have to change it to PluginConfigurations, but documentation isn't finished and I don't know how to do it. This is my current Application class: package com.mycompany.myapp;
import android.app.Application;
import android.content.Context;
import androidx.multidex.MultiDex;
import org.acra.ACRA;
import org.acra.annotation.AcraCore;
import org.acra.annotation.AcraDialog;
import org.acra.annotation.AcraMailSender;
@AcraCore(buildConfigClass = BuildConfig.class)
@AcraMailSender(mailTo = "myemail@mydomain.com",
resSubject = R.string.mailsubject)
@AcraDialog(resTitle = R.string.acratitle,
resText = R.string.acratext,
resPositiveButtonText = R.string.acrasend,
resNegativeButtonText = R.string.acracancel,
resCommentPrompt = R.string.acracomprompt )
public class MyAwsomeApplication extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
// The following line triggers the initialization of ACRA
ACRA.init(this);
}
} And I want to update it to pluginconfigurations: public class MyAwsomeApplication extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
// The following line triggers the initialization of ACRA
CoreConfigurationBuilder builder;
builder = new CoreConfigurationBuilder()
.withBuildConfigClass(BuildConfig.class)
.withReportFormat(StringFormat.JSON)
.withPluginConfigurations(
<-- I think, here I should add new clases for dialog and mail sender -->
);
ACRA.init(this, builder);
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The documentation is finished. Nonetheless here is your configuration translated as an example. ACRA.init(this, new CoreConfigurationBuilder()
.withBuildConfigClass(BuildConfig.class)
.withPluginConfigurations(
new MailSenderConfigurationBuilder()
.withMailTo("myemail@mydomain.com")
.withSubject(getString(R.string.mailSubject))
.build(),
new DialogConfigurationBuilder()
.withTitle(getString(R.string.acratitle))
.withText(getString(R.string.acratext))
.withPositiveButtonText(getString(R.string.acrasend))
.withNegativeButtonText(getString(R.string.acracancel))
.withCommentPrompt(getString(R.string.acraprompt))
.build()
)
); |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help. There are some links in the documentation that redirect to "page not found". For example the pages that should account for the question I have asked: Setup --> Full configuration options documentation --> MailSender , Dialogs. That was the page I went to read all configuration options, but they redirect to "page not found", and then I added this question here. |
Beta Was this translation helpful? Give feedback.
The documentation is finished. Nonetheless here is your configuration translated as an example.