I'm creating an Android application that sends out SMS messages. I've got everything working except for one issue; It does not send out messages unless the app is open.
My code for sending is basic:
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneNumber, null, messageToSend, null, null);
Like @CommonsWare said, you need to handle your specific time logic. Why not use an AlarmManager which will call a Service in which your code for sending the sms actually "happens". If you do use an AlarmManager, please note that different versions of Android will (likely) be handled by different methods related to AlarmManager, possibly including code to reset the AlarmManager (if necessary). You also have to be aware of changes to how Services are managed in "the background" from Marshmallow on....
**EDIT: ** Please be aware that when rebooting your device you will have to reset your AlarmManager as well.