Reputation: 843
I'm currently making an app for myself to collect battery temperature data, and storing it in a Firebase database. However, if I want to run the app on a different device, they'd be writing to the same area at the same time, and hence it'd be hard to distinguish which device is which in the database. Is it possible to add some sort of unique device ID so that I can distinguish data collected from multiple devices at the same time, being stored onto the same Firebase database?
Upvotes: 0
Views: 480
Reputation: 317760
You can generate a random UUID which is essentially guaranteed to be unique, then remember/persist that in your app on that device. You're not saying what platform you're coding for, so it will be up to you to find a library to generate one. This should be pretty easy. With Java, there's a UUID class that can do this for you.
Upvotes: 2