I'm currently working on a school project that aims at creating a P2P chat client for users on the same network. For now, it will only be used by users on the same LAN network. But hopefully,I will to extend to work for users on the same public Wifi(if that's possible, is it?).What is confusing me at the moment is how to store users information like username, password, account picture, message history...etc. I was thinking of creating a database and storing them there but that seems inconvenient and since the app won't connect to some sort of server it might affect portability. So what is a convenient way of storing user info? Thanks in advance.
You will want to store the users data locally. And as people come online they broadcast their information. If the local client needs to update your friends profile information it can do so then.
As for storing the information locally here are a two options:
- text file although not generally recommended for normal production deployment but does work for smaller proof-of-concept type projects such as yours.
- HSQLDB is a what I often turn to as a quick alternative. No install needed. surprisingly powerful.