How recognito-vision/android-facerecognition-facelivenessdetection works
Main Components
• Android Application (UI / Activities): Highlight the “app” folder with its source code, activities (MainActivity, CameraActivity, ResultActivity, SettingsActivity) and supporting classes (such as DBManager, PersonAdapter, Person, CircleImageView, and FaceView). These components drive the user interface, handle user interactions, and manage data display.
• Recognito Face Recognition SDK (Native/Library Integration): Include both “libfacesdk” and “libfotoapparat” modules. These are integrated via Gradle to provide native functions like face detection, template extraction, similarity calculation, and YUV to Bitmap conversion. Indicate that these libraries are essential for the core functionality.
• Assets and Configuration: Represent configuration assets such as the “license” file (placed under app/src/main/assets) that holds the application licensing information. Also include XML files (layouts, values, preferences, backup, and data extraction rules) that configure the UI, theming, and certain behavioral elements.
• Test Components: Acknowledge the presence of unit and instrumented tests in the “app/src/test” and “app/src/androidTest” directories as part of ensuring the proper functioning of the application.
Component Interactions and Data Flow
• Configuration & Licensing -> SDK Initialization: Represent that the SDK initialization using the license file, as well as settings configuration from XML resources, feeds into the application startup (usually in MainActivity).
• External Interactions: Optionally, note that even though the application is “fully-offline” there is a reference to an external API integration for demonstration purposes (for instance, for 1:N face search demo) that could be represented if needed.
Architectural Patterns and Design Principles
• Modularity: The clear separation between the Android application code and the native library components (libfacesdk and libfotoapparat) is a key architectural choice.
• Native Integration: The use of native methods (via JNI) is crucial in this project's architecture, ensuring performance critical operations like face detection run efficiently.
• UI/Presentation Separation: The Android UI (activities, layouts, adapters) is separated from the business logic (SDK interactions, DBManager for person data). This division supports a clean, maintainable structure.