Energy-efficient advertising in mobile applications