0

I am developing a automation testing application for Android. My requirement is even when my application is not running in the foreground, there should be a process/service which should run in background continuously monitoring and uploading logs to an FTP server.

How can I achieve such processing? Also, how can I start that service automatically when device reboots?

Its like WhatsApp. Even when WhatsApp is not running in foreground (when device reboots) its service continuously monitors for incoming messages.

Please help. Your knowledge is highly appreciated !!!

Patrick M
  • 10,547
  • 9
  • 68
  • 101
Faiz Ali
  • 141
  • 1
  • 11

1 Answers1

0

You should take a look at Services:

http://developer.android.com/guide/components/services.html

About restarting the Service after a reboot, you have to register your app to receive the proper Intent (android.intent.action.BOOT_COMPLETED). See this question.

And finally, I don't think WhatsApp or any other app nowadays is constantly checking for incoming messages. Push notifications is by far a much better approach. See documentation about GCM.

Community
  • 1
  • 1
aows
  • 526
  • 1
  • 4
  • 10