Modeling the energy consumption of mobile apps