Reducing Energy Consumption and Latency of Applications on Wireless Devices