### Configure AppKey, AppSecret, and AppRsaSecret Source: https://github.com/aliyun/alicloud-android-demo/blob/master/apm_android_demo/README.md Replace placeholder values in MainApplication.kt with your actual AppKey, AppSecret, and AppRsaSecret obtained from the EMAS console. This is required for the Demo App to function correctly. ```kotlin val appKey = "your app key" // 请把这里改成控制台上的 "AppKey" val appSecret = "your app secret" // 请把这里改成控制台上的 "AppSecret" val appRsaSecret = "your app rsa secret" // 请把这里改成控制台上的 "AppRsaSecret" ``` -------------------------------- ### 初始化移动用户反馈SDK Source: https://github.com/aliyun/alicloud-android-demo/blob/master/feedback_android_demo/README.md 在FeedbackAPI.init方法中传入Application实例、AppKey和AppSecret来初始化SDK。 ```java FeedbackAPI.init(application, appkey, appSecret); ``` -------------------------------- ### Configure AppKey and AppSecret in AndroidManifest.xml Source: https://github.com/aliyun/alicloud-android-demo/blob/master/mpush_android_demo/README.md Replace the placeholder `********` with your actual AppKey and AppSecret obtained from the Alibaba Cloud console. This is crucial for the demo app to function correctly. ```xml ``` -------------------------------- ### 克隆Demo工程 Source: https://github.com/aliyun/alicloud-android-demo/blob/master/hotfix_android_demo/README.md 使用git clone命令下载阿里云Android Demo工程到本地。hotfix_android_demo子目录即为移动热修复的Demo APP。 ```shell git clone https://github.com/aliyun/alicloud-android-demo.git ``` -------------------------------- ### Verify Successful Registration (Logcat MPS) Source: https://github.com/aliyun/alicloud-android-demo/blob/master/mpush_android_demo/README.md After running the app and clicking 'Register and Receive Push', check the logcat output for messages tagged with 'MPS'. Successful registration is indicated by logs showing 'agoo init success' and 'register agoo result 错误码:PUSH_00000, 错误:success'. ```log 2024-07-03 10:34:48.630 14509-9747 [MPS] com.aliyun.emas.pocdemo I agoo init success. 2024-07-03 10:34:48.631 14509-9749 [MPS] com.aliyun.emas.pocdemo D register agoo result 错误码:PUSH_00000, 错误:success 2024-07-03 10:34:48.631 14509-9749 MPS:AppRegister com.aliyun.emas.pocdemo I connState=2;estimatedTime=384;response{msg: success, code: PUSH_00000} 2024-07-03 10:34:48.631 14509-9749 MPS:AppRegister com.aliyun.emas.pocdemo D Looping handleMessage: 1 2024-07-03 10:34:48.631 14509-14509 [MPS] com.aliyun.emas.pocdemo I errorCode:错误码:PUSH_00000, 错误:success ``` -------------------------------- ### Verify Cloud Channel Initialization (Logcat AWCN) Source: https://github.com/aliyun/alicloud-android-demo/blob/master/mpush_android_demo/README.md To confirm that the cloud channel is initialized correctly, filter logcat for 'awcn'. Look for logs indicating a successful connection, such as `statusCode:200` and `notifyStatus status:AUTH_SUCC`. ```log 2024-07-03 10:36:57.464 8890-10129 EMASNAccs_NetworkSdk com.aliyun.emas.pocdemo I [awcn.TnetSpdySession] statusCode:200 2024-07-03 10:36:57.465 8890-10129 EMASNAccs_NetworkSdk com.aliyun.emas.pocdemo I [awcn.TnetSpdySession] response headers:{date=[Wed, 03 Jul 2024 02:36:57 GMT], content-length=[0], server=[Tengine/Aserver/3.0.413_20221027005707], s-accs-retcode=[SUCCESS], :status=[200], x-workerid=[360290169770599862], x-at=[ZoS4k5ejQckDADGQGBlEBBUB3347866231719988617]} 2024-07-03 10:36:57.467 8890-10129 EMASNAccs_NetworkSdk com.aliyun.emas.pocdemo E [awcn.Session]|[seq:334786623.AWCN1_1] notifyStatus status:AUTH_SUCC ``` -------------------------------- ### Maven Dependency Configuration for APM SDK Source: https://github.com/aliyun/alicloud-android-demo/blob/master/apm_android_demo/README.md The build.gradle file includes the necessary configurations for the EMAS APM SDK and Gradle plugin. The 'alicloud-apm' dependency is added to integrate the mobile monitoring SDK. ```gradle plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' id 'com.aliyun.emas.apm' version '3.2.0' } def apmSdkVersion = "2.8.0" dependencies { implementation("com.aliyun.ams:alicloud-apm:${apmSdkVersion}") } ``` -------------------------------- ### 配置AndroidManifest.xml Source: https://github.com/aliyun/alicloud-android-demo/blob/master/hotfix_android_demo/README.md 在AndroidManifest.xml文件中配置IDSECRET, APPSECRET, 和 RSASECRET。建议使用setSecretMetaData方法进行设置,而不是在XML中明文配置。请将'********'替换为您的实际密钥。 ```xml ``` -------------------------------- ### Configure Application ID in build.gradle Source: https://github.com/aliyun/alicloud-android-demo/blob/master/mpush_android_demo/README.md Update the `applicationId` in your `build.gradle` file to match the package name of the App you created in the Alibaba Cloud console. Ensure this matches your app's unique identifier. ```gradle android { compileSdkVersion 23 buildToolsVersion "23.0.1" defaultConfig { applicationId "********" // 填写所创建App的包名 minSdkVersion 11 targetSdkVersion 23 versionCode 1 versionName "1.0" } ...... } ``` -------------------------------- ### Configure Application ID in build.gradle Source: https://github.com/aliyun/alicloud-android-demo/blob/master/apm_android_demo/README.md Update the 'applicationId' in the apm_android_demo/build.gradle file to match the package name of your created App in the EMAS console. Ensure signature configurations are synchronized if the console app is bound to a signature. ```gradle android { namespace 'com.aliyun.apm.android.demo' defaultConfig { applicationId "com.aliyun.apm.android.demo" // 填写所创建App的包名 minSdk 24 targetSdk 34 versionCode 1 versionName "1.0" } ...... } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.