Search code examples
androidgeolocationlocation

Sending location in one android app and displaying the sent location in another app


I have two apps, in one app i need the location to be acquired and then sent to server and then another app to read all sent locations and respond to them. The second app uses the Google maps API to show the locations sent by different people using the first app. How do i achieve this?


Solution

  • Use Android Service which will run on your App2 background connected to the Server, whenever a new data is uploaded to server Service working in App2's background will process it.

    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.

    Look here to know, How to communicate with Android Service.