Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Forums Advisor I
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10

Urgent: Code for submitting the form

Hi i am making the facebook login page in blackberry..The designing part is almost done bt i want to know how to provide the linking to the facebook??


As soon as the user enter the email id or password the account of the user is directly open..


Can anyone send the code for this...


Thanks in advance...

Please use plain text.
Posts: 16,215
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Urgent: Code for submitting the form

please refrain from using "Urgent", everybody who posts here has some kind of urgency.

you can use the search field to find the correct way to connect to facebook. there is the sdk and a sample project as well.
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Forums Advisor I
Posts: 501
Registered: ‎03-01-2013
My Device: BlackBerry Z10

Re: Urgent: Code for submitting the form

Here is the code.........




public class UiAppScreen extends MainScreen implements FieldChangeListener
    Bitmap bit;
    LabelField label,password,email_id,signup;
    BitmapField bitfield;
    EmailAddressEditField email;
    PasswordEditField pass;
    CheckboxField check;
    ButtonField button,sign1,button1;
    HrefField ref;
    Bitmap image=Bitmap.getBitmapResource("f.png");
    public UiAppScreen()

        label= new LabelField("facebook",Field.FIELD_HCENTER);
        email_id= new LabelField("Email:");
        email= new EmailAddressEditField("","");

        XYEdges edge=new XYEdges(10,10,20,10);
        Border border= BorderFactory.createRoundedBorder(edge, Border.STYLE_SOLID);
        password= new LabelField("Password: ");
        pass= new PasswordEditField();
        XYEdges edge1=new XYEdges(10,10,20,10);
        Border border1= BorderFactory.createRoundedBorder(edge1, Border.STYLE_SOLID);
        check= new CheckboxField("Remember me",true);
        button= new ButtonField("Login",ButtonField.FIELD_HCENTER);

        HorizontalFieldManager manager= new HorizontalFieldManager(Field.FIELD_HCENTER);
        ref=new HrefField("SignUp for facebook",0);
    public void fieldChanged(Field field, int context)
    public void login()
        String name=email.getText();
        String pass1=pass.getText();
        if(email.getTextLength()==0 && pass.getTextLength()==0)
            UiApplication.getUiApplication().pushModalScreen(new CustomScreen(image, "Email/Password field cannot "+
            "\n"+"be left blank"));
        else if(name.equalsIgnoreCase(id) && pass.getTextLength()==0)
            UiApplication.getUiApplication().pushModalScreen(new CustomScreen(image, "Password is too short"));
        else if(email.getTextLength()==0 && pass.getTextLength()>4)
            UiApplication.getUiApplication().pushModalScreen(new CustomScreen(image, "Email field cannot be left blank"));
        else if(email.getTextLength()>0 && pass.getTextLength()<4)
            UiApplication.getUiApplication().pushModalScreen(new CustomScreen(image, "Password is too short"));
        //else if(name.equalsIgnoreCase(id)  && (pass1.equalsIgnoreCase(password1) && pass.getTextLength()>4))
        else if(name!=id  || pass1!= password1)
            UiApplication.getUiApplication().pushModalScreen(new CustomScreen(image, "You have entered an incorrect Email/Password combination"));



Suppose my Fb id is vaishali@yahoo.com  and password is vaishali12

When i enter this and press the login button my facebook account would be open...


I want the code for this...

Please use plain text.