Machine Learning in Resource-constrained Devices: Algorithms, Strategies, and Applications