I am thinking about how to solve the following problem:
- The Android application that I want to connect to facebook, and to the server server (Srv).
- The server server (Srv) that I want to connect to facebook.
- The server will perform a task that will receive all the user's friends (on fb) and user statuses (on Fb) and store them on it.
Basic assumptions:
- I use android as a mobile device.
- GAE Server
- GAE's Entity Key is the FB User ID
- The custom item contains:
- User fb_id
- User Confirmed List (FB_ID String) => friends of the user who has the application) // maybe use HT?
- List of user statuses (status text, date, URL) => everything I can get from user status on facebook ..
Main questions:
- Is data presentation thought out? could be better?
- How do I handle a situation where two users who are connected to each other add an application at the same time - how can I avoid overlapping?
- If the device authenticates itself, also with the GAE server?
- How to Authenticate GAE Using FB
Algorithm:
Android side:
User login and get access token from FB Posting to my server(Srv) FB Token & myUserFBId // Should I use REST protocol or HTTP
POST?
Server side:
A Servlet handles the POST { Query FB ->for the user friends ids(into friendList = arrayList<FBItem)) foreach FBItem item in friendList { //check which FB-ids are in my DB friendEntity = getKey(item.fb_id) if(friendEntity != null) { // friend exists verifiedFriendsList.add(item.fb_id) //verifiedFriendsList is ArrayList<String> friendEntity.getVerifiedFriendList().add(myUserFBId) } } Query FB ->for the user statuses(into statuses = arrayList<StatusItem)) add new FBEntity(myUserFBId, verifiedFriendsList, statuses) to DB }
thanks
source share