Hi I'm new to android programming and here's what I want to do / my questions
I am starting with a simple app, letting users register and collect some info such as
username, password, age, etc
then later allow them to login and query for other users, ie, age <=30,
I google searched a bit and think google cloud datastore is what I want to go with, I want to pass data from the app to the database to establish a user database, which will be used later for queries.
My question is how do I do this, can someone point me to a link or tutorial? I read the google documents and they are not too helpful
Thanks
Related
Hi I am a rather new developer to Xamarin Android.
Before this I am able to authenticate users with the SignInWithEmailAndPassword from Firebase. It is for my testing purpose.
But now, I already have details and values of users signed up through website(and saved on realtime database), so I cannot use the SignInWithEmailAndPassword function anymore since now I have to authenticate users with the values on database.
Can I authenticate users with the typical PutString("email", "value entered by users") and getStringExtra function? My guts say I can but if I start then I would change a lot of codes now. So I need some confirmation or any reading materials.
p/s I have searched everything and all tutorials or answers are directing me to save the details when user first sign up on mobile. The case is not like this. Web sign ups do not use the same database as phone. I retrieved the values in JSON file and import them to firebase. The web uses Hostinger's database.
If you have an existing database of user credentials and want to sign them in to Firebase Authentication, you'll want to look at creating a custom token.
In this process you:
Sign the users in with your own credentials.
Pass the fact those verified credentials and other user info to a trusted environment.
Use the Admin SDK (as shown in the link above) to mint a custom token for the user.
Pass that token back the client-side code.
Use the custom token to sign in to Firebase.
As you can see this is quite a bit more involved than your current approach with SignInWithEmailAndPassword, because the Firebase SDK actually takes care of most of these steps in that case.
I was wondering which one would be better, Authentication with Firebase or a database in Firebase. This is the general idea of my project, and I was wondering which one would be best:
I am creating an companion to a game, and this app can be registered to users, or a Clan which is a group of users. I need to group the users into their clans if they choose to do so, so I am guessing the database is better. But, Firebase Authentication seems like an easier process. Is a database better? Also, users will register online with my website, so it can be easier without a register process in-app.
Thank you for reading my post and hopefully for answering it!
-Braythor
You can have users Register/Login using the Firebase Authentication and when they do that you add their username to the database to be able to the group them by clan under different nodes in firebase.
Not sure if this is what you were asking, but you're right that using Firebase Authentication to have users register is easy, so this implementation would allow you to do that while also grouping them by clan in the database.
I want to create a chat app for Android but instead of registering with an email or phone number I would like users to sign in with their account on an already existing website account. For example, If I'm creating a chat app specifically for movies, I would make the authentication through their IMDB account. Is there any way to do this? Usually I work with firebase.
You can do this but using firebase is meaningless in this scenario. Firebase is a "BaaS" (back-end as a service) which you generally use to store data or send notifications. In your example, you want to connect your users with their IMDB account so you already know the back-end you should use. To connect the users with a system you should read their API docs and send POST/GET requests which generally contains a username, a password, and an API key. After that depending on the service, you should get the JSON/XML response from the server, and let the user continue if the response code is 200.(SUCCESS). To make the call take a look at
https://developer.android.com/reference/java/net/HttpURLConnection
To test this with an API, take a look at themoviedb which is free to use.
https://www.themoviedb.org/documentation/api
Your question is fairly broad which makes it difficult to answer in any detail.
In any case, you want to authenticate your users so you know who-is-who. This means your users need to provide some form of credentials. You don't want users to create a new account, instead they should be able to use one of their existing accounts (e.g. IMDb) to authenticate themselves.
How to authenticate?
As Sam says, to allow a user to sign in with IMDb you need to be able to talk to IMDb's servers first. This means you need some form of API, that allows you to send HTTP requests to IMDb's servers.
As far as I can see, IMDb doesn't offer much in terms of a public API or any way to authenticate a user with their IMDb account.
You may want to look into Firebase Authentication instead. It already supports a number of services (Google, Facebook, Twitter, GitHub) and takes care of all the low level details. You want to build a chat app, not an identity service after all.
Do I still need my own database and user accounts?
Yes
Once a user is authenticated you may want to store some data about them (name, email, ...). The service used to authenticate a user may or may not provide you with this information. Users also may not want to share all of those details with your app. On top of that you probably want to be able to link a user's chat history with their account. This means you need to store this information somewhere.
What else?
All of this just takes care of authentication. You still need to provide the necessary infrastructure for users to actually be able to talk to one another. This means you need your own server that the app can use to route messages to other users. You could probably use some other Firebase services for this (e.g. Cloud Functions).
I have recently been learning Firebase for my salon app. I successfully use Firebase for authentication (Facebook, Google, Email) and now I am planning to continue to use Firebase Realtime DB for my app.
My app will cover member registration, reservation, services list, employees and transactions (treatment). Unfortunately, I am stuck and confuse at creating my data structure. I have no experience in NoSQL and I also could not find any complete db/data structure sample of one app (especially one that include transaction like e-commerce).
Please help give me any samples if you have or know so I can have better picture for my app. Thank you.
I'm working on an android app and I want to allow users to register using Facebook, Gmail etc.
My question is not how to do that, because there are many posts regarding that including tutorials written by Facebook and Google themselves.
I want to achieve something similar to the Stackoverflow log in - the users are allowed to login using Gmail for instance, while the site (or app) also keeps its own data about each user (namely, my profile).
I'm not quite sure how to achieve something like that in Android, since the Facebook and Google SDK's allow my app to access the user's facebook name, email (and any public information), but I don't think they allow me to add more data about this user my app needs for its own purposes.
What I was thinking of doing is to manage a DB of my own where I could store the additional data (for instance, using Parse.com), and use a common field to all services as a key (was thinking about email, since Facebook, Gmail & twitter all use that - do you recommend this?)
Are there other (better) ways to achieve what I want? perhaps Google offers something I don't know?
How safe is this (though I should mention that for now the app shouldn't gather any personal information).
As always, any help would be appreciated.
Thank you.
Store the user's email in your own database along with its session key (don't forget to update it after each login). When the user makes a request to the server after he logs in check the email and session key he provides and use them to get his row in the database, where you can store more information about them.
Regarding Parse.com: They have their own implementation of Facebook login.