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.

inside custom component

Java Development

Reply
Highlighted
Developer
Posts: 81
Registered: ‎12-04-2012
My Device: BlackBerry@8520 smartphone(Edge,Wi-fi)
My Carrier: vodafone

how to save chat history using Java code

I have a code which enables the user to manually check the Save chat History-->device/memory card.

What i need now is that on running this app the code is able to fetch BBm setiings and change Save chat History---> to device automattically.

 

ApplicationManager.getApplicationManager()  .launchApplication("net_rim_bb_qm_peer");

Or

net_rim_bb_qm_peer is the url I suppose

What would the url for save chat history be

Manual Code:

package mypackage;
import net.rim.device.api.system.Application;
import net.rim.device.api.system.ApplicationManager;
import net.rim.device.api.system.ApplicationManagerException;
import net.rim.device.api.ui.MenuItem;
import net.rim.device.api.ui.container.MainScreen;

/**
 * A class extending the MainScreen class, which provides default standard
 * behavior for BlackBerry GUI applications.
 */
public final class MyScreen extends MainScreen {
    /**
     * Creates a new MyScreen object
     */
    public MyScreen() {
        // Set the displayed title of the screen
        setTitle("MyTitle");
        addApplicationMenu(this);

    }

    /**
     * Adds a menu which allows the user to perform various message store
     * actions.
     *
     * @param mainScreen
     *            The screen to add the menu to
     */
    void addApplicationMenu(MainScreen mainScreen) 
    {
        MenuItem appendUnreadMenuItem = new MenuItem("Open Messenger",1, 1)
        {
            public void run() 
            {
                try {
                    ApplicationManager.getApplicationManager()
                            .launchApplication("net_rim_bb_qm_peer");
                } catch (ApplicationManagerException e) {
                    e.printStackTrace();
                } finally {
                    Application.getApplication().requestBackground();
                }

            }
        };

        mainScreen.addMenuItem(appendUnreadMenuItem);

    }
}


package mypackage;

import net.rim.device.api.ui.UiApplication;

/**
 * This class extends the UiApplication class, providing a
 * graphical user interface.
 */

public class MyApp extends UiApplication
{
    /**
     * Entry point for application
     * @param args Command line arguments (not used)
     */
    public static void main(String[] args)
    {
        // Create a new instance of the application and make the currently
        // running thread the application's event dispatch thread.
        MyApp theApp = new MyApp();       
        theApp.enterEventDispatcher();
    }
    

    /**
     * Creates a new MyApp object
     */
    public MyApp()
    {        
        // Push a screen onto the UI stack for rendering.
        pushScreen(new MyScreen());
    }    
}

 Plzzzzzzz Answer....Guys Help me out :-)

 

Developer
Posts: 81
Registered: ‎12-04-2012
My Device: BlackBerry@8520 smartphone(Edge,Wi-fi)
My Carrier: vodafone

Re: how to save chat history using Java code

guysss do look in
Developer
Posts: 19,631
Registered: ‎07-14-2008
My Device: Not Specified

Re: how to save chat history using Java code

As far as I can see, all your code does is open BBM.  So how does this enable the user to

"manually check the Save chat History-->device/memory card"?

 

The code that you have is generic code that could work to launch any application provided you know that applications module name. 

 

To do what you want requires something specific to BBM.  If it was available it would be documented somewhere.  I have never seen a document that describes any programmatic method of changing a BBM users settings.  Sorry.