Android allows you to retrieve passwords from your mobile phone

Source: Internet
Author: User

In fact, this article has a bit of title, and there are few lines of code. Sorry, but it does provide a solution. I think this is very important, after writing the code for a few years, I actually pay more attention to the ideas and methods.

Background: When the mobile client has such a requirement, the user forgets the password, enters his/her mobile phone number, and clicks "retrieve password", the system will send the password to his/her mobile phone for password retrieval. I believe this is very common.

We are here to cooperate with a third-party text message platform, called yimeisoft Tong. The official website is http://www.emay.cn/. the basic function is a text message of 7 cents. If you have more value, you can enjoy a higher discount.

I am so sorry. I can send a text message with just a few words:

Introduce the jar packages they provide, and then directly use:

Import CN. emay. SDK. client. API. client; public class test {public static void main (string [] ARGs) {test T = new test (); // T. testtegistex (); T. testsendsms ();}/**** test function */Public void testtegistex () {try {client sdkclient = new client ("0sdk-ebb-0130-nevqo", "342478 "); int I = sdkclient. registex ("342478"); system. out. println ("registration result:" + I);} catch (exception e) {e. printstacktrace () ;}} public void testsendsms () {try {// test the serial number and password. Ask them for the client sdkclient = new client ("0sdk-ebb-0130-nevqo", "342478 "); int A = sdkclient. sendsms (New String [] {"xxxxxxxxxxx"}, "text message test content", 3); system. out. println ("SMS sending Result:" + a);} catch (exception e) {e. printstacktrace ();}}}

It should be noted that XXXX is the mobile phone number you need to send. During the first use, you need to run the testtegistex () method and register one first, then, use testsendsms () to send text messages. If you need more text message functions, such as group sending and reply, go to the documents they provided.

Give it a try. Check if your phone has received the text message.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.