<?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; social networks</title>
	<atom:link href="http://devblog.blackberry.com/tag/social-networks/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.blackberry.com</link>
	<description></description>
	<lastBuildDate>Wed, 22 May 2013 19:49:17 +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; social networks</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>Be Social – Integrate your apps with Facebook and Twitter</title>
		<link>http://devblog.blackberry.com/2012/06/integrate-apps-with-social/</link>
		<comments>http://devblog.blackberry.com/2012/06/integrate-apps-with-social/#comments</comments>
		<pubDate>Wed, 06 Jun 2012 13:33:03 +0000</pubDate>
		<dc:creator>Shadid</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Java Development]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[BlackBerry 7]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[sample app]]></category>
		<category><![CDATA[social networks]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=9669</guid>
		<description><![CDATA[Find out how to integrate your app with social networks like Facebook and Twitter.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=9669&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>One of the unsung heroes of <a href="http://www.blackberry.com/bb7" target="_new">BlackBerry® 7</a> Java SDK is the Send Command Framework. Although the name doesn’t say much, this API lets you seamlessly integrate with existing apps on the device to share data. Thankfully the native <a href="http://appworld.blackberry.com/webstore/content/680/?lang=en" target="_new">Facebook®</a> and <a href="http://appworld.blackberry.com/webstore/content/8160/?lang=en" target="_new">Twitter®</a> apps are two of many!</p>
<p style="text-align:center;"><img src="http://rimdevblog.files.wordpress.com/2012/05/connected-apps-2.jpg?w=270&#038;h=360" alt="TITLE_IMAGE" width="270" height="360" /> <img title="" src="http://rimdevblog.files.wordpress.com/2012/05/connected-apps-3.jpg?w=270" alt="" width="270" /></p>
<p style="text-align:center;"><em><a href="https://github.com/blackberry/Samples-for-Java/tree/master/SocialApp" target="_new">Download the sample app</a></em></p>
<p>So this is it folks &#8212; no more hair-pulling to figure out how to talk to social networks directly. There are already apps for them, so let’s learn how to leverage those apps from ours instead of reinventing it.</p>
<p><span id="more-9669"></span></p>
<p>The first step is to create the data or context we would like to share. This context is simply a JSON object that encapsulates our data. Here is an example:</p>
<p><code>JSONObject context = new JSONObject();<br />
try {<br />
context.put(SendCommandContextKeys.TEXT, "Your Text");<br />
context.put(SendCommandContextKeys.SUBJECT, "Your Text");<br />
// context.put(SendCommandContextKeys.PATH, "file:///.....");<br />
} catch (JSONException e) {<br />
System.out.println(e.toString());<br />
}</code></p>
<p>I intentionally commented out the PATH type data because we cannot use PATH data in a context that also has TEXT or SUBJECT types. But I still wanted to highlight that we can also share a file path (e.g. a photo).</p>
<p>Once we have our data context nicely wrapped up in a JSONObject, we need to create SendCommand objects that point to specific apps with a specific context. So how do we get these SendCommands? Easy peasy &#8212; we simply query the Send Command Framework with our context data. Here’s how:</p>
<p><code>SendCommand[] commandsAll =<br />
SendCommandRepository.getInstance().get(SendCommand.TYPE_TEXT, context, true);</code></p>
<p>Notice that the 3rd parameter above is a Boolean. If true, the query returns all commands regardless if their associated applications can be opened; if false, it returns only commands whose associated applications can be opened. Ideally we would set it to false; however, in this post we will see how we can get them all and filter them in our own application logic.</p>
<p>Each SendCommand object has an ID that uniquely identifies the target app and the context. Note that the IDs are not documented as there could be so many of them, but it is fairly easy to figure them out by experimentation. Since our target is the Facebook app and the Twitter app, let me save you the work by telling you what their IDs are.</p>
<p><img class="aligncenter size-full wp-image-9672" title="" src="http://rimdevblog.files.wordpress.com/2012/05/connected-apps-1.jpg?w=550&#038;h=130" alt="" width="550" height="130" /></p>
<p>Now let’s filter:</p>
<p><code>for (int i = 0; i &lt; commandsAll.length; i++) {<br />
if (commandsAll[i].getId().equals("Twitter_text")) {<br />
commands[0] = commandsAll[i];<br />
}<br />
if (commandsAll[i].getId().equals("Facebook_text")) {<br />
commands[1] = commandsAll[i];<br />
}<br />
}</code></p>
<p>&#8230;and we are done. We have our SendCommand objects and we are free to call their run() method anywhere in our app. Be it a Button click or a Menu selection, knock yourself out!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/9669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/9669/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=9669&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2012/06/integrate-apps-with-social/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/25ee80c29143f159bad70d24df820bc1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shadidhaque</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2012/05/connected-apps-2.jpg" medium="image">
			<media:title type="html">TITLE_IMAGE</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2012/05/connected-apps-3.jpg" medium="image" />

		<media:content url="http://rimdevblog.files.wordpress.com/2012/05/connected-apps-1.jpg" medium="image" />
	</item>
		<item>
		<title>The open-source Facebook BlackBerry SDK</title>
		<link>http://devblog.blackberry.com/2010/09/facebook-sdk/</link>
		<comments>http://devblog.blackberry.com/2010/09/facebook-sdk/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 20:09:58 +0000</pubDate>
		<dc:creator>Mike Kirkup</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[facebook sdk]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[social networks]]></category>
		<category><![CDATA[social platform]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=2429</guid>
		<description><![CDATA[The Facebook BlackBerry SDK is here! Download links available.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=2429&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><img src="http://rimdevblog.files.wordpress.com/2010/09/fb.jpg?w=388&#038;h=362" alt="" title="Facebook BlackBerry SDK" width="388" height="362" class="aligncenter size-full wp-image-2426" /></p>
<p>Have you ever thought about adding Facebook integration to your existing and/or future BlackBerry® applications?  Are you eager to integrate your BlackBerry applications with Facebook, but feel lost and don&#8217;t know where exactly to start?</p>
<p>If your answer is yes to either of these questions, I&#8217;m very excited to tell you that there is now a community-initiated, community-driven and open-source Java® Facebook SDK which will make your life much easier!</p>
<p>This SDK was initiated and created by an individual BlackBerry application developer in Indonesia, Eki Baskoro. It is now an open-source project under the MIT license, which makes it completely free to use and distribute.  Although still in its infancy, some of the leading BlackBerry application developers, such as <a href="http://www.motekmobile.com/" target="_new" title="Motek Mobile">Motek Mobile</a>, have already been using it to Facebook-enable many of their existing BlackBerry applications with ease.</p>
<p>In summary, this Java SDK serves nicely as a reference implementation of the Facebook OAuth 2.0 authentication mechanism, and also the new Facebook Graph API, so that developers don’t need to reinvent the wheel and implement their own set of APIs from scratch.  In addition, a sample BlackBerry application is also included right out-of-the-box, which clearly demonstrates how to seamlessly integrate with Facebook using a set of handy built-in Java classes and factories (such as FacebookContext, User, Post, and so on).</p>
<p>For more information about this SDK, please visit the <a href="https://sourceforge.net/projects/facebook-bb-sdk/" target="_new">official website</a> of the project. Or if you wish to jump directly into the source code, you can check it out from the <a href="https://facebook-bb-sdk.svn.sourceforge.net/svnroot/facebook-bb-sdk" target="_new">Subversion repository</a>, or download the <a href="https://sourceforge.net/projects/facebook-bb-sdk/files/" target="_new">zip bundle</a>.  Leave a comment and let us know how it worked out for you!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/2429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/2429/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=2429&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2010/09/facebook-sdk/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/df3fbb85b0186198b2f85e7cd3f0bf1a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mikekir1</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2010/09/fb.jpg" medium="image">
			<media:title type="html">Facebook BlackBerry SDK</media:title>
		</media:content>
	</item>
	</channel>
</rss>
