Use service
. Read this and this about details of service.
You can keep your activity running in the background. But I think it is definitely a better idea to keep a service running in the background. You will get a basic idea about the service by reading above two links.