I am developing a app and want to see offline data if Internet is not available . And this app can use multiple user like as after logout one user then another user can login and can see own data So how we can make database to accessible for among user
Use a discrimator column in your database table design to mark owner ship of every record.
Then you can impl. your data access methods so that they only query records for active user.
It's a design issue not a developing problem ;)
Related
I have an application where the user can add quotes.
I'm using Room for data storage.
I want to make it so that the user can add a quote and it would be visible to other users of the application.
Questions:
How can this be done correctly?
How to open access so that all users can see, not just you?
Thanks!
I'm designing a fitness app where a trainer would upload workouts to a database and a client could access those workouts via an app. This is easy enough to setup, however, I'm struggling to find a good way to upload workouts to a database in a way that someone who is non technical could easily do. I've been primarily playing around with FirebaseDB, but I'm open to suggestions. I'm trying to avoid having to create my own app for the trainer to input data and upload to the database as it will take extra time. Is this the best approach?
If you are thinking to expand your app in near future i suggest you to avoid FirebaseDB. Go with MS-SQL. Create User Table and add a Field may be called as 'Member_Types' (Admin|User). If the logged in user is Admin then Show him Different Page from where He can Upload Data by just inserting in Textboxes/Dropdowns/etc,etc and Clicking One Button Click. Whereas if the user logged in as a USER type show him the page which shows the data uploaded by Admin.
Using FirebaseDB is OK but If you want to deal with really complex data which this app can (In case to want to expand this app and want to add more and more features). I even Suggest if u are going with MS-SQL , Create your Own WebAPI to handle the requests.
All the Very Best for your App.
I have an Android app that uses the Firebase Realtime Database. At the moment it is a single user app, in that when a user logs in, using Firebase Auth, the data they create is kept private to them. What I need to do for the next phase of the project is to allow for the creation of teams or user-groups that have access (read and write) to the data currently created by a single user.
The database structure and rules for doing this are understood, however, the issue I have is how to create the groups.
I did find the following blog and it is very close to what I need, it does not make clear how a new user would create the pending membership entry in a specific "chat" (this is a group chat sample).
https://firebase.googleblog.com/2016/10/group-security-in-firebase-database.html
Any points on resolving this final issue would be much appreciated.
Sid
Just simply create groups like below
|--Groups
|---group1
|-----uID1 - owner
|-----uID2 - participant
|-----uID3 - participant
..............
follow this https://firebase.googleblog.com/2016/10/group-security-in-firebase-database.html link. There are example groups and rules. It will help for u to proceeds it.
Follow this https://firebase.google.com/docs/database/ios/structure-data to make good structure of data to increase performance
I am stuck at a point and can't figure it out how can I manage to send user's data which is stored in the database to another user with admin privileges after user just press a button in an app and display this info on admin's screen.
Till now I am done with the database to store user info during registration, I am new to android development and have just basic knowledge is there any better way in which i can possibly do that please let me know.
thanks
Yes, I assume you access your SQLite with a content provider/resolvers. You have to make them available to other apps, at which point they can access your data. Starting reading about it here:
https://developer.android.com/guide/topics/providers/content-providers.html
Think about why you can easily use content provider/resolver to see all gallery photos, it works the same way. It is because the photos are stored in a publicly available SQLite database and by using content provider you can access or even modify them.
I have created a chat app using firebase, I want to store the chat data in the user device and show to the user if the internet is not available.
I am torn between how to implement it I wanted to use realm but it increases app size almost by 6mb(my app size is 4mb), so I switched back to SQLite.
Now I want to know what would be the best practice to do so
I have implemented few processes still unclear how to do.
I have created a master_chat table in which I have message_id, to ,from and thread_id and secondary chat_data table where I used message_id as a reference to master_chat table and inserted messageBody, toEmail, fromEmail, time, messageType,fileSize ,downloadLink
now the question is should I follow this method so that everytime user enter the message it will be added to chat_data or directly store the arrayList and update it every time a message is sent or received.
any guidance will be great!