Technical challenges in capturing mobile data


While we continue working on the analysis of all the information we talked about in previous posts, we believe it is appropriate to highlight the difficulty of collecting some of this data. Specifically, we are referring to the data coming from the smartphone's sensors and that we must collect continuously: physical activity, network, light, noise, screen status, etc.

It is common knowledge that there is a wide variety of companies that manufacture smartphones (Samsung, Huawei, Xiaomi, etc.) and that each of them offers the user different models. Samsung, for example, manufactures dozens of different models. Many will also know that there are several operating systems that manage the resources of these smartphones, the most widely used at present being Android (with approximately 71% of the market share) and iOS (28%).

If this diversity seems little to anyone, perhaps they will change their mind if they consider that for each particular operating system there are different versions that co-exist in the same period of time, each with its own functionalities (Android version 13 has been released just some days ago). Finally, to put the icing on this "cake of different smartphones", each manufacturer usually adds an additional layer of its own to the operating system used, so that even if two cell phones use, for example, the same version of Android, both may have a different user interface and resource management (especially those related to energy saving).

In this context, the development of the POSTCOVID-AI mobile app is proposed, an application that must be able to measure the sensor data of all these smartphones in a continuous way. Some of the most important decisions we have taken for its development are:

- To use Flutter as the programming language (developed by Google). Programs written in Flutter have the advantage of being able to be used on multiple platforms using different operating systems, including Android and iOS.

- To use Flutter libraries that are compatible with the largest possible number of operating systems currently used by cell phones.

Although these decisions seem to solve all our problems, experience has shown us that all that glitters is not gold. Let's remember that we need an application that is continuously collecting information from a large number of sensors on the cell phone. Obviously, these measurements must be performed transparently to the user, so this part of the application must run silently in the background, without disturbing the user. And this is a problem for several reasons:

- These processes run without a "graphical interface", i.e., they do not have an easy way to communicate with the user. In our case, the developed application has a part with a graphical interface that only appears at the beginning of the study. It is only at this precise moment that we must take the opportunity to request the user's permission to access the information from the smartphone's sensors.

- Operating systems do not like processes of this type because they could be malicious processes that are spying on the user and, in addition, they can involve high energy consumption. iOS, in fact, does not like it at all, so it does not allow unknown applications (such as ours) to use this type of processes. The only alternative in this case would be to have a timer that starts the silent app every so often but, again, the power optimizations added by iOS make the frequency with which this can be done too low and, on top of that, very unreliable. This has forced us to discard, for the time being, iPhones from our study.

In the case of Android, it has been possible to adopt this solution, although it has not been easy either: the application cannot be downloaded from the Google Play Store due to its "complex" features and the permissions to allow the silent application to run without restrictions and to run every time the cell phone starts, in many cases, must be activated manually by the user. To compensate for this circumstance, we have written a simple instruction manual for the installation of the application. And considering the enormous diversity of manufacturers, models and versions of Android that we mentioned at the beginning... we will only say in this regard that, as Michael Ende said in "The Neverending Story": that is another story and shall be told another time.