Setting MPM SDK
IMQA MPM offers various options and enables the user to add custom settings for generating more detailed crash reports.
1. MPM installation options
MPM option files
You can manage settings using the settings file for IMQA. Those files should be placed at the app level.
{
"stop" : true,
"mpm" : false,
"crash" : true,
"core" : true,
"repackaging" : false,
"lifecycle" : true,
"event_listener" : true,
"library_activity" : true,
"fragment_lifecycle" : true,
"webview" : true,
"network" : true,
"build_location" : "",
"flavor" : "",
"manifest_location" : "",
"mapping_upload" : true,
"map_upload_server" : "",
"project_key" : "IMQA_KEY",
"runtime" : {
"buildType" : false,
"printLog" : true,
"dump_interval" : 1000,
"file_interval" : 5,
"upload_period" : true,
"network_collect" : true,
"socket_tracing" : false,
"http_tracing" : true,
"keep_file_on_fail" : true,
"force_https" : false,
"end_date" : "",
"os_version_limit_list" : [],
"app_version_limit_list" : [],
"dump_size_max" : 10,
"behavior_max" : 100
}
}Description of file build setting values
stop
false
Executes all injecting processes of MPM. All execution processes are ignored if set as \n true.
mpm
true
Installs an SDK for MPM. The MPM library cannot be used if set to false.
crash
true
Installs an SDK for Crash. The Crash library cannot be used if set to false.
core
true
Installs the IMQA Core SDK. The Core library cannot be used if set to false.
repackaging
true
Sets repackaging mode. Injection is performed during compilation if set to false.
lifecycle
true
Allows activity lifecycle injecting. The activity map is hidden if set to false.
event_listener
true
Allows event listener injecting. Event information is not collected if set to false.
fragment_lifecycle
true
Sets whether to collect fragments or not. The rendering speed of the fragment is not collected if set to false.
webview
true
Allows WebView related injecting. HTTP/S requests in the WebView are not collected if set to false.
network
true
Wraps the network collection method. Network-related response speed is not collected if set to false.
manifest_location
""
You can manually set the manifest location of the current build environment. The plugin automatically searches if not set.
flavor
""
You can manually set the flavor of the current build environment. The plugin automatically searches if not set.
mapping_upload
true
Automatically uploads a mapping file when it is created.
map_upload_server
"http://mpm.imqa.io"
Wraps the network collection method. Network-related response speed is not collected if set to false.
project_key
""
Sets the project key for the current app. Additional setting is required to upload the “mapping.txt” file properly. An upload failure message may appear in the build log if not set.
Description of file runtime setting values
buildType
false
Sets whether IMQA collects data.
- true: Do not collect data.
- false: Collects data.
printLog
false
Sets whether to output the log. Outputs IMQA logs if set to true.
dump_interval
5000
Sets the dump interval in ms (milliseconds).
file_interval
5
Sets the interval of saving dumps in a file in minutes.
upload_period
false
Sets whether to upload a file periodically. Uploads a file according to the FileInterval while the app is running. Uploads collected data while executing the app again only if set to false.
socket_tracing
true
Sets the function of collecting information related to the socket. Collects and saves network communication information using the socket while the app is running, if set to true.
http_tracing
true
Sets the function of collecting HTTP related information. Collects and saves HTTP information while the app is running, if set to true.
keep_file_on_fail
true
Sets whether to leave the measured performance file until upload is successful. Keeps the file inside until the upload is successful. If set to false, the file is deleted even if upload fails.
force_https
false
Establishes HTTPS communication by ignoring the certificate (SSL) of the upload server if set to false.
end_date
(none)
Sets the end date.
os_version_limit_list
[]
Sets the OS version to run.
app_version_limit_list
[]
Sets the app version to run.
dump_size_max
10
Sets the maximum usage of dump data. (in MB)
behavior_max
15
Sets the maximum number of behavior analysis data.
Gradle File
You can change the IMQA MPM installation mode using gradle.
MPM Run Option
You can change the IMQA MPM mode using parameters or options.
Executing independent MPM
You can execute IMQA MPM Injector in a specific task. However, if you use the above method, codes may not be inserted normally depending on the executed location.
Setting network collection
The IMQA MPM framework automatically measures network collection, but for specific libraries, manual settings must be made.
Responding to AsyncHttpClient
When requesting a network using the AsyncHttpClient library, please add the following.
2. Setting ProGuard
ProGuard is a tool used to make the APK as small as possible in size by removing unused resources and shortening the name of classes or methods. When using ProGuard or DexGuard, the original class and method name can be displayed on the crash report by uploading the mapping file as below:
Preparation
If ProGuard is used in a project under development, the source code is obfuscated, making the analysis difficult. In this case, obfuscated codes can be analyzed using the generated mapping.txt file.
Add the following to ProGuard rules (proguard-rules.pro):
A file is created in the app/build/outputs/mapping/debug (or release)/mapping.txt directory. (The file location may differ a little depending on the buildType and flavor.) You need to connect to http://crash.imqa.io to upload the file created in this way.
When uploading the file, its name must be named as “mapping.txt” or “map.txt”.
Upload process
1. Select “Setting” at the project menu.
2. Click the [File Upload] button to open the upload window.
3. Click the [Choose File] button that matches the app version specified in the gradle and upload the “mapping.txt” file.
4. If you click the [Upload] button, the crash information collected afterwards will be displayed after analysis.
When the latest version of the app is released, please register additional mapping files of the same app version in order to view the version’s crash information.
3. MPM Webview Guide
WebView HTTP request
Setting the web server
To collect WebView data, the IMQA Webview JavaScript library should be inserted into the web page that provides WebView. If you wish, you can also download the file and share it via web server.
(It is recommended to directly import and use this if a Cross-Origin Resource Sharing (CORS) problem occurs.)
Android Agent Setup
MPM collects WebView-related pages and requests. To enable the collection, you need to set up options and add MPMWebviewInterface. Additionally, error information occurring in WebView can be collected. To collect Webview Crash, you must add CrashWebviewBridge.
4. MPM HTTPS Guide
Responding to HttpsURLConnection
IMQA Client can collect HttpsURLConnection based network requests. Add the following when requesting an HttpsURLConnection based network.
HttpsURLConnection
Responding to OkHttp
IMQA Client can collect OkHttp based network requests. Add the following when requesting an OkHttp based network.
OkHttp Client
1. OkHttp3
2. Retrofit 2.0
Responding to the image loading library
1. Picasso
For Picasso, OkHttp is selected as a default downloader when using OkHttp. Add the following to add an interceptor to this downloader. First, add OkHttp3Downloader dependency.
2. Glide
For Glide, HttpUrlConnection is used as the default HTTP library. Set OkHttpClient in the registry to use OkHttp.
Responding to HttpClient
IMQA Client can collect HttpClient based network requests. Add the following when requesting an HttpClient based network.
HttpClient
1. HttpClient (org.apache.http.legacy)
2. HttpClient (cz.msebera.android.httpclient)
Responding to Volley
IMQA Client can collect Volley based network requests. Add the following when requesting a Volley based network.
Volley
1. Volley (com.android.volley)
Issues in the current version
The Interceptor function should be manually inserted.
(Currently, automatic installation of HTTPUrlConnection, OkHttp, Retrofit, and HttpClient (org.apache, cz.msebera) is supported.
Last updated