Methods Hub (beta)

How to work with Android App Logging Data

Abstract:

Learn to import, clean, transform, and analyze Android log data using R

Type: Tutorial
Difficulty: Beginner
Duration: About half a work day
License: MIT License
Programming Language: R
Code Repository: https://github.com/patrickzerrer/How-to-work-with-Android-App-Logging-Data
Code Repository Git Reference: 0561e0c
Download URL: https://github.com/patrickzerrer/How-to-work-with-Android-App-Logging-Data/archive/refs/heads/main.zip
Published: May 15, 2026
Cite Feedback Try it out

1 Course Overview

1.1 Learning Objectives

This guide aims to provide learners with the conceptual understanding and practical skills needed to import, clean, transform, and analyse Android log data using R and the tidyverse ecosystem. By the end of the module, learners should be able to transform raw device logs into meaningful analytical data sets suitable for behavioural, usability, or digital phenotyping studies.

This includes:

  1. Understanding the structure of Android log data, including key variables commonly found in app logs.
  2. Importing and preprocessing both already processed and raw Android log data using the tidyverse.
  3. Computing and visualising key usage measures such as visits, session durations and sequences.

1.2 Target audience

This guide is designed for researchers, data analysts, and students who are interested in working with mobile sensing or digital trace data, particularly Android log files. It assumes a basic familiarity with R and the tidyverse ecosystem, including data manipulation with dplyr and data visualisation with ggplot2. Participants should already understand fundamental data analysis concepts and be ready to apply them to the challenges of preprocessing and analysing complex, time-based log data.

1.3 Setting up the computational environment

Install the R packages.

install.packages("dplyr")
install.packages("lubridate")
install.packages("tidyr")
install.packages("ggplot2")
install.packages("extrafont")
install.packages("forcats")
install.packages("stringr")

And load the R packages.

library(dplyr)
library(lubridate)
library(tidyr)
library(ggplot2)
library(extrafont)
library(forcats)
library(stringr)
# Effectively disable scientific notation
options(scipen = 999)

1.4 Duration

You’ll be able to complete the module in about half a day.

2 Social Science Use Cases

This method has been used in previous studies to evaluate information usage of Fridays for Future supporters (e.g. Zerrer, 2024), research on well-being (e.g. Klingelhoefer et al., 2025) and smartphone usage patterns (e.g. Toth et al., 2025).

Image generated by Midjourney

3 Some Context about Android App Log Data

Android app log data are automatically generated records that capture interactions between users, apps, and the operating system on Android devices. System services and applications record events such as app launches, screen on/off states, foreground and background transitions, notifications, and sensor activities. Each event is typically time-stamped and includes the event type, the app or process involved, and contextual metadata such as battery status, network connectivity, or user interactions. These digital traces allow researchers to reconstruct usage episodes in detail and study digital mobile behaviour.

4 The red or blue pill?

Since the degree of preprocessing and thus the structure of app logging data can vary, we will look at two example cases. The first case is based on a data set that has already been preprocessed to a relatively high degree by a panel provider, thus providing a good introduction to some basic concepts in data analysis.

In reference to The Matrix, we call this the “blue” data set. For now, we will remain in the more comfortable world of convenient and rather well-preprocessed data structures. Later in the tutorial, however, we will turn to the “red” data set and confront the messy reality of raw event logs.

5 The blue data set