<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>BlackBerry Developer Blog &#187; chat</title>
	<atom:link href="http://devblog.blackberry.com/tag/chat/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.blackberry.com</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 15:08:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='devblog.blackberry.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/9ef0a66c09615fa946c4179662398878?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>BlackBerry Developer Blog &#187; chat</title>
		<link>http://devblog.blackberry.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://devblog.blackberry.com/osd.xml" title="BlackBerry Developer Blog" />
	<atom:link rel='hub' href='http://devblog.blackberry.com/?pushpress=hub'/>
		<item>
		<title>Using the Invocation Framework with BlackBerry Messenger</title>
		<link>http://devblog.blackberry.com/2012/11/bbm-invocation-framework/</link>
		<comments>http://devblog.blackberry.com/2012/11/bbm-invocation-framework/#comments</comments>
		<pubDate>Thu, 22 Nov 2012 18:28:41 +0000</pubDate>
		<dc:creator>MSohm</dc:creator>
				<category><![CDATA[Native SDK Development]]></category>
		<category><![CDATA[Platform Services]]></category>
		<category><![CDATA[bbm]]></category>
		<category><![CDATA[blackberry messenger]]></category>
		<category><![CDATA[chat]]></category>
		<category><![CDATA[Invocation]]></category>
		<category><![CDATA[invoke]]></category>
		<category><![CDATA[Share]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=12233</guid>
		<description><![CDATA[My previous blog posts listed below covered the features offered by the BlackBerry® Messenger (BBM™) Social Platform at an API level: Integrate with BBM and Watch Your Application Go Viral How to Integrate Your Native Application with BBM How to Integrate Your BlackBerry WebWorks Application with BBM Now let’s take a look at how you [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=12233&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>My previous blog posts listed below covered the features offered by the BlackBerry® Messenger (BBM™) Social Platform at an API level:</p>
<p><a href="http://devblog.blackberry.com/2012/11/bbm-integration/" target="_new">Integrate with BBM and Watch Your Application Go Viral</a><br />
<a href="http://devblog.blackberry.com/2012/11/bbm-native-app-integration/" target="_new">How to Integrate Your Native Application with BBM</a><br />
<a href="http://devblog.blackberry.com/2012/11/blackberry-webworks-bbm-integration/" target="_new">How to Integrate Your BlackBerry WebWorks Application with BBM</a></p>
<p>Now let’s take a look at how you can use the invocation framework to invoke BlackBerry Messenger and bring cards from BBM into your application. In case the term card is new to you, let me explain. Think of cards as a screen of another application that is shown within your application and acts like a screen in your own app. A card becomes part of the flow that makes up BlackBerry® 10, allowing for a seamless user experience that prevents the user from having to switch applications.</p>
<p>The code samples used in this blog post are in QML, but keep in mind that you can use these invocation features from C++, BlackBerry® WebWorks™ and Adobe® AIR®.</p>
<p><span id="more-12233"></span></p>
<p>Below is a screenshot of the actions available that you could use in the menu of your application to invoke BBM. The “BBM Invocation” text you see below represents your application screen (it actually says BBM Invocation Sample). Each BBM card is going to be displayed on top of it. At any time the user can peek back to see your applications screen or close the card completely, returning to your application screen.</p>
<p>Let’s take a look at each of these cards individually, see how they’re invoked and what they look like once invoked.</p>
<p><img class="aligncenter size-full wp-image-12234" title="TITLE_IMAGE" alt="TITLE_IMAGE" src="http://rimdevblog.files.wordpress.com/2012/11/bbm-invoke-framework-1.jpg?w=288&#038;h=480" height="480" width="288" /></p>
<h3><strong>Start a BBM Chat</strong></h3>
<pre>InvokeActionItem {
    title: "Start BBM Chat"
    query {
        invokeActionId: "bb.action.BBMCHAT"
        uri: "pin:2100000a"
    }
}</pre>
<p>The code above shows how to initiate a BBM chat. The chat window will flow into your application as a card. In the example above, a single PIN is used. If you omit the URI parameter, the user will be prompted to choose a contact from their BBM contact list to include in the chat session. If a chat session already exists with the contact, it will be shown with previous messages populated.</p>
<p><img class="aligncenter size-full wp-image-12235" title="" alt="" src="http://rimdevblog.files.wordpress.com/2012/11/bbm-invoke-framework-2.jpg?w=288&#038;h=480" height="480" width="288" /></p>
<h3><strong>Set BBM Avatar Image</strong></h3>
<pre>InvokeActionItem {
    title: "Set BBM Avatar Pic"
    query {
        invokeTargetId: "sys.bbm.imagehandler"
        invokeActionId: "bb.action.SET"
        uri: "file:///path/to/the/file.png"
    }
}</pre>
<p>You can prompt the user to change their BBM avatar image to one specified by your application. This triggers a card that previews the image and allows the user to crop or zoom. Once the user is happy with their selection, they click Save to update their BBM Avatar.</p>
<p><img class="aligncenter size-full wp-image-12236" title="" alt="" src="http://rimdevblog.files.wordpress.com/2012/11/bbm-invoke-framework-3.jpg?w=288&#038;h=480" height="480" width="288" /></p>
<h3><strong>Invite to BlackBerry Messenger</strong></h3>
<pre>InvokeActionItem {
    title: "Invite to BBM"
    query {
        invokeActionId: "bb.action.INVITEBBM"
        uri: "pin:2100000A"
    }
}</pre>
<p>If you know the BlackBerry PIN for contacts who are not yet BlackBerry Messenger users, you can invite them to BBM by using the BlackBerry.action.INVITEBBM invoke action as shown above. The user can then write a personalized message to their contact before sending the message.</p>
<p><img class="aligncenter size-full wp-image-12237" title="" alt="" src="http://rimdevblog.files.wordpress.com/2012/11/bbm-invoke-framework-4.jpg?w=288&#038;h=480" height="480" width="288" /></p>
<h3><strong>Share Text over BBM</strong></h3>
<pre>InvokeActionItem {
    title: "Share Text Over BBM"
    query {
        mimeType: "text/plain"
        invokeTargetId: "sys.bbm.sharehandler"
        invokeActionId: "bb.action.SHARE"
        data: "This is some text to share."
    }
}</pre>
<p>Sharing text over BBM enables your application to start a chat session and populates the message entry field with the text specified in the data section. Just like starting a BBM chat session above, if a previous chat session exists, the message history will be shown.</p>
<p><img class="aligncenter size-full wp-image-12238" title="" alt="" src="http://rimdevblog.files.wordpress.com/2012/11/bbm-invoke-framework-5.jpg?w=288&#038;h=480" height="480" width="288" /></p>
<h3><strong>Share Image over BBM</strong></h3>
<pre>InvokeActionItem {
    title: "Share Image Over BBM"
    query {
        invokeTargetId: "sys.bbm.sharehandler"
        invokeActionId: "bb.action.SHARE"
        uri: "file:///path/to/image/file.png"
    }
}</pre>
<p>Sharing an image over BBM works almost the same way as sharing text, except you specify a URI that points to an image file. It brings up a chat card with a message composed and ready to send with the image attached.</p>
<p><img class="aligncenter size-full wp-image-12239" title="" alt="" src="http://rimdevblog.files.wordpress.com/2012/11/bbm-invoke-framework-6.jpg?w=287&#038;h=480" height="480" width="287" /></p>
<h3><strong>Wrapping It Up</strong></h3>
<p>For simplicity, the QML code samples above are using hard coded data and URI values. However, in a real application you’d want to use dynamic values based on variables within your application. You can do this using the onTriggered method. Here is an example of its use:</p>
<pre>InvokeActionItem {
    title: "Share Text Over BBM"
    query {
        mimeType: "text/plain"
        invokeTargetId: "sys.bbm.sharehandler"
        invokeActionId: "bb.action.SHARE"
        data: "This is some text to share."
    }
    onTriggered: {
        data = "Some new text"
    }
}</pre>
<p>When invoked, the sample above would populate the chat session with “Some new text”. In a real application you’d change the “Some new text” string to point to a variable or control in your application.</p>
<p>That concludes the list of BBM cards currently available for BlackBerry 10. As you can see, by using just a few lines of code you can integrate some powerful features like BBM Chat into your application. Invoke away!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/12233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/12233/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=12233&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2012/11/bbm-invocation-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/76c7dc9f1e2068196cd724a8bd5bac54?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">msohm</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2012/11/bbm-invoke-framework-1.jpg" medium="image">
			<media:title type="html">TITLE_IMAGE</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2012/11/bbm-invoke-framework-2.jpg" medium="image" />

		<media:content url="http://rimdevblog.files.wordpress.com/2012/11/bbm-invoke-framework-3.jpg" medium="image" />

		<media:content url="http://rimdevblog.files.wordpress.com/2012/11/bbm-invoke-framework-4.jpg" medium="image" />

		<media:content url="http://rimdevblog.files.wordpress.com/2012/11/bbm-invoke-framework-5.jpg" medium="image" />

		<media:content url="http://rimdevblog.files.wordpress.com/2012/11/bbm-invoke-framework-6.jpg" medium="image" />
	</item>
		<item>
		<title>BBM Social Platform – Drawing Users in with the Profile Box</title>
		<link>http://devblog.blackberry.com/2011/08/bbm-social-platform-profile-box/</link>
		<comments>http://devblog.blackberry.com/2011/08/bbm-social-platform-profile-box/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 13:49:58 +0000</pubDate>
		<dc:creator>Brian Z.</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Platform Services]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[bbm]]></category>
		<category><![CDATA[bbm sdk]]></category>
		<category><![CDATA[chat]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[sample code]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[webworks]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=6882</guid>
		<description><![CDATA[Check out how to develop a Profile Box within the BBM SDK.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=6882&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-6944" title="BBM" src="http://rimdevblog.files.wordpress.com/2011/08/bbm-icon.jpg?w=294&#038;h=277" alt="BBM" width="294" height="277" /></p>
<p>BlackBerry® Messenger (BBM™) is more than just chat! With the release of the BBM Social Platform, we have released a comprehensive set of tools to easily add the power of BBM to your app. This blog post is one in a series focusing on how to easily add social networking features to your app &#8211; and there’s no better time to use this knowledge to update your app so that it’s ready for submission to the 2011 BlackBerry® Developer Challenge (particularly the <a href="http://www.blackberrypartnersfund.com/challenge">Most Addictive social app using the BBM Social Platform</a> category).</p>
<p>People love to share their accomplishments with their peers. You can design your app to incorporate levels of recognition for various accomplishments by use of some sort of award (e.g. badge, statement, icon, trophy, et cetera). Incorporating awards in your app can be a great way to enable users to promote your app to their peers.</p>
<p>Awards generally consist of an icon and a text string and should convey why they were awarded. The BBM Social Platform easily enables achievement sharing as can be seen in the screenshot below, where you can specify the icon and text for the achievement. The platform then automatically groups them under your application’s custom profile box.</p>
<p><span id="more-6882"></span></p>
<p><img class="aligncenter size-full wp-image-6883" title="BBM profile box" src="http://rimdevblog.files.wordpress.com/2011/08/bbm-profile-box.jpg?w=360&#038;h=480" alt="BBM profile box" width="360" height="480" /></p>
<p>If achievements are not a good fit for your application, there are plenty of situations where users have content that they want to share with their friends that may be more suitable in their profile box as opposed to their status message. This could include their current location as a user travels, the current song a user is listening to, or the current book a user is reading. Other use cases include apps that leverage other platform services; for example, apps that are using BlackBerry Push Service may want to post updates for things like a win from a favorite sports team or an alert for extreme weather conditions. Apps that are using Payment Service for in-app purchase may want to allow the user to share items they bought which may encourage other users to purchase the same items. Alternatively, the achievements themselves, may not necessarily be application achievements but rather personal achievements, such as achieving a fitness or weight loss goal, a career goal, or even a financial goal. The possibilities are endless &#8211; and I’m sure you can find a way to leverage this feature in your application!</p>
<p>As a developer, all you need to do is pass an optional (but highly recommended) icon and a string to the platform and, provided that the user has given your app permission to post, the profile box will appear under your app for that user. The profile box is visible to all BBM users whether they have the app or not. Any user who clicks the box without having the app installed will be prompted to download it, expanding your user base through viral distribution. Users who already have the app installed will be prompted to launch it, increasing user engagement.</p>
<p>In the screenshot above, you can see that Nicole has a profile box entitled “Always Happy!” letting everyone know that the application (in this case the BBM SDK Demo) has seen fit to award her with this achievement. The code to accomplish this is seen below in Java® and BlackBerry® WebWorks™.</p>
<p><strong>Java</strong></p>
<div class="sample">
<pre>UserProfile userProfile = platformContext.getUserProfile();
UserProfileBox profileBox = userProfile.getProfileBox();
if (profileBox.isAccessible()) // Ensure that we have permission to access the box
{
	// Each icon used by your application must have a unique ID
int iconId = 1;
EncodedImage icon = EncodedImage.getEncodedImageResource("smiley.png");
profileBox.registerIcon(iconId, icon);
profileBox.addItem(iconId, “Always Happy!");
// A third parameter, cookie (String), can be added to give your app context when launched via the BBMPlatformContextListener listener.
}
</pre>
</div>
<p><strong>BlackBerry WebWorks</strong></p>
<div class="sample">
<p>// Add an item with icon, text, and a cookie<br />
var iconID = { id:1, uri:&#8221;local:///profilebox/smiley.jpg&#8221;};<br />
var options = {text:&#8221;Always Happy!&#8221;, iconId:iconID};<br />
blackberry.bbm.platform.self.profilebox.addItem(options);</p>
</div>
<p>To access the tools and get information about other features of the BBM Social Platform, visit our <a href="http://blackberry.com/developers/bbm" target="_new">BlackBerry Messenger Developer site</a>. To access the complete sample app demonstrating the code shown here, check out the Knowledge Base article “<a href="http://supportforums.blackberry.com/t5/Java-Development/BBM-Social-Platform-How-to-Create-Profile-Boxes/ta-p/1207519" target="_new">BBM Social Platform – Drawing Users in with the Profile Box</a>”.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/6882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/6882/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=6882&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2011/08/bbm-social-platform-profile-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/93c01acd537bfb61a304b73eef4fce76?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">brianzub1</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2011/08/bbm-icon.jpg" medium="image">
			<media:title type="html">BBM</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2011/08/bbm-profile-box.jpg" medium="image">
			<media:title type="html">BBM profile box</media:title>
		</media:content>
	</item>
		<item>
		<title>BBM Social Platform – Adding in-app chat to your app</title>
		<link>http://devblog.blackberry.com/2011/08/bbm-social-platform-adding-chat/</link>
		<comments>http://devblog.blackberry.com/2011/08/bbm-social-platform-adding-chat/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 13:28:27 +0000</pubDate>
		<dc:creator>Brian Z.</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Platform Services]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[bbm]]></category>
		<category><![CDATA[bbm sdk]]></category>
		<category><![CDATA[chat]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[sample code]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[webworks]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=6834</guid>
		<description><![CDATA[Find out how to add in-app chat to your app, complete with sample code.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=6834&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-5685" title="BBM" src="http://rimdevblog.files.wordpress.com/2011/03/bbm-icon_white.jpg?w=353&#038;h=272" alt="BBM" width="353" height="272" /></p>
<p>Want to allow your app’s users to chat with their contacts without having to leave your app? Add BlackBerry® Messenger (BBM™) Chat! By integrating BBM chat directly into your app, you have the opportunity to create a community of BlackBerry® smartphone users who can get together to socialize and communicate. Adding this social aspect can help increase your app’s reach and maintain its presence, thereby increasing its “stickiness.” (A sticky app is one that users find so useful and engaging that they come back to it over and over again!)</p>
<p>Adding BBM Chat may also increase the discoverability of your app &#8211; when people like something, they want to share it with others. Because BlackBerry device users can communicate with any or all of their BBM contacts from within your app, you have a built-in advertising system.</p>
<p>Let’s take a look at a couple of examples:</p>
<p><span id="more-6834"></span></p>
<ul>
<li>While viewing the latest sports scores in a sports news app, a user starts a BBM chat with fellow fan(s) in his contact list to discuss game highlights.</li>
<li>While looking through house listings in a real estate app, a user starts a chat with their real estate agent about a listing that interests them.</li>
</ul>
<p>You can create a full-screen BBM chat session or embed it into your app’s UI &#8211; in the lower half of the screen, for example &#8211; allowing users to continue to interact with your app as they chat. Chat messages can be sent from application to application or from application to BBM.</p>
<p>Here are some code samples for Java® and BlackBerry® WebWorks™ to help get you started:</p>
<p><strong>Java</strong></p>
<p><strong>Full screen:</strong></p>
<p>This line of Java code opens a BBM conversation window with the specified message in the ReplyField and opens a Contact Picker UI field populated with the user’s BBM contacts. The user can select one or several contacts to add to the conversation.</p>
<div class="sample">
<pre>platformContext.getUIService().startBBMChat("Let's chat!");</pre>
</div>
<p></p>
<p><strong>Embedded chat:</strong></p>
<p>The following code sample demonstrates how to create an embedded chat screen.</p>
<div class="sample">
<pre>public class ChatFieldScreen extends MainScreen
{
	private ChatField _chatField; 

	public ChatFieldScreen()
	{
		// Create a field that uses the full height of the manager that contains it.

		Field firstField = null; 

		/* The BottomUpManager allocates space for the bottom fields first, and
		 then allocates the rest of the space to the first field. */

		BottomUpManager bottomUpManager = new BottomUpManager();

		/* Create a chat field that groups messages from the same sender,
		 displays the sender's name, and wraps the messages in bubbles. */

		_chatField = new ChatField(
				MessageListManager.MESSAGE_STYLE_GROUP_MESSAGES_SAME_SENDER |
				MessageListManager.MESSAGE_STYLE_SHOW_SENDER_DISPLAY_NAME,
				MessageListManager.BORDER_STYLE_BUBBLE);

// Add the field that uses the full height of the container, and then the chat                                                                    field.

		bottomUpManager.add (firstField);
		bottomUpManager.add (_chatField);

		add (bottomUpManager);
	}

	// Look for a press of the Enter key, then processes the text in the chat field

	protected boolean keyChar(char key, int status, int time)
	{
        Field fieldWithFocus = getLeafFieldWithFocus();
        ReplyField replyField =  _chatField.getReplyField();

        if (fieldWithFocus == replyField &amp;&amp; key == Characters.ENTER)
        	{
            // handle the ENTER key from the embedded chat field
            String msg = replyField.getText().trim();
            	if (msg.length() &gt; 0)
            	{	/* add code to send the message, for example:
            			try {
							sendMessage(msg);
						}
            			catch (DataOverflowException e) {
							 // message cannot be sent
							e.printStackTrace();
					} catch (ContactUnreachableException e) {
							// contact is not reachable
							e.printStackTrace();
							}
				*/
            	}

            replyField.setText(null);  // clear the reply field
            _chatField.toggle();       // hide the reply field
            return true;
        	}
        return super.keyChar(key, status, time);
    }

	/* Create a class to send the message over an existing connection, for example:

private void sendMessage (String msg) throws DataOverflowException, ContactUnreachableException
		{
		BBMPlatformContactList contactList = connection.getContactList();
    		if( connection.getContactList().size() &gt; 0 ) {
       	 	BBMPlatformData data = new BBMPlatformData( msg );
       		connection.sendData( data, contactList );
     		}
		}
	*/
}</pre>
</div>
<p></p>
<p><strong>BlackBerry WebWorks</strong></p>
<p><strong>HTML chat window elements:</strong></p>
<div class="sample">
<pre>&lt;div id="chatWindow"&gt;&lt;/div&gt;
&lt;div id="inputArea"&gt;
                &lt;textarea id="txtMessage" rows="1"&gt;&lt;/textarea&gt;
&lt;/div&gt;</pre>
</div>
<p></p>
<p><strong>Styling chat window elements using CSS:</strong></p>
<div class="sample">
<pre>.receive-chatBubble
{
	margin: 4px 20px 0px 4px;
	padding: 0;
	position: relative;
}

#inputArea
{
	border: 1px solid #A5A2A5;
	border-right: 1px solid #A5A2A5;
	background: black;
	background: -webkit-gradient(linear, 0 0, 0 100%, from(#666), to(#1E1B14));
	padding: 5px 3px;
	overflow:auto;
}</pre>
</div>
<p></p>
<p><strong>Sending an outgoing BBM message via JavaScript:</strong></p>
<div class="sample">
<pre>//Attempt to read the current user's display name from the BBM Client
if ((window.blackberry !== undefined) &amp;&amp; (blackberry.bbm.platform !== undefined))
{
	displayName = blackberry.bbm.platform.self.displayName;
}	

//Display the message in the current user's chat window
addMessageToChatWindow(MESSAGE_TYPE_SEND, message, displayName, dt);

if (connType === "session")
{
	conn.broadcast(message);
}
else {
	conn.send(message);
}</pre>
</div>
<p></p>
<p><strong>Listening for incoming BBM messages via JavaScript:</strong></p>
<div class="sample">
<pre>connection.onBroadcastData = function(user, data)
{
	//Another user in the session has broadcasted a message.
	var displayName = "Unknown", dt = new Date();
	if (user)
	{
		displayName = user.displayName;
	}
	addMessageToChatWindow(MESSAGE_TYPE_RECEIVE, data, displayName, dt);
};</pre>
</div>
<p></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/6834/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/6834/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=6834&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2011/08/bbm-social-platform-adding-chat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/93c01acd537bfb61a304b73eef4fce76?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">brianzub1</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2011/03/bbm-icon_white.jpg" medium="image">
			<media:title type="html">BBM</media:title>
		</media:content>
	</item>
	</channel>
</rss>
