...@OverridepublicvoidonCreate() { super.onCreate();io.imqa.core.IMQAOption imqaOption =new io.imqa.core.IMQAOption();imqaOption.setBuildType(false);imqaOption.setUploadPeriod(true);imqaOption.setKeepFileAtUploadFail(false);imqaOption.setDumpInterval(10000);imqaOption.setFileInterval(5);imqaOption.setHttpTracing(true);imqaOption.setRemoteControl(true);io.imqa.mpm.IMQAMpmAgent.getInstance().setOption(imqaOption) // Sets an option to decide the MPM operation method..setContext(this,BuildConfig.FLAVOR) // Initializes the application context. (Insert an empty string if there is no flavor).setProjectKey("PROJECT_KEY") // Sets the project key of the IMQA MPM client..init(); // Initializes and executes the registered option....}...
MyApplication.kt
...overridefunonCreate() {super.onCreate()val imqaOption : IMQAOption= io.imqa.core.IMQAOption() imqaOption.setBuildType(false) imqaOption.setUploadPeriod(true) imqaOption.setKeepFileAtUploadFail(false) imqaOption.setDumpInterval(10000) imqaOption.setFileInterval(5) imqaOption.setHttpTracing(true) imqaOption.setRemoteConfig(true) io.imqa.mpm.IMQAMpmAgent.getInstance() .setOption(imqaOption) // Sets an option to decide the MPM operation method. .setContext(this, BuildConfig.FLAVOR) // Initializes the application context. (Insert an empty string if there is no flavor) .setProjectKey("PROJECT_KEY") // Sets the project key of the IMQA MPM client. .init(); // Initializes and executes the registered option....}...
...override fun onCreate() { super.onCreate()io.imqa.mpm.IMQAMpmAgent.getInstance().setContext(this,BuildConfig.FLAVOR) // Initializes the application context. (Insert an empty string if there is no flavor).setProjectKey("PROJECT_KEY") // Sets the project key of the IMQA MPM client..init() // Initializes and executes the registered option....}...
MyApplication.kt
...overridefunonCreate() {super.onCreate() io.imqa.mpm.IMQAMpmAgent.getInstance() .setContext(this, BuildConfig.FLAVOR) // Initializes the application context. (Insert an empty string if there is no flavor) .setProjectKey("PROJECT_KEY") // Sets the project key of the IMQA MPM client. .init() // Initializes and executes the registered option....}...
⚠️HTTPS (API level > 27)
Android API 28から強化されたネットワークセキュリティポリシーにより、HTTPSリクエストが必要となりました。 これを解決するためには、以下の措置を講じる必要があります。
...@OverridepublicvoidonCreate() { super.onCreate();io.imqa.core.IMQAOption imqaOption =new io.imqa.core.IMQAOption();/* * Default value: 'https://collector.imqa.io' * Sets the MPM server URL. * String: Server information */imqaOption.setServerUrl('https://(IPAddress)');io.imqa.mpm.IMQAMpmAgent.getInstance().setOption(imqaOption) // Sets the option to decide the MPM operation method..setContext(this,BuildConfig.FLAVOR) // Initializes the application context. (Insert an empty string if there is no flavor).setProjectKey("PROJECT_KEY") // Sets the project key of the IMQA MPM client..init() // Initializes and executes the registered option....}...