Code Monkey home page Code Monkey logo

earth-viewer's People

Contributors

h21lab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

earth-viewer's Issues

Internet availability may not be being verified in project

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 a result of this we identified that there is a missing validation of Internet availability within the project which is needed since some network operations are being performed in the application.

As you might know, a device may be connected to a network but may not have Internet connection. Therefore it is recommended for the app to identify whether the device is connected to a network having Internet connectivity before performing a network operation.

In order to address this issue we recommend you to:

  1. Obtain representation of the capabilities of an active network, they are typically obtained through NetworkCallback#onCapabilitiesChanged(Network, NetworkCapabilities) or ConnectivityManager#getNetworkCapabilities(Network)
  2. See: https://developer.android.com/reference/android/net/NetworkCapabilities
  3. See: https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_INTERNET
  4. See: https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_VALIDATED

Not offering options to the user to control data usage

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 result of this we identified some code locations that might have network related problems.

In this case, we address the code locations that are related to a potential issue concerning not offering to the users control over their usage of network resources. If your application performs network operations, you should provide user settings that allow users to control your app’s data habits, such as how often your app syncs data, whether to perform uploads/downloads only when on Wi-Fi, or whether to use data while roaming.

In order to address this issue we recommend:

  1. The declaration of an intent filter for the ACTION_MANAGE_NETWORK_USAGE action to indicate that your application defines an activity that offers options to control data usage. ACTION_MANAGE_NETWORK_USAGE shows settings for managing the network data usage of a specific application.

  2. https://developer.android.com/training/basics/network-ops/managing#implement-preference-activity

Potential Code Location not offering options to the user to control data usage

Within the Manifest one can notice the usage of android.permission.INTERNET but no ACTION_MANAGE_NETWORK_USAGE

<uses-permission android:name="android.permission.INTERNET" />

Avoid synchronous operations implementation

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 result of this we identified some code locations that might have network related problems.

In this case, we address the code locations that are related to a potential issue because of implementing synchronous operations. As you might know synchronous request are not recommended and its usage is discouraged.

  1. In synchronous operations, tasks are performed one at a time and only when one is completed, the following is unblocked.

  2. In asynchronous operations, you can move to another task before the previous one finishes, allowing you to deal with multiple requests simultaneously.

Moreover, by avoiding this approach, it is less likely to perform network operations on the main thread. Android requires you to perform network operations on a thread other than the main UI thread; a NetworkOnMainThreadException is thrown otherwise.

In order to address this issue we recommend you to:

  1. See: https://developer.android.com/training/basics/network-ops/connecting
  2. Consider alternative libraries (e.g., Retrofit) handling asynchronous operations

Potential Code Location with synchronous operations:

Network Type may not be being verified in project

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.

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.

Application data

I've noticed that, the more data you download in the app, the more they are stored in the apps data, not the cache. So, I guess that the app size will increase significantly by time. Is that data deleted after they're expired? I think they should be stored in the app's cache.

Features request

  1. Add an index of the colors used, like in the CCI website. At the bottom of the screen would be handy.
  2. Add Aurora activity map.

A network request may not be being handled on failure

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 result of this we identified some code locations that might have network related problems.

In this case, we address the code locations that are related to a network request which is not being assessed on failure. In order to avoid misbehaviour when performing network operations it is recommended to handle failure scenarios.

In order to address these issues we recommend:

  1. To add a try statement allowing you to define a block of code to be assessed while being executed.
  2. To implement a catch statement in which one defines a block of code to be executed if an error occurs.

Potential Code Location not handling failure scenarios when performing a network request

There is no try-catch statement handling the openConnection() request in:

connection = (HttpURLConnection) new URL(url).openConnection();

Despite the fact there is a throws IOException, It would be better to handle the issue within the method in order to directly provide informative message to the user

private HttpURLConnection openConnection(String url) throws IOException {

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.