For an app I need to develop, I need to be able to sync with both gmail and facebook data using a SyncAdapter. I'm hoping to sync with the local facebook and gmail apps (if available) instead their remote servers. Syncing with the local apps would mean less battery usage, less network usage, faster syncing, etc. Of course, if needed, I will set the correct permissions.
My questions:
If none of these are available, I guess I'll need to fetch the data myself, so that's not relevant for this question.
I can't speak for Facebook, but the GMail app doesn't allow this. It used to work previously, but they have since secured it so that only Google apps can query the email content provider. The best you can do is get the number of messages with the labels API. You can get an authentication token (ClientLogin or OAuth2) for Google services using the standard Android AccountManager
. You will then have to use it to connect to the particular API to get the actual data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With