Android Tutorial [TUTORIAL] Post to Facebook Wall via B4A app.

The attached project shows how to use the device's camera to snap a picture and upload it to your Facebook wall.

This sample is based on the code written by the one and only vb1992 found in THIS thread.

- Requirements:

1- Facebook account.
2- Facebook app.
3- Internet connection.

- How to create a Facebook app

In order to use this sample you MUST create a Facebook App first, to do that, go to: https://developers.facebook.com/apps/ (the system will prompt you to login if you are not, the user name and password required is your Facebook user name and password).

1- After you login you will see the Create new app window, then, enter a name and click on Continue (you can leave the rest of the fields blank, if you don't have a website then check the "free webhosting by Heroku" and follow the instructions).

2- Enter the Security check.

3- Fill the information on the App Details window, you need to enter:

  • Contact Email
  • Category
  • Select WEBSITE and enter your website (or the one provided by Heroku in case you don't have your own.)
  • Save changes

NOTES:

Take note of the App ID and App Secret you need those values to be added to the B4A project as well as the Site URL.

The first time you run the app you'll be prompted to login to Facebook, there's no log off option, the workaround is to CLEAR DATA & CLEAR CACHE, I need to investigate how to do that by code.

There are a few notes in the B4A project, just follow those simple instructions and you are done.

Enjoy!!
 

Attachments

  • FacebookCamSample.zip
    9.8 KB · Views: 2,386

JohnD

Active Member
Licensed User
Longtime User
Facebook changes the API frequently and without warning, I suggest you use one of the FB libraries available.
Thanks for the direct response to this one NJDude. I'm a Facebook junkie and will surely be integrating Facebook into my next app. Hope all of your current projects are going well. JohnD. :)
 

KY Leng

Active Member
Licensed User
Longtime User
No error display but no post on facebook too ... I think it may come from RedirectUri because I could not put it in the setting of my app on facebook so I left it blank.
 
Top