Reputation: 179
I am newbie to android. I am creating file sharing application. When user1 asks to user2 for file, user2 will get notification and further upload and download process will execute.
Question: How can I implement such task which will keep track about some one has asked for file? I have created database in which entry will be done when someone asks for file. But how android device can constantly check that entry?
I want such mechanism which is used by gmail to check every time for email. When mail comes, it shows notification.
Please help me to create such a background processing. Any help appreciated. Thanks in advance.
Upvotes: 1
Views: 38
Reputation: 179
I got an answer. I will have to use Google FCM push notification. I was unaware about that before. At last I found solution. Thanks for help..
Upvotes: 0
Reputation: 425
I think what you are looking for is a Service.
A Service is an application component that can perform long-running operations in the background, and it does not provide a user interface. Another application component can start a service, and it continues to run in the background even if the user switches to another application. Additionally, a component can bind to a service to interact with it and even perform interprocess communication (IPC). For example, a service can handle network transactions, play music, perform file I/O, or interact with a content provider, all from the background.
Read more about services here
Upvotes: 1