[EN] Deploy a Demo - FacePlusPlus/MegviiFacepp-Android-SDK GitHub Wiki
This tutorial is for developers using Android Studio. Please refer to Deploy a Demo (Eclipse) if you are using Eclipse.
- Download Demo Source Code
git clone https://github.com/FacePlusPlus/MegviiFacepp-Android-SDK.git
- Import Face SDK aar File
- Open Android Studiot, choose
Open an existing Android Studio project, openFaceppDemofolder;

-
Android Studio will then prompt that cannot find aar file, so the next step will be importing aar file;
-
Copy the compiled Face SDK aar file to
FaceppDemo/FaceppDemoUI/libsfolder: (The SDK downloaded from Face++ website contains compiled Face SDK aar file, which you can directly use)

- Copy algorithm model to
FaceppDemo/FaceppDemoUI/src/main/res/rawfolder.

- Set License Configuration
-
Add Online Licensing Manager SDK
- [Online Licensing version SDK] Copy compiled Online Licensing Manager SDK aar file to
FaceppDemo/FaceppDemoUI/libsfolder: (The SDK downloaded from Face++ website contains compiled Online Licensing Manager SDK aar file, which you can directly use)

- [Offline Licensing version SDK] Comment out the code about importing LicMgr SDK in
FaceppDemo/build.gradle; And inFaceppDemo/app/src/main/java/com/facepp/demo/LoadingActivity.java, comment out the code afterifblock invoid network()function;
- [Online Licensing version SDK] Copy compiled Online Licensing Manager SDK aar file to


-
Add API_KEY and API_SECRET
- [Online Licensing version SDK] Add your api_key and api_secret into
FaceppDemo/FaceppDemoUI/src/main/java/com/facepp/library/util/Util.java(api_key and api_secret are credentials to use Face++ cloud services, which can be accessed in Face++ Console; Check the tutorial to learn about how to get api_key and api_secret);

- [Offline Licensing version SDK] Assign null value
""to API_KEY and API_SECRET inFaceppDemo/FaceppDemoUI/src/main/java/com/facepp/library/util/Util.java;
- [Online Licensing version SDK] Add your api_key and api_secret into

- Set Bundle ID (ApplicationID)
-
Set the bundle-id in this project as the one you submit in Face++ Console. For how to set bundle-id in Face++ Console, check the tutorial;
-
Set
appliactionIdinFaceppDemo/app/build.gradle(Module.app)as corresponding bundle-id, then sync gradle configurations;

- Run Demo App
Connect your device with computer, click run button, you will then be able to run demo app on your device.

- Next Step
Congratulations! You've finished this tutorial. You can refer to Face++ Android SDK API, to learn more about how to use Face++ algorithms to power your applications.