I was following this codelab Here as you can see there's a common Repository to share between the Mobile App and the Android Auto app (that runs in the DHU). I was wondering how to update a e.g a string in the Auto app from the Mobile app ? I have tried to use sharedprefs
but as these two apps has different context
I didn't succeed. Also content provider
didn't work because two apps lives in two different hardware I guess. What are my other options ? Thanks for your help in advance.
Update data from the Mobile App to the Android Auto app
205 Views Asked by ruben At
2
There are 2 best solutions below
1

If you have two separate apps running in different contexts (e.g., a mobile app and an Android Auto app), sharing data between them can be challenging due to the sandboxed nature of Android apps for security reasons. However, you can consider a few approaches to achieve communication or data sharing between these apps:
Using a Shared Database or File
Content Provider with Permissions
Using Broadcasts or Intents
Custom Networking or API
Shared Preferences (with Content Provider or File)
You could use Firebase's real-time database or another cloud service.
With real-time services you will change each variable easily