Joke Collection Website - Public benefit messages - How to import smssdk for android SMS verification

How to import smssdk for android SMS verification

There are official development documents, but there are some points that need to be paid attention to, which lead to initialization failure: an error occurred when Android imported the jar package of SDKSMS Android, and the project was reported as unfortunate Stopd when it was running.

Let's start developing the Android project call interface API.

Create an Android project:

Modify the AndroidManifest.xml file and add the following code (user rights).

= = = First change:

password

& ltuses-permission Android:name = " Android . permission . read _ CONTACTS "/& gt;

& ltuses-permission Android:name = " Android . permission . read _ PHONE _ STATE "/& gt;

& ltuses-permission Android:name = " Android . permission . write _ EXTERNAL _ STORAGE "/& gt;

& ltuses-permission Android:name = " Android . permission . access _ NETWORK _ STATE "/& gt;

& ltuses-permission Android:name = " Android . permission . access _ WIFI _ STATE "/& gt;

& ltuses-permission Android:name = " Android . permission . internet "/& gt;

& ltuses-permission Android:name = " Android . permission . receive _ SMS "/& gt;

& ltuses-permission Android:name = " Android . permission . get _ TASKS "/& gt;

& ltuses-permission Android:name = " Android . permission . access _ FINE _ LOCATION "/& gt;

= = = Second change:

password

& lt activities

Android:name = " cn . smssdk . smssdkuishell "

Android:config changes = " keyboard hidden | orientation | screenSize "

Android:Theme = "@ Android:style/ theme. Translucent. No title bar "

Android:windowSoftInputMode = " state hidden | adjust size "/& gt;

Copy jar package to libs directory? (attention! The official did not mention that you must copy the jar package and the armeabi folder)

The correct directory structure should be as follows

Write code in MainActivity, which is executed in two steps, one loading and two sending.

Code (where AppKey and AppSecret are replaced by their own)

//initialization

Cn.smssdk.SMSSDK.initSDK(this, "your AppKey", "your appsecret");

//Send SMS

cn . smss dk . smss dk . getverificationcode(" 86 "," 186 12 12 1304 ");

Compilation test

receive a text message