FACEBOOK API, ANDROID, AND YOU IT DOESN’T HAVE TO BE FRUSTRATING!

Post on 22-Dec-2015

218 views 1 download

Tags:

Transcript of FACEBOOK API, ANDROID, AND YOU IT DOESN’T HAVE TO BE FRUSTRATING!

FACEBOOK API, ANDROID, AND YOU

IT DOESN’T HAVE TO BE FRUSTRATING!

FACEBOOK QUICKSTART

https://developers.facebook.com/quickstarts/

IMPORT FACEBOOK MODULE

File -> Import Module

COULD NOT FIND PROPERTY 'ANDROID_BUILD_SDK_VERSION' ON PROJECT

':FACEBOOK'.

In top level folder, open gradle.properties and add:

• ANDROID_BUILD_TARGET_SDK_VERSION=21

• ANDROID_BUILD_TOOLS_VERSION=21.0.1

• ANDROID_BUILD_SDK_VERSION=21

• ANDROID_BUILD_MIN_SDK_VERSION=15

I copied my settings from the app level build.gradle

ADD FACEBOOK DEPENDENCY TO MAIN APP

File -> Project Structure

SHARING IN ANDROID

https://developers.facebook.com/docs/android/share#linkapi

ADDING UI HELPER CODE

Follow the directions on the websiteand add the code from step one to the activity in which you want to add a button to post to Facebook.

Shortcut to Import All

Ctrl + Alt + O

Cycles through each item and lets you addit by hitting Alt + Enter.

ADDING THE SHARE BUTTON

Create a button on your activity page and link it to a method with the code from step two!

ADDITIONAL RESOURCES

To edit the kinds of things you want to post to Facebook, edit the ShareDialogBuilder. The page for that can be found here:

https://developers.facebook.com/docs/reference/android/current/class/FacebookDialog.ShareDialogBuilder/

Instructions on how to upload images, links, places, etc, can all be found there.

Email me at KeithAFrazer@gmail.com if you have any questions!