Eggs and candies are essential part of pokemon go. You need candies to evolve/power up pokemon and eggs generally hatch better pokemons than wild. In the beginning of pokemon go, you need to keep pokemon go on all the time to track the distance traveled. but, it all changed when they introduced adventure sync feature.
Adventure sync is a really cool feature added in pokemon go. It tracks distance traveled even when you pokemon go app is closed. This will greatly help in hatching eggs and earning buddy candies. It uses the default distance tracking apps of iOS (Apple Health) and Android (Google Fit) to track the distance traveled. This will help in the adventure rewards introduced by pokemon go. Currently, there are three levels of rewards 5 KM, 25 KM and 50 KM.
Treadmill + Adventure Sync
Apple health and Google fit both track indoor workouts like elliptical and treadmill. But, the accuracy is slightly lower than apps like Nike Run Club. I personally use Nike Run Club to track my indoor workout and it works great. Additionally, Nike Run Club syncs the workout data with Apple Health and google fit. This allows me to always clock 50KM every week without having to go outside.
My advice when using Nike Run Club to track indoor runs is to ensure that you swing your arms as much as possible. This will result in a higher distance tracked. Happy workouts! Happy Candies! Happy Eggs!