This sample application is here to help customers get up and running with Playfinity SDK on Android.
The Playfinity SDK communicates with playOS on the Playfinity console.
Playfinity.io ✔️ Facebook ✔️ Instagram ✔️ Youtube
- Playfinity SDK embedded
- Playfinity console discovering and pairing (BLE)
- Listening and reacting to console events
- Sounds
- Ball throwing sample
- Trampoline jumping sample
- Trick ball sample
- Cloud transporter
- Coded in Kotlin
Sample app screenshot with successfully connected SDK and Playfinity Console (real device photo)
This application targets Android (5.0) Lollipop and newer.
To successfully discover Playfinity Console make sure that your device supports Bluetooth Low Energy (BLE).
AndroidManifest.xml
<meta-data
android:name="io.playfinity.sdk.applicationKey"
android:value="SAMPLE_TEST" />
<meta-data
android:name="io.playfinity.sdk.developerId"
android:value="SAMPLE_TEST" />
<meta-data
android:name="io.playfinity.sdk.apiUrl"
android:value="https://apps.playfinity.io" />
<meta-data
android:name="io.playfinity.sdk.cloudApiUrl"
android:value="https://cloud.playfinity.io" />
Playfinity Console can operate in a several different modes. For example it can act like a ball or a trampoline ankle band.
While initializing Playfinity SDK we can choose what mode to use:
PlayfinitySDKBuilder()
.enableLogging(BuildConfig.DEBUG)
.addCallback(this)
.build(this, io.playfinity.sdk.device.SensorType.Ball)
ℹ️ Please note that the console will produce different events io.playfinity.sdk.SensorEventType
while working under specific mode.
Puts the console into Ball
mode.
Events: Throw
, Catch
, Miss
.
Puts the console into Trampoline
mode.
Events: Jump
, Land
.
Puts the console into Football
mode, to provide football-like experience.
Events: Kick
, Bounce
, Miss
.
Playfinity Cloud Transporder enables an option to send console events to a specified endpoint in real time.
To toggle it, you need to grand a custom permission Playfinity Developer Mode
in your application settings.
To change endpoint url replace:
<meta-data
android:name="io.playfinity.sdk.cloudApiUrl"
android:value="https://cloud.playfinity.io" />
with your own URL.
Copyright 2020 Playfinity.io
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http:https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.