[EN] Deploy a Demo (Eclipse) - FacePlusPlus/MegviiFacepp-Android-SDK GitHub Wiki
This tutorial is for developers using Eclipse. Please refer to Deploy a Demo if you are using Android Studio.
- Download Demo Source Code
- For Linux or Mac OS users, use the following command:
git clone https://github.com/FacePlusPlus/MegviiFacepp-Android-SDK.git
- For Windows 7 (or later version) users, and who have a NTFS drive and have installed git-for-windows, turn to git-for-windows 的Symbolic Links,and use the following command:
git clone -c core.symlinks=true https://github.com/FacePlusPlus/MegviiFacepp-Android-SDK.git
- For other Windows users, or those who perfer not to use git-for-windows Symbolic Links, use the following command. And then double click to run
project-copy.batin theEclipseFaceppDemo/FaceppDemo/folder, then runproject-copy.batin theEclipseFaceppDemo/FaceppDemoUI/folder:
git clone https://github.com/FacePlusPlus/MegviiFacepp-Android-SDK.git

- Import Face SDK jar + *.so File
-
Open Eclipse,choose
File > Import > Android > Existing Android Code Into Workspace,chooseEclipseFaceppDemofolder;
- There will be two projects imported into Eclipse. FaceppDemoUI is a library project, while FaceppDemo is a project using this library, which only contains a launching page;
- It is suggested that you reset the project name when importing project, in order to avoid name collision with existing workspace project;
-
Copy the compiled Face SDK jar + *.so file to
EclipseFaceppDemo/FaceppDemoUI/libsfolder; (android-support-v4.jaris contained by default. The SDK downloaded from Face++ website contains compiled *Face SDK jar + .so file, which you can directly use) -
Copy algorithm model to
EclipseFaceppDemo/FaceppDemoUI/res/rawfolder.

- Set License Configuration
-
Add Online Licensing Manager SDK
- [Online Licensing version SDK] Copy compiled Online Licensing Manager SDK jar + *.so file to
EclipseFaceppDemo/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 after
ifblock invoid network()function inEclipseFaceppDemo/FaceppDemo/src/com/facepp/demo/LoadingActivity.java; (Also comment out code related to import)
- [Online Licensing version SDK] Copy compiled Online Licensing Manager SDK jar + *.so file to

-
Add API_KEY and API_SECRET
- [Online Licensing version SDK] Add your api_key and api_secret into
EclipseFaceppDemo/FaceppDemoUI/src/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 inEclipseFaceppDemo/FaceppDemoUI/src/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
package="..."inEclipseFaceppDemo/FaceppDemo/AndroidManifest.xmlas 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.