cbeyls / fosdem-companion-android

FOSDEM Companion for Android
Apache License 2.0
138 stars 93 forks source link

Network Type may not be being verified in project #70

Closed amazuerar closed 8 months ago

amazuerar commented 3 years ago

Dear Developer!

My name is Alejandro Mazuera-Rozo, I am a PhD Student at Universidad de los Andes, and at Università della Svizzera italiana. I am part of a research on the usage of network libraries within android apps. As you might know, a device can have various types of network connections. For the full list of possible network types, see https://developer.android.com/reference/android/net/ConnectivityManager. Therefore it is recommended for the app to identify the type of network available before performing a network operation.

Note: Wi-Fi is typically faster. Also, mobile data is often metered, which can get expensive. A common strategy for apps is to only fetch large data if a Wi-Fi network is available.

In order to address this issue we recommend the following resources:

  1. https://developer.android.com/training/basics/network-ops/managing
  2. https://developer.android.com/training/efficient-downloads/connectivity_patterns
  3. https://developer.android.com/reference/android/net/NetworkCapabilities
  4. Applications should use NetworkCapabilities#hasTransport or requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback) to request an appropriate network.
cbeyls commented 2 years ago

The app does not load large amounts of data so I don't think it makes sense to provide an option to only download large data on Wi-Fi.

cbeyls commented 2 years ago

Also note that the app relies on the If-Modified-Since HTTP header to skip downloading the new schedule in case it didn't change and save bandwidth.