[英]Android Facebook app integration with GAE
I'm thinking about how to solve the next problem: 我正在考虑如何解决下一个问题:
- An Android App which I want to connect to facebook, and to a Server backend(Srv).
我想要连接到Facebook和服务器后端(Srv)的Android应用程序。
- Server backend(Srv) which I want to connect to facebook.
服务器后端(Srv),我想连接到Facebook。
- The server will run a task that will Get all the Friends of the user(on fb), and the user Statuses(on Fb), and store them on it.
服务器将运行一个任务,该任务将获取用户的所有好友(在fb上)和用户状态(在Fb上),并将它们存储在其上。
Base assumptions: 基本假设:
- I use android as a Mobile device
我使用android作为移动设备
- Server is GAE
服务器是GAE
- Entity key in GAE is the user's FB-id
GAE中的实体键是用户的FB-id
- User Entity contains:
用户实体包含:
- User fb_id
用户fb_id
- User verified list(FB_ID String)=> friends of the user that have the app) // maybe use HT?
用户验证列表(FB_ID字符串)=>拥有该应用程序的用户的朋友//可能使用HT?
- User statuses list(Status text, date, url)=> whatever I can get from a Status of a user in facebook..
用户状态列表(状态文本,日期,网址)=>我可以从Facebook的用户状态获得的任何内容..
Main questions: 主要问题:
- Is the Data representation thought out?
是否考虑了数据表示? can it be better?
会更好吗?
- How do I handle a situation where two users which are connected to one another add the app at the same time- how can I avoid overlapping?
如何处理两个相互连接的用户同时添加应用程序的情况 - 如何避免重叠?
- Should the device Authenticate itself, also with the GAE server?
设备是否应该使用GAE服务器进行身份验证?
- How to Authenticate GAE with FB
如何用FB验证GAE
Algorithm: 算法:
Android side: Android方面:
User login and get access token from FB
Posting to my server(Srv) FB Token & myUserFBId // Should I use REST protocol or HTTP
POST? POST?
Server side: 服务器端:
A Servlet handles the POST
{
Query FB ->for the user's 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's statuses(into statuses = arrayList<StatusItem))
add new FBEntity(myUserFBId, verifiedFriendsList, statuses) to DB }
Thanks 谢谢
I have not done anything like this but I think you will need to 我没有做过这样的事情,但我认为你需要这样做
Oauth on FB is what you are searching for.. FB上的Oauth就是你要找的......
I'll give you my 4 cents: 我给你4美分:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.