Skip to content

Commit

Permalink
ADD documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ninovanhooff committed Sep 14, 2022
1 parent 0babbc6 commit b2a61db
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,36 @@ bool | Specifically checks whether com.samsung.android.app.talkback.talkbackserv
### System
| Key | Value | Notes |
|-|-|-|
| `applicationId` | String | identifier for the app for which data is collected, as set in the app's Manifest. iOS: bundleId | nl.hema.mobiel |
| `defaultLanguage`| en, nl, ... |
| `sdkVersion` | int | 29 for Android 10. [See this list](https://source.android.com/setup/start/build-numbers)
|`manufacturer`|String|eg. `samsung`|
|`modelName`|String| May be a marketing name, but more often an internal code name. eg. `SM-G980F` for a particular variant of a Samsung Galaxy S10|
| Key | Value | Notes | |-|-|-| | `applicationId` | String | identifier for the app for which data
is collected, as set in the app's Manifest. iOS: bundleId | nl.hema.mobiel | | `defaultLanguage`|
en, nl, ... | | `sdkVersion` | int | 29 for Android
10. [See this list](https://source.android.com/setup/start/build-numbers)
|`manufacturer`|String|eg. `samsung`| |`modelName`|String| May be a marketing name, but more often
an internal code name. eg. `SM-G980F` for a particular variant of a Samsung Galaxy S10|
## Development
All classes and functions that are not used by implementing apps should have `internal` visibility.
Since this a library, all errors should be caught so that implementing apps don't crash. During
development, you can use the debug flavors to allow the sample app to crash in cause of an
Exception (see `handleException()`). When testing, use the release variants to make sure that
exceptions don't crash the implementing apps.
Catch Throwable; not Exception. Since Throwabl is the superclass of Exception, this will make the
lib more resilient to crashes.
### Setup
1. Get the API key from [The Api project](https://github.com/Q42/accessibility-pipeline/tree/main/api). Use this key in the next step.
2. Create a file called `secrets.properties` in the root of the project (not in the app folder). Contents:
1. Get the API key
from [The Api project](https://github.com/Q42/accessibility-pipeline/tree/main/api). Use this key
in the next step.
2. Create a file called `secrets.properties` in the root of the project (not in the app folder).
Contents:
```
apikey="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```
Note that this file will be ignored by git.
Note that this file will be ignored by git.
3. Change the SampleApplication to construct a Q42Stats object for a real firestore collection.
### Publishing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ internal object AccessibilityCollector {
name,
0
) == 1
} catch (e: Exception) {
} catch (e: Throwable) {
Q42StatsLogger.e(TAG, "Could not read system int $name. Returning null", e)
null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import java.io.Serializable
* a different hash, not being equal in comparisons etc.
*/
internal fun Map<String, Any>.toQ42StatsApiFormat(): Map<String, Any> {
val fireStoreMap = this.mapValues { entry ->
val q42StatsMap = this.mapValues { entry ->
mapFieldValue(entry)
}
return fireStoreMap
return q42StatsMap
}

@Suppress("UNCHECKED_CAST")
Expand Down

0 comments on commit b2a61db

Please sign in to comment.