Hatching eggs sucks. I'd like to hatch these eggs while I'm doing my daily running exercises. Will my movement be tracked if the app is open but the phone is locked? I ask because I attempted this with a treadmill, and I made no progress whatsoever towards my eggs.
Unfortunately distance walked only counts via GPS and not pedometer, so running on a treadmill won't lead to eggs hatching. Also the app does have to be open and the phone unlocked. There is a "battery saver" option in the in-game settings. This will dim the screen when your phone is up-side-down, such as in your pocket.
This app let's you lock your screen, put in your pocket or whatever and still play. Has a battery save feature as well. https://play.google.com/store/apps/details?id=com.pokegoassist.pokepal.droid