런타임 방식으로써 크래시발생시 acra http API 를 사용하는 방법 가이드.
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d("MainActivity", "onCreate");
CoreConfigurationBuilder builder = new CoreConfigurationBuilder(this);
builder.setBuildConfigClass(BuildConfig.class).setReportFormat(StringFormat.JSON);
builder.getPluginConfigurationBuilder(HttpSenderConfigurationBuilder.class)
.setUri("http://192.168.12.10:55000/send")
.setHttpMethod(HttpSender.Method.POST)
.setBasicAuthLogin("james") //backend htpasswd 설정필요
.setBasicAuthPassword("1234")
.setEnabled(true);
ACRA.DEV_LOGGING = true;
ACRA.init(getApplication(), builder);
throw new NullPointerException();
}
}