Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ struct GreetingScreen: View {
getColor(colorScheme: colorScheme, light: .sprenBodyCompBackgroundLight, dark: .sprenBodyCompBackgroundDark).edgesIgnoringSafeArea(.all)

VStack {
let onCancel = SprenUI.config.onCancel
CloseButton(action: onCancel)
if let onCancel = SprenUI.config.onCancel {
CloseButton(action: onCancel)
}

if SprenUI.config.bundle == .module {
Image(SprenUI.config.graphics[.greetings] ?? "", bundle: .module).resizable()
Expand Down
4 changes: 2 additions & 2 deletions Sources/SprenUI/UI/Screens/SprenUI/SprenUI+Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extension SprenUI {
]
public let onReadingStateChange: ((Bool) -> Void)
public let onError: (() -> Void)
public let onCancel: (() -> Void)
public let onCancel: (() -> Void)?
public let onFinish: ((_ results: Results) -> Void)

// only relevant to demo app
Expand Down Expand Up @@ -84,7 +84,7 @@ extension SprenUI {
graphics: [Graphic: String]? = nil,
onReadingStateChange: @escaping ((Bool) -> Void),
onError: @escaping (() -> Void),
onCancel: @escaping (() -> Void),
onCancel: (() -> Void)? = nil,
onFinish: @escaping ((Results) -> Void),
logger: Logger? = nil) {
self.baseURL = baseURL
Expand Down
102 changes: 22 additions & 80 deletions docs/Spren-Vision/Spren-Vision-Android-SDK.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,25 @@ The Android SDK is in Alpha. We're working quickly to expand our support in the

## Device Support and Recommendations

> A supported device function exposed by the SDK is coming soon!

## Tested Devices
### Compatible Devices (Tested)
>
> There may be other compatible, but untested Android devices that are not contained in this list.
>

- Google Pixel 3XL
- Google Pixel 4
- Google Pixel 4a
- Google Pixel 5
- Xiaomi Redmi 9
- Google Pixel 3XL, 4, 4a, 5, 6\*, 6 Pro\*, 7\*, 7 Pro\*
- Xiaomi Redmi 9, Note 10 Pro
- Huawei Mate 20
- Samsung Galaxy S10+
- Samsung Galaxy Note 9, A51, S9, S10, S10+, S20 FE, S21 Ultra, S22, S22+, S22 Ultra
- Motorola Moto G 5G Plus (2020 model)
- LG Velvet
- OnePlus 7 Pro, 9 5G

## Currently Testing
\*Devices with an asterisk are ones that use the wide angle camera for readings. All other devices use the default camera.

- Samsung Galaxy S9, S10 5G, S20 FE 5G, S21 Ultra, and S22+
### Incompatible Devices (Tested)
- Huawei P20 Lite
- Redmi Note 11
- Google Pixel 6a

## Recommendations

Expand All @@ -37,6 +41,11 @@ Currently, we allow users to only perform readings with flash on.
```
2. 30FPS is acceptable, but for best accuracy and UX, we recommend devices that support 60FPS in CameraX. Note that 60FPS or better may be listed in manufacturer's device specifications, thus, be supported in the native camera app, but be unavailable to CameraX.

### End User
1. Rub fingertips and hands to warm up
2. Ensure adequate room lighting
3. Wait a few seconds for reading to initialize

## Installation

1. Visit the [Spren Vision Android SDK Maven Repository](https://search.maven.org/search?q=com.spren) to install the SDK via the Gradle build tool. We encourage using the latest remote binary available. For more information, see the Android docs for [Add build dependencies](https://developer.android.com/studio/build/dependencies).
Expand All @@ -47,7 +56,7 @@ The open source code is available in the [Spren Vision Android SDK GitHub Reposi

## Spren UI

### Finger Camera Example
### Implementation Example

```kotlin
// MainActivity.kt
Expand Down Expand Up @@ -112,73 +121,6 @@ class MainActivity : AppCompatActivity() {
}
```

### Body Composition Example

```kotlin
// MainActivity.kt

import com.spren.sprenui.SprenUI

class MainActivity : AppCompatActivity() {

private lateinit var binding: ActivityMainBinding
private lateinit var hardwareAlert: HardwareAlert

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

// optionally set custom theme
// theme inherits from "Theme.MaterialComponents.DayNight.NoActionBar"
// see themes.xml example below
setTheme(R.style.Theme_SprenUI)

binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

// optionally check if hardware is compatible
hardwareAlert = HardwareAlert(this)
if (!HardwareCheck.isHighPerformingDevice(this)) {
hardwareAlert.show()
}

// set user ID
SprenUI.Config.userId = ...

// optionally set user biological sex
SprenUI.Config.userGender = ...

// optionally set user birthdate
SprenUI.Config.userBirthdate = ...

// after dismissing results screen
SprenUI.Config.onFinish =
{ _, results ->
// user completed a scan!
print(results)
// dismiss SprenUI
}


SprenUI.Config.onCancel = {
// handle user exit of UI flow without completing a scan
}

// optionally override default intro screen graphics
// provide drawable ids for image sets in project
// *all are required for each project if overriding
SprenUI.Config.graphics = mapOf(
SprenUI.Graphic.GREETINGS to <image set drawable id>,
SprenUI.Graphic.PRIVACY to <image set drawable id>,
SprenUI.Graphic.CAMERA_ACCESS_DENIED <image set drawable id>,
SprenUI.Graphic.PHOTOS_ACCESS_DENIED to <image set drawable id>,
SprenUI.Graphic.SETUP_GUIDE to <image set drawable id>,
SprenUI.Graphic.SERVER_ERROR to <image set drawable id>,
SprenUI.Graphic.INCORRECT_BODY_POSITION to <image set drawable id>
)
}
}
```

### Layout and Theme

```xml
Expand All @@ -192,7 +134,7 @@ class MainActivity : AppCompatActivity() {
android:layout_height="match_parent"
app:api_key="@string/api_key"
app:base_url="@string/base_url"
app:project="FINGER_CAMERA" or "BODY_COMPOSITION"
app:project="FINGER_CAMERA"
tools:context=".MainActivity" />
```

Expand Down
54 changes: 1 addition & 53 deletions docs/Spren-Vision/Spren-Vision-iOS-SDK.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Spren UI

### Finger Camera Example
### Implementation Example

```swift
import SwiftUI
Expand Down Expand Up @@ -58,58 +58,6 @@ SprenUI(config: config)

```

### Body Composition Example

```swift
import SwiftUI
import SprenUI

// create SprenUI configuration
let config = SprenUI.Config(
// API
baseURL: "https://test.api.spren.com",
apiKey: "<API key>",

// user
userID: "<user ID>",
userGender: <optional, male, female, or other>,
userBirthdate: <optional, Date>,

// UI
primaryColor: <optional, Color>, // used for buttons
secondaryColor: <optional, Color>, // used for graphics

project: .bodyComp,

// optionally override graphics
// provide names for image sets in main bundle xcassets
// *all are required for each project if overriding
graphics: [
.setupGuide: "<image set name>",
.serverError: "<image set name>",
.privacy: "<image set name>",
.cameraAccessDenied: "<image set name>",
.incorrectBodyPosition: "<image set name>",
.greetings: "<image set name>",
.bodyPosition: "<image set name>"
],

onCancel: {
// user exited UI before completing a scan
// dismiss SprenUI
},
onFinish: { results in
// user completed a scan!
print(results)
// dismiss SprenUI
}
)

// init SprenUI view
SprenUI(config: config)

```

## SprenCapture and SprenCore

### Implementation Example
Expand Down
14 changes: 14 additions & 0 deletions flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 2.2.2

Android: Fixed concurrency exception, fixed null-pointer exception

## 2.2.1

Android: Samsung Galaxy S22 - adding support

## 2.2.0

Android: Improving default camera lens for numerous phone models.

https://docs.spren.com/spren-vision/spren-vision-android-sdk

## 2.1.2

iOS: Fixed frame drop issue
Expand Down
4 changes: 2 additions & 2 deletions flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ android {
}

dependencies {
implementation("com.spren:sprencore:2.0.3")
implementation("com.spren:sprencapture:2.0.4")
implementation("com.spren:sprencore:2.0.5")
implementation("com.spren:sprencapture:2.0.7")
def camerax_version = "1.1.0-rc02"
implementation "androidx.camera:camera-view:${camerax_version}"
implementation "androidx.coordinatorlayout:coordinatorlayout:1.2.0"
Expand Down
8 changes: 4 additions & 4 deletions flutter/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PODS:
- device_info_plus (0.0.1):
- Flutter
- DeviceKit (4.6.1)
- DeviceKit (4.9.0)
- Flutter (1.0.0)
- permission_handler_apple (9.0.4):
- Flutter
- spren_flutter (2.1.2):
- spren_flutter (2.2.2):
- Flutter
- SprenVision (~> 1.2.1)
- SprenVision (1.2.1):
Expand Down Expand Up @@ -39,10 +39,10 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
DeviceKit: 316f28290430467278b8a0d1c895968efa9e16e2
DeviceKit: 847709bf70b78fd9ab765bd571fb9f5f815c3fc1
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
spren_flutter: a78fdb25d70761c197a32f7bbd351d6bf79e6603
spren_flutter: 910bb1aaa6d5d47c3a69c1062bf1d502fb06476a
SprenVision: b86636e06526f1cb5bca5238fc0e72f7cc80ff38
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f

Expand Down
2 changes: 1 addition & 1 deletion flutter/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.1.2"
version: "2.2.2"
sprintf:
dependency: "direct main"
description:
Expand Down
4 changes: 2 additions & 2 deletions flutter/ios/spren_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

Pod::Spec.new do |s|
s.name = 'spren_flutter'
s.version = '2.1.2'
s.version = '2.2.2'
s.summary = "Flutter plugin wrapping Spren"
s.homepage = "https://github.com/Elite-HRV/spren-vision-ios#readme"
s.license = "SEE LICENSE IN LICENSE.pdf"
s.author = "nick <nick@elitehrv.com> (https://github.com/Elite-HRV)"

s.platforms = { :ios => "14.0" }
s.source = { :git => "https://github.com/Elite-HRV/spren-vision-ios.git", :tag => "v2.1.2.flutter" }
s.source = { :git => "https://github.com/Elite-HRV/spren-vision-ios.git", :tag => "v2.2.2.flutter" }
s.source_files = "Classes/**/*"

# Flutter.framework does not contain a i386 slice.
Expand Down
2 changes: 1 addition & 1 deletion flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: spren_flutter
description: Spren flutter plugin
version: 2.1.2
version: 2.2.2
homepage: https://www.spren.com/

environment:
Expand Down
4 changes: 4 additions & 0 deletions react-native/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.1

Android: Samsung Galaxy S22 - adding support

## 2.0.0

###Android Breaking changes in 2.x
Expand Down
4 changes: 2 additions & 2 deletions react-native/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ dependencies {
}
}
// END TODO
implementation("com.spren:sprencore:2.0.0")
implementation("com.spren:sprencapture:2.0.0")
implementation("com.spren:sprencore:2.0.4")
implementation("com.spren:sprencapture:2.0.6")

def camerax_version = "1.1.0-rc02"
implementation "androidx.camera:camera-view:${camerax_version}"
Expand Down
Loading