Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Regular Contributor
kaushik_saha
Posts: 55
Registered: ‎09-01-2010

Blackberry FB share problem: low memory

I am using Blackberry Facebook SDK (FacebookBlackBerrySDK-v0.8.25.jar) for facebook integration for my app. I am using the following code.

 

             ApplicationSettings as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
              Facebook fb = Facebook.getInstance(as);
              
              try{

                 FBUserDetails fbUserDetails = FBUserDetails.getInstance();
                 
                 String prevUserDatails = fbUserDetails.getFBData();           
                 
                 User user = fb.getCurrentUser();
                 
                 if(prevUserDatails != null && !prevUserDatails.equals("") && user.getEmail().equals(prevUserDatails)){

                    if(Dialog.ask(Dialog.D_YES_NO,"Do you want to post using FB account " + prevUserDatails + "?",Dialog.YES)==Dialog.NO){
                        fb.logout(true);
                        user = fb.getCurrentUser();
                    }    
                 }
                 
                 
                 if(user!= null){

                    fbUserDetails.persist(user.getEmail());
                    
                    String result = user.publishStatus(decodedText);
                    if ((result != null) && !result.trim().equals("")) {
                        Dialog.alert("Successfully posted to Facebook.");                   
                    } else {
                        Dialog.alert("Share Failed.");
                    }

                 }else
                    Dialog.alert("user is equal to null.");
                    
              }catch(FacebookException fe){
                  fe.printStackTrace();
              }

 

When I am testing the app in Blackberry Strom 9300 (OS version 6.0.0.526), it is running properly first time. But when I am going to share any text again,  system is giving "the memmory available on your device is low. Close some of the items below." and I forced to close the application. Can anyone tell me what is the problem in the above code?

 

 

Please use plain text.
Regular Contributor
kaushik_saha
Posts: 55
Registered: ‎09-01-2010

Re: Blackberry FB share problem: low memory

I have identifies that  I am going to share the same text again in a short interval(it is obvious that the posting will fail), system is giving "the memmory available on your device is low. Close some of the items below." and I forced to close the application.

Please use plain text.
Developer
Kiran_Snist
Posts: 174
Registered: ‎01-25-2011

Re: Blackberry FB share problem: low memory

You wont face the issue in the device..  Try deploying n check!!

Please use plain text.
Regular Contributor
kaushik_saha
Posts: 55
Registered: ‎09-01-2010

Re: Blackberry FB share problem: low memory

I am testing in teh device only, I have tried more than one device(both in OS 6 and OS 7) and faced the prob.

Please use plain text.