Upload Test

Adding To build.sbt

sbt
libraryDependencies += "com.quadstingray" %% "speedtest" % "0.8.2"
Maven
<dependencies>
  <dependency>
    <groupId>com.quadstingray</groupId>
    <artifactId>speedtest_2.13</artifactId>
    <version>0.8.2</version>
  </dependency>
</dependencies>
Gradle
dependencies {
  implementation "com.quadstingray:speedtest_2.13:0.8.2"
}

Run Upload Test

The Framework choose the automatic method to find best server.

sourceval speedTestResult = SpeedTest.runUpload()

Run Upload Test with specific Server

Removed from API because Token needed

Run Upload Test with CallBacks

With CallBacks you can update your UI do somethings at running the test.

sourcevar upCount        = 0
var upBandwidthSum = 0.0
def upCallBack(result: MeasurementResult): Unit = {
  upCount += 1
  upBandwidthSum += result.bandwidth.bytePerSeconds
}

val speedTestResult = SpeedTest.runUpload(uploadMeasurementCallBack = upCallBack)