<!--todo step 1: add authorization of camera -->
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.CAMERA"/>
// todo step 2: add on-device face analyzer
MLFaceAnalyzerSetting setting = new MLFaceAnalyzerSetting.Factory()
.setFeatureType(MLFaceAnalyzerSetting.TYPE_FEATURES)
.setPerformanceType(MLFaceAnalyzerSetting.TYPE_SPEED)
.allowTracing()
.create();
this.analyzer = MLAnalyzerFactory.getInstance().getFaceAnalyzer(setting);
// finish
// todo step 3: add on-device lens engine
this.mLensEngine = new LensEngine.Creator(context, this.analyzer)
.setLensType(this.lensType)
.applyDisplayDimension(1600, 1024)
.applyFps(25.0f)
.enableAutomaticFocus(true)
.create();
// finish
// todo step 4: add on-device face graphic
MLFaceGraphic graphic = new MLFaceGraphic(this.mGraphicOverlay, faceSparseArray.valueAt(i));
this.mGraphicOverlay.add(graphic);
// finish