次の問題を解決する方法を考えています。
- Facebookとサーバーバックエンド(Srv)に接続したいAndroidアプリ。
- Facebookに接続したいサーバーバックエンド(Srv)。
- サーバーは、ユーザーのすべての友達 (fb 上) とユーザーのステータス (Fb 上) を取得し、それらを保存するタスクを実行します。
基本的な仮定:
- Android をモバイル デバイスとして使用しています
- サーバーはGAEです
- GAE のエンティティ キーはユーザーの FB-id です
- ユーザー エンティティには次が含まれます。
- ユーザー fb_id
- ユーザー検証済みリスト(FB_ID String)=> アプリを持っているユーザーの友人) // HT を使用する可能性がありますか?
- ユーザーステータスリスト(ステータステキスト、日付、URL)=> Facebookのユーザーのステータスから取得できるもの..
主な質問:
- データ表現は考え抜かれていますか? それはより良いことができますか?
- 互いに接続している 2 人のユーザーが同時にアプリを追加する状況をどのように処理すればよいですか?どうすれば重複を避けることができますか?
- GAE サーバーを使用して、デバイス自体を認証する必要がありますか?
- FB で GAE を認証する方法
アルゴリズム:
アンドロイド側:
User login and get access token from FB
Posting to my server(Srv) FB Token & myUserFBId // Should I use REST protocol or HTTP
役職?
サーバ側:
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 }
ありがとう