Add the lines implementation 'edu.cmu.cs.gabriel:client:2.3.0'
and
implementation 'edu.cmu.cs.gabriel:protocol:2.0.1'
to your app's build.gradle
file.
Your project must include either the jcenter()
repository or the
mavenCentral()
repository.
Your app must allow cleartext traffic. If your app does not have an Android
Network Security Config, you must specify android:usesCleartextTraffic="true"
in the
application element
of your Manifest file.
If your app has an Android Network Security Config, you must allow cleartext
traffic using this
config. See
here
for more details. Your app must also request the android.permission.INTERNET
permission.
Create an instance of edu.cmu.cs.gabriel.client.comm.ServerComm
using the
static ServerComm#createServerComm
method.
Example.
This method takes one Consumer
instance resultConsumer
that gets called
whenever a new result is available from the server, and a second Consumer
instance onDisconnect
that gets called when there is a connection problem.
This onDisconnect
consumer should start the process of presenting an error
message to the user, cleaning up the app state, and then bringing the user back
to a screen to modify connection settings.
Send messages to the server using ServerComm
's send
or sendSupplier
methods.
Example.
This library includes instrumentation to measure the average RTT and FPS. These
results can be sent using
Log or written to a
file. You can also implement your own Consumer<SourceRttFps>
that writes
results to a database and logs additional information.
I recommend creating a separate
product flavor
for measurements. Create an instance of MeasurementServerComm
instead of
ServerComm
. Pass an instance of LogMeasurementConsumer
as the
intervalReporter
argument to
MeasurementServerComm#createMeasurementServerComm
, to send measurements to log
output. Use CsvMeasurementConsumer
to write measurements to a file.
Example
Add the line implementation 'edu.cmu.cs.gabriel:camera:2.3.0'
to your app's
build.gradle file. Create an instance of CameraCapture
.
Example
You should also add the following lines to your app's AndroidManifest.xml
file:
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.CAMERA" />
- Update the VERSION_NAME parameter in
gradle.properties
. You can add-SNAPSHOT
to the end of the version number to get a snapshot published instead. - Open the
Gradle
tab in the top right of Android studio. - Open
gabriel-android-common/client/Tasks/upload
. - Run uploadArchives
- Snapshots will be published to https://oss.sonatype.org/content/repositories/snapshots/edu/cmu/cs/gabriel/client/.
- Releases should show up at https://oss.sonatype.org/#stagingRepositories.
- Publish a release by first clicking the
Close
button. Then click theRelease
button when it becomes available. - Releases will be published to https://repo1.maven.org/maven2/edu/cmu/cs/gabriel/client/.
- Publish a release by first clicking the