Integrate Android Facebook apps with GAE

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

+6
source share
2 answers

I did nothing, but I think you need to

  • Ask the user to authenticate your application to use FB- Read about OAuth Api Facebook
  • Once your application has been verified with sufficient permissions, you will be able to obtain user data in accordance with your requirements.
  • Once you receive the data, you can process it.

Oauth on FB is what you are looking for ..

+4
source

I will give you my 4 cents:

  • The questions that should lead you to develop a DS are: (A) Server, how is the data stored? to file? to the database? (B) How much of this data is required to perform the calculations and how to plan access to it (for example, to perform O (n), I would not use a HashTable) (C) persistent / de-persistent work? with ORM? user queries?
  • About concurrency, you will need to explain what bothers you. People constantly subscribe to SO at the same time. 3/4. Not an Android developer, can not help.
+1
source

All Articles