SeonSDK is a lightweight, easy-to-integrate library for Android that provides seamless functionalities to capture photos, store them securely, and view them in a beautifully designed gallery. With built-in biometric authentication, you can ensure that only authorized users can access stored photos.
The objective of SeonSDK is to provide a simplified and unified interface for photo management within Android applications, allowing developers to quickly integrate camera functionalities, secure photo storage, and access with user authentication using the device's built-in biometric capabilities.
To integrate SeonSDK into your Android application, follow these simple steps:
-
Add AAR Files to Your Project:
- Download the SeonSDK Libraries and place them in your project’s
libsfolder.
- Download the SeonSDK Libraries and place them in your project’s
-
Update
AndroidManifest.xmlfor Camera and Media Permissions:- Add the following lines to request permissions for camera and media access:
<uses-feature android:name="android.hardware.camera" android:required="false" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
- Add the following lines to request permissions for camera and media access:
-
Add Dependencies to
build.gradle.kts(App Module):- Add the following dependencies to your app’s
build.gradle.ktsfile to include required libraries:implementation("androidx.biometric:biometric:1.1.0") implementation("androidx.camera:camera-core:1.3.4") implementation("androidx.camera:camera-camera2:1.3.4") implementation("androidx.camera:camera-lifecycle:1.3.4") implementation("androidx.camera:camera-view:1.3.4") implementation("androidx.camera:camera-extensions:1.3.4") implementation("androidx.exifinterface:exifinterface:1.3.7")
- Add the following dependencies to your app’s
-
Initialize the SDK in Your Application Class:
- Initialize the SeonSDK inside your application class by adding the following code:
class TestApplication : Application() { override fun onCreate() { super.onCreate() // Initialize PhotoSDK with the application context PhotoSDK.initialize(this) } }
- Initialize the SeonSDK inside your application class by adding the following code:
Below is a quick guide on how to use SeonSDK in your application:
// Import the SDK
import com.example.seonsdk.main.PhotoSDK
// Use the takePhoto() method to capture photos
val cameraFragment = PhotoSDK.takePhoto(
onError = { errorMessage ->
// Handle error (e.g., show a toast)
println("Error capturing photo: $errorMessage")
},
onSuccess = { photoFile ->
// Handle the captured photo (e.g., display or save the file)
println("Photo captured: ${photoFile.path}")
}
)
// Use the accessPhotos() method to access photos securely
PhotoSDK.accessPhotos(
activity = this, // Pass the current activity
onAuthenticated = { galleryFragment ->
// Display the gallery fragment
println("Gallery accessed successfully.")
},
onError = { errorMessage ->
// Handle authentication or access error (e.g., show a toast)
println("Error accessing gallery: $errorMessage")
}
)To see SeonSDK in action, check out the sample application that demonstrates the full capabilities of the framework. This sample app shows how to integrate and utilize the SDK for photo capture, storage, and gallery access.
SeonSDK aims to simplify photo management in Android applications, providing a clean and intuitive interface for developers. We welcome feedback and contributions to help improve the library. If you encounter any issues or have suggestions, feel free to open an issue or submit a pull request on GitHub.
Thank you for using SeonSDK! 🚀