Facebook SDK for Android
5.0 (1 rating)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
25 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Facebook SDK for Android to your Wishlist.

Add to Wishlist

Facebook SDK for Android

In this course we will learn the basics of the facebook SDK for android. From setting up the SDK to building a fb app.
5.0 (1 rating)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
25 students enrolled
Created by my bringback
Published 7/2012
English
Price: $20
30-Day Money-Back Guarantee
Includes:
  • 1.5 hours on-demand video
  • 5 Articles
  • Full lifetime access
  • Access on mobile and TV
Description

Social media is a must today.  We will cover all of the basics to get your application integrated with facebook.  We will learn about making post, retrieving friends, getting pics, etc.  This course is designed for beginner Android developers.  Let's have some fun.

Students Who Viewed This Course Also Viewed
Curriculum For This Course
17 Lectures
01:51:26
+
My First Section
17 Lectures 01:22:15

This is the introduction to the course.  We will cover what you are expected to have setup for the tutorial series, and what we will cover.

Preview 02:49

In this tutorial we will set up the facebook SDK so that we have access to the library in the Eclipse IDE.  The setup of sdks are more than often the most tidious process.  We will go nice and slow to make sure it is done correctly

Preview 04:31

In this tutorial we will set up our application from facebook's side of things.  We will have to create our app on the facebook developers site.  This will give us access to our app id which we will need to use when developing our Android app. In this tutorial we will set up our android application with the Facebook developer site.  We will need to create a new app on the developer site and give it some information about our android application.

In this video I will refer to the default location of the keytool that came with the android SDK, on Windows this location should be:

C:Users.android

on Mac this location is:

/Users//.android/

Then you will execute this code:

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

Hit Enter, and type "android" as the password

Preview 06:54

In this tutorial we will finally start getting into the development phase.

This is the code for the Main Activity (StartingPlace)

public class StartingPlace extends Activity implements OnClickListener {

/** Called when the activity is first created. */

ImageView pic, button;

Facebook fb;

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

String APP_ID = getString(R.string.APP_ID);

fb = new Facebook(APP_ID);

button = (ImageView)findViewById(R.id.login);

pic = (ImageView)findViewById(R.id.picture_pic);

button.setOnClickListener(this);

updateButtonImage();

}

private void updateButtonImage() {

// TODO Auto-generated method stub

if(fb.isSessionValid()){

button.setImageResource(R.drawable.logout_button);

}else{

button.setImageResource(R.drawable.login_button);

}

}

@Override

public void onClick(View v) {

// TODO Auto-generated method stub

if(fb.isSessionValid()){

//button close our session - log out of facebook

}else{

//login to facebook

}

}

}

This is our main.xml file:

xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="fill_parent"

    android:layout_height="fill_parent"

    android:orientation="vertical" >

      <TextView

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:text="@string/hello" />

<ImageView

    android:id="@+id/login"

    android:layout_width="wrap_content"

    android:layout_height="wrap_content"

    android:src="@drawable/login_button"

    />

<ImageView

    android:id="@+id/picture_pic"

    android:visibility="invisible"

    android:layout_width="wrap_content"

    android:layout_height="wrap_content"

 

    />

LinearLayout>

4 Login Setup
10:49

In this Facebook SDK for Android tutorial we will learn how to give our application access (or authorization) to communicate with Facebook.  We will set up our button to ask for this authorization, but we will also need a method to catch the information coming back from Facebook, or more specifically, we need to create an onActivityForResult method and with in that method create the Facebook authorizeCallback method.  We will also create a way for our application to "logout" or restrict that communication with Facebook.

5 Authorize And Logout
09:02

package com.mybringback.facebookapp; import java.io.IOException; import java.net.MalformedURLException; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageView; import an…
5 Authorize And Logout-Source Code
00:57

In this Facebook SDK for Android tutorial we will setup our automatic login feature using the sharedPreferences to load up the access token and the access expires.  This will be a two part tutorial, and in this specific video we set up the code to load our access_token and access_expires variables.  in the next tutorial we will save the information to the sharedPreferences that we try and load in this tutorial.

6 Automatic Login Via Shared Preferences
05:04

In this Facebook SDK for android tutorial we will save the access token and the access expires to our sharePreferences.  We will have to get this information after the user has successfully given our application access to Facebook.

7 Saving Access Token And Expires
05:06

package com.mybringback.facebookapp; import java.io.IOException; import java.net.MalformedURLException; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.os.Bundle; import android.view…
6&7 source code
01:07

In this Facebook SDK for Android tutorial we will learn about getting facebook information from the user of our app.  We will get the person's name and profile picture quite simply.  This is achieved by making a request to Facebook asking for what we want and parsing the data for specific items, such as "name" or "id".

android, Facebook, sdk, beginner, tutorial, tutorials, id, getting id, Facebook sdk, profile, picture, user, development, programming, using

8 Getting User 's Data With JSON
06:17

In this Facebook tutorial we will be accessing the Facebook graph api so we can get some information about the user, such as parsing their profile picture into a Bitmap.  We will also talk briefly about how JSON parsing works and what it looks like on the backend so we have a little bit better understanding of what we are doing.  I will also show you a list of other information we can parse from the Graph api on Facebook, which will be very simple yet very powerful.   And remember guys, with great power comes great responsibility.

Thanks again for watching, I'm looking forward to all the great new Facebook apps that will be hitting the market soon.

9 JSON And Facebook Graph Parsing
08:09

package com.mybringback.facebookapp; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android…
9-source
01:39

In this Facebook tutorial we will make a simple wall post.  We will eventually add extra information to our post, but this tutorial will show how to make  a "wall post" to the user's wall (or "feed")  via our App.  Surprisingly this only takes one line of code, so most of the tutorial will mainly be covering the process of setting up our app with a new nice and shiny button.

10 Make A Simple Wall Post
05:39

In this Facebook SDK tutorial for Android development, we will add some swagger to our simple post we created in the last tutorial.  More specifically we will learn how to add a name, a caption, description, a link, and a picture to our post.  As always the Facebook SDK makes this pretty easy for us to do.  I hope you enjoy!

11 Swagger Posts With Facebook SDK
05:46

package com.mybringback.facebookapp; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android…
11-source StartingPlace.java
02:03

        
11-source main.xml
00:09

In this Facebook SDK tutorial for Android we will set up our Async Facebook Runner (AsyncFacebookRunner), which will create its own thread to handle facebook requests, so we won't slow down our GUI thread to a halt (meaning it will cause our application to become unresponsive and crash).  We won't get to use it in this tutorial however, because we will be organizing our code and setting up for the next tutorial.

12 Async Facebook Runner Setup
06:13
About the Instructor
my bringback
3.5 Average rating
84 Reviews
2,121 Students
10 Courses
teaching the world.

mybringback's goal is to give opportunity through technology. The primary emphasis is teaching/training individuals on fundamental and advanced technological topics which allow those individuals opportunities in their futures. We want everyone to succeed but that doesn't mean we have to teach the old fashioned boring way, we want to make our tutorials as informative as entertaining.  From software engineering or development to game programming, we want to get you on the right track!