Can i do an activity in not running state

Everyday on a particular time i want to one service call. at that time user may not use the app so can i do the api call?
and can i track the device lock time?