Suggest to see the official document help.aliyun.com/knowledge_d…

Without talking about the preparation work, the following points need to be paid attention to in the process of access

Development environment setup: note that this sentence must be added to use popover mode!!

<! Telecom, unicom authorized page - > < activity android: name = "com. Mobile. The auth. Gatewayauth. LoginAuthActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:exported="false" Android: Theme ="@style/authsdk_activity_dialog" android:launchMode="singleTop" /> <! Webview - agreement page - > < activity android: name = "com. Mobile. The auth. Gatewayauth. Activity. AuthWebVeiwActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:exported="false" android:launchMode="singleTop" android:screenOrientation="behind" /> <! - mobile authorization page - > < activity android: name = "com. Cmic. Sso. SDK. Activity. LoginAuthActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:exported="false" android:launchMode="singleTop" />Copy the code

Code call order

Initialize the token instance */ mTokenListener = new TokenResultListener() {} /* * 2. To initialize the SDK examples. * / mAlicomAuthHelper = PhoneNumberAuthHelper getInstance (context, mToke nListener); / * * 3. Set up the SDK secret key * / mAlicomAuthHelper setAuthSDKInfo (); /* * 4. Check whether the terminal network supports one-click login or number authentication. According to the correction results to determine whether you can use a key to login function. * / mAlicomAuthHelper checkEnvAvailable (PhoneNumberAuthHelper# SERVICE_TY PE_LOGIN); / * * 5. If the step 4 returns true, then according to the business situation, a key to invoke the prefetch Numbers or login interface. * see * / mAlicomAuthHelper demo access project getLoginToken (context, 5000);Copy the code

Custom layout: the method provided by SDK is not very friendly, need to be careful, when using the need to set the document in the code, set the relative position of the control can only be set by setting the dp value of the distance up and down

To successfully enter the authorization page, you also need to:

1. Check whether sim card is inserted 2. Check whether cellular network switch is on 3. 4. In the systems of some Domestic Android manufacturers, wifi network permissions and mobile network permissions are managed separately. Check whether APP only has WLAN network permissions, but mobile cellular network permissions are missing. 5. Check whether the mobile phone network is connected to the agent. 6. Check whether the mobile phone is powered by root.

Memory leak problem:

Toast Memory leak protocol is not checked click the one-click login button to display Toast and exit the authorization page memory leak appears. Solution is AuthUIConfig. SetLogBtnToastHidden (true) to hide the default Toast, according to the click event code show his Toast. The page is illegally modified. When the number bar of the authorization page, one-click login Button and protocol bar overlap or block, click the one-click login Button to display the illegal modification of the Toast page. The solution is to look at layers to solve the overlap.

TokenResultListener memory leak the SDK holds a TokenResultListener that is set externally, After a key login function after use by PhoneNumberAuthHelper. SetAuthListener (null) will callback empty can.

Unsolved problem: When wifi and telecom traffic of the test machine are turned on at the same time, the authorization page cannot be entered, but wifi can be turned off. At present, if I cannot enter the authorization page of mobile phone number, I will enter the login page of mobile phone number in the project to ensure that users can log in to the APP