Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have a set of users which mark their status as online. I want to connect two random users in Firebase and my database is a Firestore Database. How can I achieve this?
You have not posted any code or idea of your own, hence I can't comment or tell you very specific things to your idea/code. But I'd try to be broad enough for this.
Using a special node like status and setting it to online and offline will be a good idea.
You can use orderByChild() to order all the users with status node set to online and get the uid of any of those users.
To make the process random you could make a call to users, take the ids given back to you, and pick one at random with a basic random number.
If after making a call to users you have 10 user ids in an array you would want to get a random number between 0-9 and then make a call to firebase with the userId.
I don't believe Firebase has any built in code for this. So this would be the best thing you can do to achieve this feature in your app.
You may also refer this question.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want to make a chat app in which all features of chat like messaging, sharing video, image, and emoji, etc. I found a lot of tutorials for that but no one says how to chat with only those you know or have in contacts to prevent unwanted disturbance to the users from others. How to make such an app with flutter?
One way is by reading all the contacts number form the phone and then check if that phone number is registered
One feature/method I can think of is using referral/invite. The person can only join the app only if he is invited and the invitation is approved by the admin. This way you can have control over who accesses your app.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I was wondering what is the best way to send a vote say for example the initial value of the vote is 0 and someone sends a +1 (vote+=1) after a certain time like 20min that vote will be undone (vote-=1). Is there some functionality in firebase to do this? Because I want the undoing to work even though the user isn't using the android application. I thought about keeping a device always connected to the database and watch the changes but this doesn't look very stable. Is it possible to use a server? If firebase isn't the best option what should I look up online?
cloud functions on read/right/updates to firestore is down your alley. The biggest problem i see is that you would use setTimeout for 20 minutes and you would get billed alot. Another forum with a similar problem recommends to run a cloud function every once in a while to purge old votes. I recommend on upvote push the date into an array and use length as the total number of votes, and every 10 minutes or whatever have a function run that looks if the dates are older than 20 minutes and deletes accordingly.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Hey guys I'm working on an Android App with Android Studio and I need a database like mlab(mongoDB). But Android doesn't support mlab. I can't just use SQLite because my data has to be saved also when my application is not running.
For example if my user signs in, their profile photo and other information should be saved in the database and I also want to code something like a friend request which also should be saved in the database.
I googled so much but I didn't find a good solution.
I hope someone can help me.
You asking about two separate things. mLab is a Database as a Service which uses MongoDB, while SqLite is just a database.
You can save data while your application is not being used with either option, simply look into background Services and other parts of the Android API that allow background tasks.
If you want to save data to a database that is not on the device, you'll need to look into the documentation of the service to determine the best way to interact with your database. In the case of mLab, they allow both custom drivers and a REST API for interacting with your database.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to create an application, when I enter any mobile number it should give me current location of that number.
Guys please help me if it is possible then tell me how it is possible ?
you cant get the location from cell number !!!!!
though there are some applications in some countries which they do something like this but the mechanism is different.
how they work is, user registers in their app and they use Cell Number as username for registering users. then this way they can tell you the location of other users by phone number. (you can just see users' location who registered in app)
since there isnt any way to get the cell number programatically so such system you want cant exist unless the user gives you the number and you verify it some how (sending code sms and etc) and thats what the apps i mentioned are doing.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to create an application that will show me on a map to all users who have installed my app within x distance.
It wondered if I need to save the coordinates of each user periodically in a database and read the position or is there another option
Tracking the user's location in a database will likely be your easiest option. It will also scale well. If you are only tracking a couple users, you could use another simpler data storage mechanism like an XML file, a text file, or even some sort of Application Level Variable.
I'm sure that you have done some research on how best to track your users, but this is a pretty good starting point, if you don't have one already. They are storing each location in a local database on the phone, so I'm sure that you could very easily modify it to send that same location to a web service or something.