Android implements face recognition

Actually this platform to realize face recognition to it is simpler, little consumption will be a lot of time, because they = = platform is comparatively detailed tutorial, but the relatively has almost all the code to encapsulate = = in the Demo, but the code does is more, if you want to read it, really need a lot of time, I’m just going to show you how to do it.Here’s how I did it. It doesn’t have to be a waste of your time.

Step 1: Register and be certified as a developer.

Compared with QQ authentication and microblog authentication, this is relatively simple, authentication address:Rainbow Soft Developer CenterBecause I’ve been successful before, SO I can’t teach you how to do it, okayClick on the beginner's guide in the red circle belowIt will teach you how to be certified as an open agent.

Step 2: Create the application

1. After the authentication is successful, we can start to create the application.

2. Fill in the information

3. Click Add SDK

4. Choose face recognition

5. As shown in the figure.

6. The vm is created successfully.

7. Know yoursAPP_IDandSDK_KEY.

Here’s oneOne thing to be careful about, if you go ahead and copy it, if you go ahead and copy it, you'll paste in the APP_ID, delete the APP_ID, SDK_KEY as well.

8. Download the SDK.

Step 3: Add the Demo from the SDK to your Android Studio.

1. Unzip the SDK you just downloaded and find the following file.

2. Click the file and paste the path.

3. Click Android Studio as shown

4. Find the path to the file you just created

4. Modify the file name to avoid conflicts, click Finish, and wait for the load to succeed.

Step 4: Modify the Demo. For each change, I will give an example.

In fact, the Demo is not wrong, but because my version is relatively advanced, the support package is not supported (it seems that you can also add support JAR package, I don’t know here, you can try it yourself). So you need to change the red code.

1. The first place to change is your Activity file.

As for how to modify, I took one page as an example, the rest OF me to modify step by step is very time-consuming.Delete the offending import packages and press Alter+ Enter at the offending locations to reimport the correct import packages, as shown in the figure.

Here I will not say clearly, here is a modified Demo, set to 0 points can be downloaded, also refer to. The address is as follows: All popular and successful demos have been modified

2. For the second change, paste your APP_ID and SDK_KEY.

Our APP_ID and SDK_KEY (I mentioned the location of APP_ID and SDK_KEY above) can be pasted into the following file.

3. The third place to modify, AndroidMainfest file.

Demo’s AndroidMainfest hit, as shown below:Modified as follows:

4. The fourth place to change is the XML file in your Layout file.

The explosion is as follows:After modification:

After all the changes are made, you can run your Demo.

Step 5: Run your modified Demo.

My Demo runs on my local computer. I have no idea whether the mobile phone simulator can run, because there are some problems with my simulator recently, so I can only use local test. I still suggest using your local computer to achieve this function.

After running your Demo, you should see the following page. == First you have to click on the Activation engine, which is to activate the SDK you just created on Rainbow Software.Then click the red circle below to realize the face recognition function shown at the top.By getting to this point, you’ve successfully implemented this feature, although it’s not too difficult to implement,But still need to be careful, if a step is not handled well, you can increase difficulties for you. If there are any problems with good ideas and I did not consider the place, can be put forward, I modify, mutual enhancement.

Can also understand my Android mobile phone number login 2020 nanny-type picture details, step by step to teach you to achieve Mob+SMSSDK platform? If I have time, I will write an article about QQ sharing and the function of QQ space sharing.