Measurement-based methodology for modelling the energy consumption of mobile devices