• Solutions
    • Streamroot DNA
    • DNA Complete
    • DNA Enterprise
    • Compass
  • Company
    • About
    • Careers
    • Partners
  • Customer Stories
  • Demo
  • Docs
  • Blog
Request a Trial
    • Streamroot DNA
    • DNA Complete
    • DNA Enterprise
    • Compass
  • Demo
  • Docs
  • Blog
  • Sign In
  • Request a Trial

Upload/Download rules API for Android

  1. Streamroot Documentation
  2. Android
  3. Client API for Android

The Upload/Download rule API setters allow you to customize the activation of Streamroot DNA™ upload and download, either based on network type or your own custom logic.

 

Note
These client-side setters will take precedence over the values set in the Properties section of the Streamroot Dashboard, please refer to this article to learn more about them.

 

dnaDownloadAllowed and dnaUploadAllowed

They start with the value true and can be changed during the user's session.

If set to false, users won't download or upload on the Streamroot DNA network.

These setters do not depend on the network type and will always be applied.

 

dnaDownloadOnCellularAllowed and dnaUploadOnCellularAllowed

They start with the value null but will switch to the values defined in the dashboard right after the client contacts Streamroot's backend.

If set to false, the user will not download or upload through Streamroot DNA when they are connected to a network with potential data limitation (Cellular and others*), they will download all of their video data through the CDN instead.

These setters take precedence over any rules defined in Streamroot Dashboard (in the property section).

 

dnaDownloadOnWifiEthernetAllowed and dnaUploadOnWifiEthernetAllowed

They start with the value null but will switch to the values defined in the dashboard right after the client contacts Streamroot's backend.

If set to false, the user will not download or upload through Streamroot DNA when they are connected to a network with no data limitation (Wi-Fi and Ethernet*), they will download all of their video data through the CDN instead.

These setters take precedence over any rules defined in Streamroot Dashboard (in the property section).

 

The diagram below gives you the detailed steps for the Upload use-case. The same can be applied for Download.

API_Diagram.svg

 

Example

To get the dnaDownload status

get() = dnaContext?.dnaBehaviourService?.dnaDownload ?: false

 

To set the dnaDownload to false

set(value) {
    dnaContext?.dnaBehaviourService?.dnaDownload = false
}

 

* To learn more about the different network types, please refer to our documentation on the Download and Upload rules.

  • Facebook
  • Twitter
  • LinkedIn
  • Google+
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request
Return to top

Related articles

  • Upload/Download rules API for Web
  • Client API overview for Web
  • Android Compatibilities
  • ExoPlayer
  • Statistics API for Android

SOLUTIONS


  • STREAMROOT DNA™
  • DNA COMPLETE
  • DNA ENTERPRISE
  • COMPASS

COMPANY


  • ABOUT
  • CAREERS
  • PARTNERS

RESOURCES


  • DEMO
  • DOCUMENTATION
  • CUSTOMER STORIES
  • BLOG
  • FAQ

CONTACT US


  • CONTACT US
Privacy Policy