hidroh / materialistic

A material-design Hacker News Android reader
https://play.google.com/store/apps/details?id=io.github.hidroh.materialistic
Apache License 2.0
2.3k stars 508 forks source link

Sync user data across devices/with HN #538

Open materialistic-bot opened 8 years ago

materialistic-bot commented 8 years ago

I use Materialistic on tablet and a phone and would love for my saved articles and what I have read to be in step on both devices. Unfortunately I don't code in Java so I can't contribute code. Device: Huawei Nexus 6P, SDK: 23, app version: 54

hidroh commented 8 years ago

Now that HN officially supports 'favorite', we can use that as a remote db to sync saved stories: https://news.ycombinator.com/item?id=12073675

PhilipWith1L commented 7 years ago

What about sync read articles, saved items and votes across devices with same HN login?

hidroh commented 7 years ago

Any kind of sync needs some sort of backend support. Since I don't have one I was looking at some makeshift solution, e.g. Google Drive, but it creates more problems than solving. Still parking this for now.

PhilipWith1L commented 7 years ago

Understood. Thanks for the quick reply! That makes sense. It's not an essential feature, just makes it easier to use the app on 2 different Android and same credentials. Reddit is fun seems to do this sometimes for my reddit account but not always.

victorhooi commented 7 years ago

I don't know if there's any way to avoid having a backend, per-se. However, it needn't be that hard.

Have you considered using the AppData feature in Google Drive?

https://developers.google.com/drive/v3/web/appdata

It's basically a hidden folder in a user's Google Drive - you can use it for storing application-specific data. A bunch of other applications already use it (e.g. WhatsApps can use it for chat logs and video/audio backups, Arq Backup uses it to store your backups etc.)

Another option is Firebase Realtime Database:

https://firebase.google.com/docs/database/

which is basically a JSON-based document store - reasonably easy to integrate using the Firebase API, and it handles offline/realtime fairly well.

I'm pretty sure you know what you're doing =), but just in case feel free to ping me if you want to ask me anything (I'm part of our support engineering org for Google Drive).

hidroh commented 7 years ago

Cool. I did explore both options you mention. Google Drive makes more sense to me, as it's decentralized, it's also more private. The integration would require user to expose their Google account (which the app never asked), which may spook some users, but I guess those that want the integration would be willing to do so anyway.

A downside of this is the app will need to integrate with Google Play Services, which is not fully OSS. And the solution wouldn't work where it's not available, e.g. China.

PhilipWith1L commented 7 years ago

I know little about firebase, but also understand your concern as a developer about users suddenly seeing the ability for their G account to be exposed. I wish I knew more about Android apps to further contribute to this feature. It's unfortunate there are road blocks or indirect solutions to what would make these sort of apps more than an attractive container. I continue to use the app every day, btw!

victorhooi commented 7 years ago

@hidroh Is the concern around user's granting permission for Google Drive to Materialistic?

That's a fair point. However, I think you simply need to make it clear when you request permissions what it's for.

Also - in modern Android versions, you don't need to request the permission on install - you can request it when the user sets up sync, for example. That means only users that explicitly try to enable sync will be prompted for that permission.

Would that be suitable?

hidroh commented 7 years ago

Of course the app will only ask for permission when user explicitly chooses to enable sync, not immediately when installed.

The concern is that you suddenly have to link your personal account (e.g. Google/Dropbox) in order for a news reader to sync your data, which sounds strange to me as a user. As the app developer I know I won't do something funny with your personal account (beside the fact that I can't!), but as an app user I can't help but raise my eyebrows 😅

hidroh commented 7 years ago

Having said ☝️ I'm still considering integration with Google Drive AppData, just don't have time to start yet.

tamsky commented 5 years ago

What about replicating the WhatsApp backup model:

diimdeep commented 5 years ago

Why not replace Saved with Favorites and rely on HN favorites per user feature.

chreniuc commented 5 years ago

Why not replace Saved with Favorites and rely on HN favorites per user feature.

I'm also thinking about this.

Or it will be wonderful if we had another button favorite, to save a story(the favorite feature from HN), this way if i'm using HN from my phone and from my desktop I can access them. Right now I don't know how to sync the desktop and the phone and it sucks.

jac08h commented 4 years ago

Is there still not a way to sync saved stories between desktop and mobile?