I have a java application that checks databases, gets data from a php file, and sends notification to android phones. What is the best service to use in this situation?
I was thinking to use Google App Engine and run a cron job for every few minutes. Not sure if I am going about this incorrectly though.
Google App Engine is a good choice to do this work. To do what you want, you will need to do the following:
Understand basics of Google App Engine Java and deploying simple applications. Make that as the first step. The Getting Started Guide for App Engine Java is a good start: https://developers.google.com/appengine/docs/java/gettingstarted/
Next step would be to learn about how to make Network calls (URL Fetch) from App Engine. This would mean invoking your PHP Server API. Details can be found here: https://developers.google.com/appengine/docs/java/urlfetch/overview
Now you can schedule your URL Fetching code to run every XX hours, etc or at whatever scheduled you want as per the CRON Expression. Writing a Task is covered here: https://developers.google.com/appengine/docs/java/taskqueue/ and you could look at Push Queues. App Engine also provides Backends for sophisticated background processing jobs but you might not need that at this point
Preferably you should pickup next how to store data in the App Engine datastore. This is important because you might want to fetch data from your PHP Server and then instead of synchronously sending the notifications, you should instead put them in a datastore, so that they can be sent/retried by another Task. This way you separate the Fetching logic from the Notification Logic and will give you flexibility and help in debugging. For Datastore guide: https://developers.google.com/appengine/docs/java/datastore/
Finally, pushing notifications to Android phones, will mean Google Cloud Messaging. http://developer.android.com/guide/google/gcm/index.html
Hope this gives a good roadmap. All The Best.