Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Android Facebook SDK - Get nearby places

  • 08-12-2015 07:25PM
    #1
    Registered Users, Registered Users 2, Paid Member Posts: 8,000 ✭✭✭
    Something about sandwiches


    Hi guys,

    I wonder if someone can help me. Sorry if this is a bit long winded for a (hopefully) quick fix.

    I've an app that uses Google Maps. The places on the map get populated from data retrieved from my own server, which has coords, name, address, phone etc.
    A feature of the app is to allow the user to add places, and give them a description, list facilities etc.
    On this "Add Places" screen, the user inputs the above details as much as possible. However, nobody knows the GPS coordinates off by heart, so I'm hoping to get them programatically. I'm familiar with the Facebook apps check-in feature, which displays a list of places nearby. I'm hoping to use similar functionality so the user can click a "Search" button and display a screen similar to the check-in screen. Once they select a nearby place, it'll then populate the text fields in the app and allow them to submit that place, along with extra info relevant to the app.

    I've used the Google Places API already and its good. However, there's a previous screen in the app that allows Facebook and Google login. If they choose Google login, then I'll use the Google Places API. However, if they use Facebook login, then I'm hoping to use the FB Graph API in a similar fashion.

    The Google Places stuff is actually done already, so now I'm onto the Facebook part. From my research, I've to use the Graph API. Specifically this:
    https://developers.facebook.com/docs/graph-api/reference/location/

    So on that link, the sample Android code is as follows:
    /* make the API call */
    new GraphRequest(
        AccessToken.getCurrentAccessToken(),
        "...?fields={fieldname_of_type_Location}",
        null,
        HttpMethod.GET,
        new GraphRequest.Callback() {
            public void onCompleted(GraphResponse response) {
                /* handle the result */
            }
        }
    ).executeAsync();
    

    That's about as far as I've gotten, and hit a dead end. Mainly because I don't know what fields to add in.
    Does anyone know where I can get a good sample for what I'm trying to do?

    Thanks.


Advertisement