How to create friends and status updates using App engine - java

Hi guys i posted a question earlier related to this topic but i believe the question was to broad. So this time i will try to be more specific.
I would like to use Google's AppEngine to create a social networking environment for my app.
For example, it will allow a user to log in, see friends status, and their will be an activity where the user can see friends list and click a friends to load the users profile.
So basically i would like to know what should the implementation for this look like?
Such as using App Engine, Amazon S3 services, etc
So here are my main two questions:
how would i load a users friends list when they click the "Friends" activity?
how would i load the users current friends latest statuses?

Create an API for your site on App Engine.
You then consume that API in your Android app.
For logins, ask users their email/username or password. You send that to your API and have it return a token associated to the user. Use that token to query the API for the user's friends status, list, etc.
Save the token in the SharedPreferences of your Android app. You check the SharedPreferences to know if the user is logged in or not.

Related

Rolling a user authentication system for Android app

I'm a bit confused on how I can implement a user system into my application.
For a small overview, the mobile application needs to allow users to login or register, follow other users, and favorite/like items.
I've checkout out the documentation on Google Cloud Platform for implementing User Auth:
https://developers.google.com/identity/protocols/OpenIDConnect
https://cloud.google.com/appengine/docs/standard/java/users/
https://cloud.google.com/appengine/docs/standard/java/oauth/
I've used Parse in the past, and would expect the Firebase User Auth system to offer a similar experience, however due to Firebase conflicts with App Engine, that route is a no-go.
I understand there is also the User API, which can be used for things like restricting Cloud Endpoints calls to logged in users.
How can I roll a user auth system for my application? The best solution that comes to mind would be to just store user emails and passwords in Google Cloud Datastore, and check if the combination exists when a user logs in. However, I'm fairly unfamiliar with creating user systems and this seems like it would come with some sort of security issues.
you can use Firebase Authentication with Google App Engine. Your information that you have to use manual scaling instance is not correct. This was a bug and were fixed. Please see the following post for more informations
Verify Firebase Token at Google App Engine

How to connect android users to my database / web application?

I have wrote a simple web application with few tables. It has it's administration area where you can manage it's table. Basic CRUD operations.
However, I need to develop an Android application which will retrieve information from this web application trough API. So I am going to write a simple API methods for fetching data. Also there will be sometimes when Android user will save some of its data to database.
Android application needs to be able to list items stored in database and bookmark some of those items over HTTP.
To me problem is how to implement SingIn / SignOut operations using Android's Google account. For example, application GMail is always signed in (at least on my device) and I want my application to be always signed in.
Then, how can I manage what items user bookmarked? Should I create a table android_bookmarked_items (android_user_id, item_id)? But then what should be android_user_id? Do I need to use OAuth?
I am doing this kind off sign in for the first time and I am really confused how to connect this web application with android user and manage bookmarked items per user...
You can make use of Android AccountManager. Check out How to get the Android device's primary e-mail address
I think i have found solution by using Google Sign-In for Android. I get idToken for currently login user before each POST request and verify it on server side. Also from the token I get property sub which is user id and store this in my database...
Auth with a backend server
However, I am pretty new to this stuff, tokens and authentication using google, I would like for someone more experinced to confirm that my solution is fine and secure...

Browsing for other users in app (android)

I've created a facebook login profile view for a user in my application. I'd like a way for the users who login via facebook, google or are just registered in general, can search for each other, and view each others profiles. How do i do that? I suppose i would need some sort of database with all registered users, although i dont know how to make that. Perhaps a bit like the way facebook let people search for each other - how do they achieve that?
Yes you'll need to hava DB on you own server to store the list on all registered user. Then when an user opens your app, the app will make a request to that DB for the list of all users. Then you can use those usernames to show their profiles on Facebook, Google+ or other services they used to register.
For the DB you can use any SQL DB like mySQL. To access the DB you'll need to make some API for example using SOAP. For the server, any WWW hosting will do, MySQL and PHP is all you need.

"SIMPLE" Java Facebook Login

I'm working on a tiny Java Desktop project. Basically, I need to connect my users through their Facebook accounts, and once validated, I'd like to retrieve some of their public information (name, email, birthday)...
I've been doing heavy research regarding this, but the more i read, the more complicated it gets. And there were many points were I got so confused that I just wanted to slam my head through my screen :D
Anyway...
1- I understand that I'd need a Facebook SDK (I'm using restFB)
2- Create an App on Facebook
3- Request permissions
4- Get User Access Token
5- Retrieve required data (name, email, birthday)
One thing I dont understand, do I have to embed some form of Webbrowser in my Java app so that I can continue with the Facebook login process or can it be done through RestFB? and Unfortunately, RestFB doesnt explain nearly enough how to login a user, and when i found something close enough the user was hardcoded, but what if I want to register a new user everytime?
This is all i"ve got for now regarding the Login process:
AccessToken accessToken = new DefaultFacebookClient().obtainAppAccessToken("471150563090234", "97514014f41b3c1e7f5b697ab5708dec");
String token=accessToken.getAccessToken();
DefaultFacebookClient facebookClient = new DefaultFacebookClient(token);
ANY kind of help would be greatly appreciated!! Also, Where does OAuth fit in all this, i feel that this is the part I'm missing :)
You have two possibilities:
Use an embedded webbrowser. Depending on your app, they framework you use and so on this is no fun and a bit complicated to explain in some sentences. It is very specific and highly depends on how you app is working.
The easier way is to use a device access token. You have you user to open a provided url in his/hers browser and enter a code you show in your app. Your application has to poll Facebook as long as the user completed the authentication process or until a timeout occurs.
Have a look at the restfb documentation here: http://restfb.com/documentation/#access-token-device
and the device login explanation at Facebook here:
https://developers.facebook.com/docs/facebook-login/for-devices

Android Studio Login Activity

I'm working at my first app and I want to login to a php website, but want to use the Login Activity of Android Studio. My design looks perfect but I don't know how I can access my Database. So how can I compare the email entered from the user and the email saved in the databse?...same for the password.
Thanks a lot for helping me
Your app doesn't know your webpage's database. You need to do add some backend API to your website (via REST, SOAP, HTTP or whatever) so that the app can query for users with given name/password and make that api call from the app. I strongly recommend using encryption.

Categories

Resources