I need some help with my app, I have a foreground service which will run within a range of hours on a daily basis, the start time and end time are set by the user, I'm having a problems and you might be able to help me:
to start the service and stop it at the desired times, I created two services, the main service which will do the main functionality and another service to turn off the first one and scheduled it using alarmmanager to start at the end time that the user has set, so a summary would be:
alarmmanager-->start main service with Interval of one day at the time specified by the user as start time.
alarmmanager-->start the second service with interval of one day at the time specified by the user as end time, this service will terminate the main service in its onStartCommand method, and then it will stop itself with stopSelf().
however i'm having alot of bugs because for example, if the user sets the service to operate from 8 pm to 2 am and applies this setting at 9 pm, both services will start and stop because the time has already passed, but I want the first service to start and stop at 2 am next day in this case, there are a few more problems of the same type, I don't mind changing the way the app works, the main purpose is to let the service run within specific range of hours set by the user everyday.
another problem is that the interface doesn't look the same on all android devices, I'm not sure how to get this done correctly so you might as well help with it.
12 freelancers are bidding on average $171 for this job
Hi I am very good in Android, Java and other mobile based programming languages. I have been developing android apps for a long time and I would be really happy to help you out.