0

I am developing an application in blackberry which requires the user's login through facebook. Fot that I search at Google and every body suggesting that use the sdk provide by sourceforge.net at https://sourceforge.net/projects/facebook-bb-sdk/. I downloaded the sdk and follow the pdf instrunction as follow.

1.Created a new project and also created a lib folder and copied the both .jar file 2.Added the jar and exported it to projected by going to property option for the project. 3.Next in MyScreen.java I write down the following as mentioned in PDF included in SDK

public final class MyScreen extends MainScreen
{
public MyScreen()
{        
    // Set the displayed title of the screen       
    setTitle("Facebook Login");
    String NEXT_URL = "http://www.facebook.com/connect/login_success.html";
    String APPLICATION_ID = // removed - application specific and should not be shared
    String APPLICATION_SECRET = // removed - application specific and should not be shared
    String[] PERMISSIONS = Facebook.Permissions.USER_DATA_PERMISSIONS;
    ApplicationSettings as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
    Facebook fb = Facebook.getInstance(as);
}}

After that I run the program and gives the following error enter image description here

I read at several forum and sites that it is quite easy to integrate Facebook login in Blackberry but I can not do that.Please suggest where I am missing .

Regards!

Peter Strange
  • 2,640
  • 11
  • 11
Dinesh Chandra
  • 329
  • 1
  • 2
  • 27
  • Possible duplicate of http://stackoverflow.com/questions/11676646/blackberry-facebook-sdk-throwing-exception-noclassdeffounderror?rq=1 and http://stackoverflow.com/questions/8882973/blackberry-facebook-noclassdeffounderror?rq=1 – Peter Strange Oct 28 '13 at 14:47
  • check this code http://rincethomas.blogspot.in/search/label/Facebook – Rince Thomas Oct 29 '13 at 05:07
  • @Signare - The code above and the code you linked look the same? – Peter Strange Oct 29 '13 at 10:10
  • @Peter Strange :I tried the link shown above but failed to get the login screen of Facebook – Dinesh Chandra Oct 29 '13 at 10:21
  • @Signare: The code just show the screen with a post button but when I clicked at this button Its gives error :NoclassfoundError – Dinesh Chandra Oct 29 '13 at 10:25
  • 1
    @DineshChandra - you will find in both the duplicates I have linked to, someone has suggested you include the source in your project rather than including the jars. That is my recommendation too. Try it. – Peter Strange Oct 29 '13 at 23:42
  • @Peter: I do the same but the same error ClassDoesnotFound comes. – Dinesh Chandra Nov 02 '13 at 06:26
  • @DineshChandra, I agree with Peter's suggestion, to try including the full set of Java **source** code, instead of using a .jar at all. If you're still getting the `NoClassDefFoundError`, I would try finding where that exception is thrown. To find a stack trace, try [catching all Throwables in your main program](http://stackoverflow.com/a/2632620/119114). Also, [read this](http://stackoverflow.com/a/5268049/119114). – Nate Nov 06 '13 at 09:53

1 Answers1

1

open the facebook in browserfield.and when you put correct username and password and then check the browser field content and distinguish it for failure and success.and then i background you can decide whether user has put the correct username and password if yes then do wt you want.

User10001
  • 1,295
  • 2
  • 18
  • 30
  • :Can you explain in some coding methdology to do the same – Dinesh Chandra Oct 31 '13 at 05:01
  • This is exactly what the Facebook SDK does. In other words, you already have code that does this. You are just having problems using it. The problem you are having is packaging the SDK in your application, so why don't you follow the suggestion given previously and include the source in your application? – Peter Strange Oct 31 '13 at 09:54
  • 1
    BrowserField browserField = new BrowserField(); browserField.requestContent("http://facebook.com"); when user try to login after filling the username and password then with the help of browser field listener you can check the content the url .if contain success key then it means user has fill the correct user name and password and then do wt you want. – User10001 Oct 31 '13 at 13:53