-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: rahul27 <[email protected]>
- Loading branch information
1 parent
19f595b
commit 268ac36
Showing
7 changed files
with
78 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ The SDK reference can be found at [android.sdk-docs.moonsense.io](https://androi | |
This repo includes three sample apps: | ||
|
||
- `sample-app` - This sample app demonstrates the use of the Moonsense Android SDK within an application context. The example in this case is quite simple and minimal and can serve as a good starting point for developers looking for a quick integration. | ||
- `sample-payment-app` - This sample app demonstrates the library usage of the Moonsense Android SDK. Note that the `sample-payment-app` does not directly depend on the Moonsense Android SDK. Instead it includes a dependency to the `sample-payment-sdk` which then packages the Moonsense Android SDK. The app developer here does not have any visibility into the Moonsense Android SDK as they only interface with the `sample-payment-sdk`. The example is useful for SDK/library developers looking to integrate the Moonsense Android SDK. This sample app comes in two variants, the features variant records a session with the [Features SDK](https://docs.moonsense.io/articles/sdk/feature-generation) and the standard variant does not. | ||
- `sample-payment-app` - This sample app demonstrates the library usage of the Moonsense Android SDK. Note that the `sample-payment-app` does not directly depend on the Moonsense Android SDK. Instead it includes a dependency to the `sample-payment-sdk` which then packages the Moonsense Android SDK. The app developer here does not have any visibility into the Moonsense Android SDK as they only interface with the `sample-payment-sdk`. The example is useful for SDK/library developers looking to integrate the Moonsense Android SDK. This sample app comes in two variants, the features variant records a session with the [Features SDK](https://docs.moonsense.io/articles/sdk/feature-generation) and [Network Telemetry](https://docs.moonsense.io/articles/network-telemetry/getting-started) configuration while the standard variant does not. | ||
- `sample-core-app` - This sample app shows how to integrate a variation of the Moonsense Android SDK called the Core SDK. For all intents and purposes the standard Android SDK (referred to as the Cloud SDK) should suffice for a majority of use cases. In case you do need specialized use of the Moonsense SDK contact [[email protected]](mailto:[email protected]) for access. Additional information regarding the Core SDK can be found here - [Advanced Usage](https://docs.moonsense.io/articles/sdk/advanced-usage). | ||
|
||
## Terms Of Service | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...-sdk/src/features/java/io/moonsense/sample/payment/sdk/generators/FeatureConfigFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package io.moonsense.sample.payment.sdk.generators | ||
|
||
import io.moonsense.features.CompositeFeatureGenerator | ||
import io.moonsense.features.DeviceMotionFeatureGenerator | ||
import io.moonsense.features.PointerFeatureGenerator | ||
import io.moonsense.features.operator.Operator | ||
import io.moonsense.features.transform.FocusChangeTransform | ||
import io.moonsense.models.v2.FocusChange | ||
import io.moonsense.sdk.config.NetworkTelemetryConfig | ||
import io.moonsense.sdk.config.SessionConfig | ||
import io.moonsense.sdk.features.FeatureGenerator | ||
|
||
/** | ||
* Responsible for returning a [SessionConfig] with [FeatureGenerator]s | ||
* and a [NetworkTelemetryConfig]. | ||
*/ | ||
internal object FeatureConfigFactory { | ||
|
||
/** | ||
* Return a session config with features generated by a set of | ||
* configured [FeatureGenerator]s. | ||
* | ||
* Also enable ip based network telemetry data that captures | ||
* network based features. | ||
*/ | ||
fun getSessionConfig(): SessionConfig? = SessionConfig( | ||
featureGenerators = listOf( | ||
// generators for all device motion sensors | ||
DeviceMotionFeatureGenerator(), | ||
// generators for summarizing pointer data | ||
PointerFeatureGenerator(), | ||
// a composite generator that count the number of times an edit text gains focus | ||
CompositeFeatureGenerator( | ||
listOf( | ||
FocusChangeTransform( | ||
"focus_gained" to { focusChange -> | ||
if (focusChange.type == FocusChange.Type.FOCUS_GAINED) { | ||
1.0 | ||
} else { | ||
null | ||
} | ||
} | ||
) | ||
), | ||
Operator.COUNT | ||
) | ||
), | ||
networkTelemetryConfig = NetworkTelemetryConfig(ip = true) | ||
) | ||
} |
26 changes: 0 additions & 26 deletions
26
...k/src/features/java/io/moonsense/sample/payment/sdk/generators/FeatureGeneratorFactory.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...-sdk/src/standard/java/io/moonsense/sample/payment/sdk/generators/FeatureConfigFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.moonsense.sample.payment.sdk.generators | ||
|
||
import io.moonsense.sdk.features.FeatureGenerator | ||
import io.moonsense.sdk.config.NetworkTelemetryConfig | ||
import io.moonsense.sdk.config.SessionConfig | ||
|
||
/** | ||
* Responsible for returning a [SessionConfig] with [FeatureGenerator]s | ||
* and a [NetworkTelemetryConfig]. | ||
*/ | ||
internal object FeatureConfigFactory { | ||
|
||
/** | ||
* The standard version does not record features or report | ||
* network telemetry data. | ||
*/ | ||
@Suppress("FunctionOnlyReturningConstant") | ||
fun getSessionConfig(): SessionConfig? = null | ||
} |
15 changes: 0 additions & 15 deletions
15
...k/src/standard/java/io/moonsense/sample/payment/sdk/generators/FeatureGeneratorFactory.kt
This file was deleted.
Oops, something went wrong.