<?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; How-to</title>
	<atom:link href="http://devblog.blackberry.com/category/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.blackberry.com</link>
	<description></description>
	<lastBuildDate>Thu, 23 May 2013 19:58:12 +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; How-to</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>She Said: Leveraging the Power of Foursquare in BlackBerry 10</title>
		<link>http://devblog.blackberry.com/2013/05/she-said-leveraging-the-power-of-foursquare-in-blackberry-10/</link>
		<comments>http://devblog.blackberry.com/2013/05/she-said-leveraging-the-power-of-foursquare-in-blackberry-10/#comments</comments>
		<pubDate>Tue, 07 May 2013 17:40:23 +0000</pubDate>
		<dc:creator>Erin Rahnenfuehrer</dc:creator>
				<category><![CDATA[BlackBerry Jam]]></category>
		<category><![CDATA[BlackBerry Live]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[Native SDK Development]]></category>
		<category><![CDATA[Cascades]]></category>
		<category><![CDATA[foursquare]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[social]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=14924</guid>
		<description><![CDATA[We&#8217;ve spoken before about how to integrate your Cascades and WebWorks apps with Facebook, Twitter, and LinkedIn on BlackBerry 10. We&#8217;ve shared samples with you that show how easy it is to invoke these social networking apps in various ways. But there was a big square-shaped hole in our existing sample code. We were missing out on [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14924&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>We&#8217;ve spoken before about how to integrate your <a href="http://devblog.blackberry.com/2013/03/cascades-socialinvocation/" target="_blank">Cascades</a> and <a href="http://devblog.blackberry.com/2013/02/twitter-and-facebook-cards/" target="_blank">WebWorks</a> apps with Facebook, Twitter, and LinkedIn on BlackBerry 10. We&#8217;ve shared samples with you that show how easy it is to invoke these social networking apps in various ways. But there was a big square-shaped hole in our existing sample code. We were missing out on <a href="https://developer.foursquare.com" target="_blank">Foursquare’s powerful API’s</a> and location database.</p>
<p>So we&#8217;ve updated the <a href="https://github.com/blackberry/Cascades-Samples/tree/master/socialinvocation" target="_new">socialinvocation</a> sample to include examples of how to invoke Foursquare with all of the currently supported invocation parameters.</p>
<p><a href="http://rimdevblog.files.wordpress.com/2013/05/fs1.png"><img class="size-full wp-image-14926 aligncenter" alt="TITLE_IMAGE" src="http://rimdevblog.files.wordpress.com/2013/05/fs1-e1367863197254.png?w=275&#038;h=458" width="275" height="458" /></a></p>
<p>As you can see, Foursquare allows BlackBerry 10 developers to leverage their app in a number of different ways, both through Cards and the Invocation Framework.</p>
<p>Big thanks to <a href="http://twitter.com/kfow35">Kyle</a> from Foursquare who has also documented these features in his sample app:  <a href="https://github.com/foursquare/foursquare-bb10-sdk">https://github.com/foursquare/foursquare-bb10-sdk</a></p>
<p>If you want to learn more about Social Invocation and why you should be including it in your app, come to one of our sessions next week at BlackBerry Live!  We’ll be talking about the benefits of integrating with Foursquare and the rest of the Social apps in two sessions:</p>
<p><a href="https://bblive.blackberryconferences.net/2013/connect/sessionDetail.ww?SESSION_ID=1584" target="_blank">JAM37 </a>- Building context-aware applications by leveraging the power of Foursquare APIs, Thursday, May 16</p>
<p><a href="https://bblive.blackberryconferences.net/2013/connect/sessionDetail.ww?SESSION_ID=2718" target="_blank">JAM52 </a>- Get Social: Connecting your app to Facebook, Twitter, Foursquare, and more! Wednesday, May 15</p>
<p>Kyle from Foursquare will be there, and we will show a real world example of how <a href="https://untappd.com/home" target="_blank">Untappd</a> found success by integrating with Foursquare.  Sample apps, best practices, and code snippets will also be presented that will show developers how to quickly get started in both the <a href="https://developer.blackberry.com/html5/" target="_blank">BlackBerry WebWorks SDK</a> and the <a href="https://developer.blackberry.com/native" target="_blank">BlackBerry Native SDK</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/14924/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/14924/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14924&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2013/05/she-said-leveraging-the-power-of-foursquare-in-blackberry-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0432900fe27aa1429d5e6809cd149a3c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">erahnen</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/05/fs1-e1367863197254.png" medium="image">
			<media:title type="html">TITLE_IMAGE</media:title>
		</media:content>
	</item>
		<item>
		<title>Command Line Rocks! Building BlackBerry 10 Apps Without An IDE</title>
		<link>http://devblog.blackberry.com/2013/05/building-apps-without-an-ide/</link>
		<comments>http://devblog.blackberry.com/2013/05/building-apps-without-an-ide/#comments</comments>
		<pubDate>Mon, 06 May 2013 12:32:05 +0000</pubDate>
		<dc:creator>doturner</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Native SDK Development]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[native]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=14899</guid>
		<description><![CDATA[Don’t get me wrong, I love our Momentics IDE. It provides many features that help to build apps rapidly including the QML previewer and code auto-completion. Sometimes, however, it can be extremely useful to know what’s going on under-the-hood. This article will aim to explain how to build a native app from the command line, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14899&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Don’t get me wrong, I love <a href="http://developer.blackberry.com/native" target="_blank">our Momentics IDE</a>. It provides many features that help to build apps rapidly including the QML previewer and code auto-completion. Sometimes, however, it can be extremely useful to know what’s going on under-the-hood.</p>
<p>This article will aim to explain how to build a native app from the command line, using the tools bundled in the BlackBerry 10 Native SDK and your favourite text editor.</p>
<p><span id="more-14899"></span></p>
<h2>Set up your environment</h2>
<p>The Native SDK includes a script called bbndk-env.sh (or .bat on Windows) in the root folder that initialises the environment variables that the other tools depend on. I will refer to the install location of the Native SDK as $NDK_DIR.</p>
<pre>Mac: source $NDK_DIR/bbndk-env.sh
Win: $NDK_DIR/bbndk-env.bat</pre>
<h2>So what does this script set?</h2>
<p>The most important environment variables are:</p>
<p><b>QNX_TARGET</b>: This directory contains all the configuration files and libraries for the BlackBerry 10 device, the <i>target</i> that we want our app to run on.  You can see all the libraries which can be linked against in $QNX_TARGET/armle-v7/lib and $QNX_TARGET/armle-v7/usr/lib.</p>
<p><b>QNX_HOST</b>: This directory contains the tools and configuration files for our host system, ie Windows, Mac or Linux. It includes a compiler, linker and assembler for cross compiling to various architectures, as well as <a href="https://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/c_understanddevenv_use_commandline.html">command line tools for packaging, signing and deploying your application</a>.</p>
<h2>Building for the ARM architecture</h2>
<p>You may have noticed the use of armle-v7 in the above directory structure. This refers to the processor architecture on BlackBerry 10: <b>ARM Little Endian Version 7</b>. To build binaries that run on BlackBerry 10 you need to compile for this architecture.</p>
<p>Start by creating a folder to hold our app&#8217;s files, call it GoodbyeIDE. From now on I will refer to this as $PROJECT_DIR. Inside this folder create a file called main.c with the following content:</p>
<pre>#include &lt;stdio.h&gt;
int main()
{
  fprintf(stdout, "Goodbye IDE!\n");
  return 0;
}</pre>
<p>Now lets compile it. Change to $PROJECT_DIR and execute:</p>
<pre>qcc -Vgcc_ntoarmv7le main.c -o main</pre>
<p>Lets explain this command in a bit more detail. qcc stands for QNX C Compiler. BlackBerry 10 is built on top of QNX and uses many of its build tools.</p>
<p>qcc is essentially a wrapper for gcc  (GNU Compiler Collection). The -V switch tells qcc which version of gcc to use, in this case its the ntoarmv7le version which stands for QNX Neutrino ARM Version 7 Little Endian (a bit of a mouthful).</p>
<p>To build for the BlackBerry 10 simulator you need to use the gcc version for the x86 architecture.</p>
<pre>qcc -Vgcc_ntox86 main.c -o main</pre>
<p>To view a full list of the available gcc versions run:</p>
<pre>qcc -V</pre>
<p>The main.c -o main part of the command just specifies the input C filename and output binary filename.</p>
<p>OK, so now we should have a binary (called main) that will run on a BlackBerry 10 device. This binary won&#8217;t run on your host operating system since it&#8217;s not compiled for the same architecture. If you have a working gcc you can compile it by doing:</p>
<pre>gcc main.c -o main2
./main2</pre>
<p>When you execute main2 you should see &#8220;Goodbye IDE&#8221;.</p>
<p><a href="http://rimdevblog.files.wordpress.com/2013/05/cmd1.png"><img class="size-full wp-image-14903 aligncenter" alt="TITLE_IMAGE" src="http://rimdevblog.files.wordpress.com/2013/05/cmd1.png?w=454&#038;h=190" width="454" height="190" /></a></p>
<h2>Create the BAR descriptor XML</h2>
<p>BlackBerry 10 apps are packaged as BAR (<b>B</b>lackBerry <b>A</b>pplication a<b>R</b>chive) files. To create a BAR file we need a descriptor file called bar-descriptor.xml. This file includes information about the app such as name, version, required permissions and a list of assets.</p>
<p>Create the bar-descriptor.xml file with the following content:</p>
<pre>&lt;qnx&gt;
  &lt;id&gt;com.example.GoodbyeIDE&lt;/id&gt;
  &lt;versionNumber&gt;1&lt;/versionNumber&gt;
  &lt;name&gt;Goodbye IDE&lt;/name&gt;
  &lt;asset path="main" entry="true"&gt;main&lt;/asset&gt;
&lt;/qnx&gt;</pre>
<p>From our point of view the most important line in bar-descriptor.xml is this one:</p>
<pre>&lt;asset path="main" entry="true"&gt;main&lt;/asset&gt;</pre>
<p>This specifies that the BAR contains a file called main which is the entry point for the app.</p>
<p><a href="https://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/r_blackberry_tablet_dtd_intro.html#r_blackberry_tablet_dtd_intro">A full list of BAR application descriptor parameters is available here</a>.</p>
<h2>Packaging and deploying your app</h2>
<p>Now that we have a binary and an application descriptor we are ready to create a BAR file.</p>
<p>A BAR file is essentially a zip file which contains all your app&#8217;s assets and the meta information from bar-descriptor.xml. In fact, if you rename a .bar file to .zip you will be able to extract it to see all the files in that app.</p>
<p>To create a BAR file run the following command:</p>
<pre>blackberry-nativepackager -package GoodbyeIDE.bar bar-descriptor.xml -devMode -debugToken ~/Library/Research\ In\ Motion/debugtoken1.bar</pre>
<p>Note that the -devMode and -debugToken flags are only required if you are deploying to a physical device. This is a handy feature that allows you to deploy your app without signing it, as long as your debug token is installed on the device.</p>
<p>To do this you&#8217;ll need to <a href="https://www.blackberry.com/SignedKeys/codesigning.html">register with RIM to sign applications</a> and <a href="https://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/t_setup_manual_create_debug_token_cmdline.html">create a debug token</a>.</p>
<p>So now you have a BAR file called GoodbyeIDE.bar you can deploy it to the device using the following command:</p>
<pre>blackberry-deploy -installApp 169.254.0.1 -password pass GoodbyeIDE.bar</pre>
<p><b>169.254.0.1</b> is the IP of your target and <b>pass</b> is the device password.</p>
<p>If you take a look at your application icons, you should see a new one called <b>Goodbye IDE</b> (as specified in the &lt;name&gt; tag in bar-descriptor.xml).</p>
<p><a href="http://rimdevblog.files.wordpress.com/2013/05/cmd2.png"><img class="aligncenter size-full wp-image-14904" alt="cmd2" src="http://rimdevblog.files.wordpress.com/2013/05/cmd2-e1367843338680.png?w=400&#038;h=400" width="400" height="400" /></a></p>
<p>If you tap on the icon your app should run! But&#8230;nothing happened, right?</p>
<h2>Viewing log files over SSH</h2>
<p>Actually the app did run, it&#8217;s just that all it did was print &#8220;Goodbye IDE!&#8221; to the stdout. The stdout on BlackBerry 10 is directed into a log file. We can view this log file by SSHing onto the device. Here&#8217;s how:</p>
<p>First we have to tell the device that we want to create a secure connection to it:</p>
<pre>blackberry-connect 169.254.0.1 -password pass</pre>
<p>Now open an SSH client (such as <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">putty</a>) and run:</p>
<pre>ssh devuser@169.254.0.1</pre>
<p>You should now be connected via SSH. Feel free to poke around! Apps are installed in <b>/accounts/1000/appdata</b>. Each app is given its own <a href="https://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/accessible_folders.html">sandbox folder</a> with a unique name based on its id (which we specified in bar-descriptor.xml).</p>
<p>Example sandbox folder name: <b>com.example.GoodbyeIDE.testDev__GoodbyeIDEcf9b848</b></p>
<p>The log file can be found in the <b>logs</b> directory under the sandbox folder name. To view the file just run:</p>
<pre>cat log</pre>
<p>The log file is re-created each time the app is run. To test that the app is working delete the log file, tap on the app icon and run the above command again.</p>
<h1>Summary</h1>
<p>That&#8217;s it for now. The next article will focus on making your life easier by using Makefiles, the Qt build system and creating a more logical project folder structure.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/14899/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/14899/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14899&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2013/05/building-apps-without-an-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/210521b8148cd3623a5b7883fcf4caa4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">doturner</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/05/cmd1.png" medium="image">
			<media:title type="html">TITLE_IMAGE</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/05/cmd2-e1367843338680.png" medium="image">
			<media:title type="html">cmd2</media:title>
		</media:content>
	</item>
		<item>
		<title>Tips For Bringing Your BlackBerry Z10 Game To The BlackBerry Q10</title>
		<link>http://devblog.blackberry.com/2013/04/blackberryq10-gaming/</link>
		<comments>http://devblog.blackberry.com/2013/04/blackberryq10-gaming/#comments</comments>
		<pubDate>Mon, 29 Apr 2013 16:52:38 +0000</pubDate>
		<dc:creator>Pratik S.</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[Native SDK Development]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[BlackBerry Q10]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=14839</guid>
		<description><![CDATA[With the upcoming release of BlackBerry Q10, there’s never been a better time to bring over your BlackBerry Z10 game and start monetizing on the new form factor. In this post, I will be talking about various porting considerations and best practices to help you get started and ensure that your game runs the best [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14839&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://rimdevblog.files.wordpress.com/2013/04/ztoq.png"><img class="aligncenter size-full wp-image-14841" alt="TITLE_IMAGE" src="http://rimdevblog.files.wordpress.com/2013/04/ztoq-e1367253023272.png?w=600&#038;h=316" width="600" height="316" /></a></p>
<p>With the upcoming release of BlackBerry Q10, there’s never been a better time to bring over your BlackBerry Z10 game and start monetizing on the new form factor. In this post, I will be talking about various porting considerations and best practices to help you get started and ensure that your game runs the best on Q10.</p>
<p><span id="more-14839"></span></p>
<p>Let’s start off with the hardware differences:</p>
<p><a href="http://rimdevblog.files.wordpress.com/2013/04/specs.png"><img class="aligncenter size-full wp-image-14843" alt="specs" src="http://rimdevblog.files.wordpress.com/2013/04/specs-e1367253111400.png?w=600&#038;h=292" width="600" height="292" /></a></p>
<p>The BlackBerry Q10 uses the same chipset and GPU as BlackBerry Z10 variant B with Qualcomm Snapdragon MSM8960 and Adreno 225. The main differences that you need to consider are aspect ratio, screen size, orientation and physical keyboard.</p>
<p><b>Aspect Ratio</b></p>
<p>If you have designed your game around the 16:9 or 15:9 aspect ratio, you will need to evaluate how to layout your game content to adapt to the 1:1 aspect ratio. There are various approaches you can take to accomplish this. You might be tempted to take the easy approach of simply scaling your game screen to 1:1 aspect ratio by using letter boxing. This approach is not recommend as it could negatively impact user experience of your game.  Since The BlackBerry Q10 has a smaller screen compared to the BlackBerry Z10, you will significantly reduce the game interaction area and waste precious screen space that could otherwise be utilized for game content such as HUD or controls. For a landscape game, one approach you could take to solve this is to use a comprise aspect ratio such as 16:11.  For the BlackBerry Z10, display more content on the sides and for the BlackBerry Q10 display more content at the top and bottom.</p>
<p>Similarly for a portrait game (9:15 or 9:16), you can display more content at top and bottom on the BlackBerry Z10 and more content at the sides on the BlackBerry Q10. In the below example, <a href="http://appworld.blackberry.com/webstore/content/24579876" target="_blank">Bejeweled 2</a> displays the time progress bar at the bottom on the BlackBerry Z10 and on the side on the BlackBerry Q10.</p>
<p><a href="http://rimdevblog.files.wordpress.com/2013/04/compare.png"><img class="aligncenter size-full wp-image-14844" alt="compare" src="http://rimdevblog.files.wordpress.com/2013/04/compare.png?w=531&#038;h=477" width="531" height="477" /></a></p>
<p>If you are using any aspect ratio specific static assets such as backgrounds, images and splash screen, they will need to be scaled accordingly. For the standard splash screen, the <a href="https://developer.blackberry.com/native/" target="_blank">BlackBerry Native SDK</a> allows you to manage multiple device specific splash screens in the same bar-descriptor. For the BlackBerry Q10 you can add a 720&#215;720 splash screen by editing the bar-descriptor using the IDE or a text editor. Here’s an example:</p>
<pre>&lt;splashScreens&gt;
        &lt;image&gt;splash_1280_768.png&lt;/image&gt;
        &lt;image&gt;splash_720_720.png&lt;/image&gt;
&lt;/splashScreens&gt;
      &lt;asset path="assets"&gt;assets&lt;/asset&gt;
      &lt;asset path="icon.png"&gt;icon.png&lt;/asset&gt;
      &lt;asset path="/Users/pratiksapra/assets/splash_1280_768.png"&gt;splash_1280_768.png&lt;/asset&gt;
      &lt;asset path="/Users/pratiksapra/assets/splash_720_720.png"&gt;splash_720_720.png&lt;/asset&gt;</pre>
<p>Once you do this, correct splash screen will be automatically chosen depending on the device your game is launched on.</p>
<p>Next, if your game uses overlay controls such as virtual joysticks, UI elements and menus, you will need to reposition them as needed. The best approach is to lay them out relative to screen width and height thus making them aspect ratio independent. Below is an example of a flexible UI layout used in <a href="http://appworld.blackberry.com/webstore/content/119547" target="_blank">Bard’s Tale</a> that works on both aspect ratios.</p>
<p><a href="http://rimdevblog.files.wordpress.com/2013/04/bards.png"><img class="aligncenter size-full wp-image-14845" alt="bards" src="http://rimdevblog.files.wordpress.com/2013/04/bards-e1367253830145.png?w=600&#038;h=245" width="600" height="245" /></a></p>
<p><b>Screen Size</b></p>
<p>The BlackBerry Q10 features a 3.1” screen surrounded by a gesture sensitive bezel. If your game uses on-screen controls, it’s important to place them away from the bottom edge of the screen to prevent accidental swipes. An accidental swipe-up gesture during game play will thumbnail your game and cause unnecessary interruption for the user.</p>
<p>Optimizing your game controls is also really important. For example, If your game uses dual virtual joystick control scheme, I would recommend reducing this to just one on-screen joystick.  Due to smaller screen size, the user might end up covering most of the screen when controlling both joysticks using two fingers. We will talk about a solution to this in the later part of this post.</p>
<p><b>Orientation </b></p>
<p>The BlackBerry Z10 supports portrait as the default orientation. If you are setting the orientation in the bar-descriptor for your game, you might be wondering whether this would work on the BlackBerry Q10 without the overhead of creating a separate binary with a different bar-descriptor. To make your life easy, we have made sure that both portrait and landscape orientation settings map to portrait orientation on the BlackBerry Q10. The below example shows how your game would be oriented on the BlackBerry Z10 and the BlackBerry Q10 based on the bar-descriptor orientation setting.</p>
<p><a href="http://rimdevblog.files.wordpress.com/2013/04/orientation.png"><img class="aligncenter size-full wp-image-14846" alt="orientation" src="http://rimdevblog.files.wordpress.com/2013/04/orientation-e1367254029645.png?w=600&#038;h=416" width="600" height="416" /></a></p>
<p><b>Input </b></p>
<p>The BlackBerry Q10 features a physical keyboard so your game needs to be aware of this. If your game contains any buttons to activate the virtual keyboard, you should make sure they are removed or disabled when the game is running on the BlackBerry Q10. Unlike the virtual keyboard, the physical keyboard is always there and can be utilized as an input mechanism.    You can combine keyboard input with touch screen to offer an intuitive and robust input scheme for your game. For example if you want to optimize the dual virtual joystick input mechanism for the BlackBerry Q10, you can substitute one of the joysticks with keyboard input. Or if your game only requires gamepad style input you can use the keyboard as a gamepad.</p>
<p><a href="http://rimdevblog.files.wordpress.com/2013/04/gamepad1.png"><img class="aligncenter size-full wp-image-14851" alt="gamepad" src="http://rimdevblog.files.wordpress.com/2013/04/gamepad1.png?w=538&#038;h=341" width="538" height="341" /></a></p>
<p>Integrating keyboard input in your game is super easy. To accomplish this, in your main event loop simply handle the SCREEN_EVENT_KEYBOARD event and check for the keydown value. Here’s a code snippet on how to do this:</p>
<pre><b>if</b> (<b>screen_get_domain</b>() == domain) {

        screen_event_t screen_event = <b>screen_event_get_event</b>(event);

        <b>int</b> screen_val;
        <b>screen_get_event_property_iv</b>(screen_event, <i>SCREEN_PROPERTY_TYPE</i>, &amp;screen_val);

        <b>switch</b> (screen_val) {
        <b>case</b> <i>SCREEN_EVENT_MTOUCH_TOUCH</i>:
//handle touch events

        <b>case</b> <i>SCREEN_EVENT_KEYBOARD</i>:
            <b>screen_get_event_property_iv</b>(screen_event, <i>SCREEN_PROPERTY_KEY_FLAGS</i>, &amp;screen_val);

            <b>if</b> (screen_val &amp; KEY_DOWN) {
                <b>screen_get_event_property_iv</b>(screen_event, <i>SCREEN_PROPERTY_KEY_SYM</i>,&amp;screen_val);

                <b>fprintf</b>(stderr, "The '%c' key was pressed\n", (<b>char</b>)screen_val);

                <b>switch</b> (screen_val) {
                <b>case</b> KEYCODE_W:
                    // Handle Up
                    <b>break</b>;
                <b>case</b> KEYCODE_A:
                    // Handle Left
                    <b>break</b>;
                <b>case</b> KEYCODE_Z:
                    // Handle Down
                    <b>break</b>;
                <b>case</b> KEYCODE_D:
                    // Handle Right 
                    <b>break</b>;
                <b>case</b> KEYCODE_L:
                    //Button A
                    <b>break</b>;
                <b>case</b> KEYCODE_P:
                    //Button B
                    <b>break</b>;
                <b>case</b> KEYCODE_K: 
                    //Button X
                    <b>break</b>;
                <b>case</b> KEYCODE_O:
                    // Button Y
                    <b>break</b>;
                <b>default</b>:
                    <b>break</b>;
                }
            }
            <b>break</b>;
        }</pre>
<p><b>Tools &amp; Deployment</b></p>
<p>To get started, you will need the latest BlackBerry Native SDK 10.1, which includes BlackBerry Q10 support. If you are running an older version please upgrade by visiting <a href="http://developer.blackberry.com/native">http://developer.blackberry.com/native</a>.</p>
<p>To deploy your game on BlackBerry World, follow the regular process for creating a new release in the Vendor Portal. In the supported devices screen, make sure you select BlackBerry Q10.</p>
<p><b>Known Issues</b></p>
<p>There are two known issues with earlier versions of 10.1 device software that you need to be aware of.</p>
<ul>
<li>Audio – In-game audio playback results in complete loss of device audio and a reboot is required to restore audio.</li>
<li>Orientation – If the orientation is set to landscape in the bar-descriptor, the app splash screen and system dialogs such as volume are incorrectly oriented.</li>
</ul>
<p>Both of these issues have been fixed in the latest 10.1 device software posted at the below link so if you are running an older build please upgrade.</p>
<p><a href="https://developer.blackberry.com/blackberry10devalpha/devalpha_update.html">https://developer.blackberry.com/blackberry10devalpha/devalpha_update.html</a></p>
<p>I hope you found the information included in this post useful.  If you have any questions or feedback please leave a comment below or reach out to me directly on Twitter <a href="http://twitter.com/pratiksapra" target="_blank">@pratiksapra</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/14839/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/14839/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14839&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2013/04/blackberryq10-gaming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/5c7714acaeda7a566baa9545c280c91c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">pratiks1</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/ztoq-e1367253023272.png" medium="image">
			<media:title type="html">TITLE_IMAGE</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/specs-e1367253111400.png" medium="image">
			<media:title type="html">specs</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/compare.png" medium="image">
			<media:title type="html">compare</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/bards-e1367253830145.png" medium="image">
			<media:title type="html">bards</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/orientation-e1367254029645.png" medium="image">
			<media:title type="html">orientation</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/gamepad1.png" medium="image">
			<media:title type="html">gamepad</media:title>
		</media:content>
	</item>
		<item>
		<title>Dude, where’s my car&#8230;keys? Bluetooth LE and BlackBerry 10 How-To</title>
		<link>http://devblog.blackberry.com/2013/04/dude-wheres-my-car-keys-bluetooth-le-and-blackberry-10-how-to/</link>
		<comments>http://devblog.blackberry.com/2013/04/dude-wheres-my-car-keys-bluetooth-le-and-blackberry-10-how-to/#comments</comments>
		<pubDate>Mon, 22 Apr 2013 16:44:36 +0000</pubDate>
		<dc:creator>jcmrim</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Native SDK Development]]></category>
		<category><![CDATA[BlackBerry 10]]></category>
		<category><![CDATA[Bluetooth]]></category>
		<category><![CDATA[Bluetooth Low Energy]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=14728</guid>
		<description><![CDATA[You know, I (@jcmrim) am the world’s-worst for misplacing things: car keys, house keys, and particularly spectacles, the list is endless. You name it and I can lose it. Martin (@mdwrim) isn&#8217;t much better either! So, we thought we’d try a little bit of BlackBerry 10 Bluetooth Low Energy (LE) magic to help us. This  follows on [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14728&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>You know, I (<b><a href="https://twitter.com/jcmrim">@jcmrim</a></b>) am the world’s-worst for misplacing things: car keys, house keys, and particularly spectacles, the list is endless. You name it and I can lose it. Martin <a href="https://twitter.com/mdwrim">(<b>@mdwrim</b></a>) isn&#8217;t much better either!</p>
<p>So, we thought we’d try a little bit of BlackBerry 10 Bluetooth Low Energy (LE) magic to help us. This  follows on nicely from my previous Blog post on the <a href="http://devblog.blackberry.com/2013/04/bluetooth-low-energy-and-the-internet-of-things/">Internet of Things</a> and the model is more widely applicable than just finding lost keys. In fact, if you haven’t already done so, this is probably a good time to have a read of that blog post and article since it covers the basic concepts needed in this blog post.</p>
<p>Go on &#8230; I’ll wait and have a cup of tea.</p>
<p><span id="more-14728"></span></p>
<p>Ah, ok, you’re back &#8230; right, let’s continue.</p>
<p>The first thing we did was to do a little bit of research to see if the Bluetooth SIG had set any standards in this area; no point in re-inventing the wheel and the existence of a standard would mean that a vendor may have already implemented the technology in a product.</p>
<p>Whenever you have a requirement that may be solvable using Bluetooth LE the first place to look is here: <a href="http://developer.bluetooth.org/gatt/Pages/default.aspx">http://developer.bluetooth.org/gatt/Pages/default.aspx</a>.</p>
<p>Browsing through the GATT Profiles we came upon this one: <a href="http://developer.bluetooth.org/gatt/profiles/Pages/ProfileViewer.aspx?u=org.bluetooth.profile.find_me.xml">Find Me</a> &#8230; this sounded promising!</p>
<p>To quote the Abstract for the Find Me profile, “The Find Me profile defines the behavior when a button is pressed on one device to cause an alerting signal on a peer device”. An image formed in our minds immediately!</p>
<p><a href="http://rimdevblog.files.wordpress.com/2013/04/dude.png"><img class="aligncenter size-full wp-image-14729" alt="dude" src="http://rimdevblog.files.wordpress.com/2013/04/dude-e1366638135570.png?w=600&#038;h=89" width="600" height="89" /></a></p>
<p>A closer look shows that this profile implemented a GATT Service called <a href="http://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.immediate_alert.xml">Immediate Alert</a> which used a GATT Characteristic called <a href="http://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.alert_level.xml">Alert Level</a> &#8230; this looked a perfect match.</p>
<p>Here’s the description of the Alert Level Characteristic.</p>
<div id="attachment_14730" class="wp-caption aligncenter" style="width: 610px"><a href="http://rimdevblog.files.wordpress.com/2013/04/dude2.png"><img class="size-full wp-image-14730" alt="TITLE_IMAGE" src="http://rimdevblog.files.wordpress.com/2013/04/dude2-e1366638249812.png?w=600&#038;h=141" width="600" height="141" /></a><p class="wp-caption-text">Alert Level Characteristic</p></div>
<p>It’s an 8-bit unsigned integer that can take on three values signifying:</p>
<ul>
<li>No Alert</li>
<li>Mild Alert</li>
<li>High Alert</li>
</ul>
<p>The interpretation of these Alert Levels is the responsibility of the device that implements this characteristic.</p>
<p>Having found the Bluetooth LE Profile that matched our requirements the next step was to find a simple device that implemented it.</p>
<p>We found this one (see Figure 2) from Texas Instruments<a title="" href="/Users/akinsella/AppData/Local/Microsoft/Windows/Temporary%20Internet%20Files/Content.Outlook/X7OSEEYU/Bluetooth%20Low%20Energy%20and%20the%20Lost%20Keys%20V0_7.doc#_ftn1">[1]</a>.  As well as supporting the Find Me profile it also allows re-programming with other Bluetooth services.</p>
<div id="attachment_14731" class="wp-caption aligncenter" style="width: 407px"><a href="http://rimdevblog.files.wordpress.com/2013/04/dude3.png"><img class="size-full wp-image-14731" alt="dude3" src="http://rimdevblog.files.wordpress.com/2013/04/dude3.png?w=397&#038;h=352" width="397" height="352" /></a><p class="wp-caption-text">Texas Instruments CC2540/41 Mini Development Kit</p></div>
<p>Out of interest, I used one of the tools ( <b>BTool</b> ) that came with the key-fob to examine the GATT services that this device supported. Here’s a screen shot:</p>
<div id="attachment_14733" class="wp-caption aligncenter" style="width: 610px"><a href="http://rimdevblog.files.wordpress.com/2013/04/dude4.png"><img class="size-full wp-image-14733" alt="dude4" src="http://rimdevblog.files.wordpress.com/2013/04/dude4-e1366638431681.png?w=600&#038;h=566" width="600" height="566" /></a><p class="wp-caption-text">GATT Services present on the key-fob</p></div>
<p>So, you can see the highlighted red box clearly shows the Immediate Alert Service which has UUID <b>0&#215;1802</b> (integers are represented in little-endian order so <b>0&#215;1802</b> is represented as <b>02:18</b>) and the Alert Level Characteristic which has UUID <b>0x2A06</b>. Notice that the value field of the Alert Level characteristic has been assigned a handle of <b>0&#215;0028</b> – handles are discovered by and used by applications to access fields in the GATT Service list and they’ve been covered in a previous blog post and article.</p>
<p>The application that we developed based on this is actually very similar in structure to the Heart Rate Monitor application that was described in a previous blog and article. The basic logic is the same:</p>
<ol start="1">
<li>Pair the Bluetooth LE device with the BlackBerry 10 handset before using the application.</li>
<li>Launch the application which:
<ol start="1">
<li>Discovers devices that support the Immediate Alert Service</li>
<li>Connects to a discovered device selected by the user</li>
<li>Offers the user the choice of Alert Levels ( Off, Mild and High) to be sent to the device</li>
</ol>
</li>
</ol>
<p>Here are some screenshots showing what the application looks like:</p>
<div id="attachment_14735" class="wp-caption aligncenter" style="width: 610px"><a href="http://rimdevblog.files.wordpress.com/2013/04/dude5.png"><img class="size-full wp-image-14735" alt="dude5" src="http://rimdevblog.files.wordpress.com/2013/04/dude5-e1366638529222.png?w=600&#038;h=248" width="600" height="248" /></a><p class="wp-caption-text">Screens from the application</p></div>
<p>You can see that the buttons at the top of the screen become enabled only once the application has connected to the Immediate Alert Service on the key-fob. If you select the “High” option this device will emit a loud buzzing sound and flash a green LED.</p>
<div id="attachment_14736" class="wp-caption aligncenter" style="width: 560px"><a href="http://rimdevblog.files.wordpress.com/2013/04/dude6.jpg"><img class="size-full wp-image-14736" alt="Application Sending an Alert to key-fob" src="http://rimdevblog.files.wordpress.com/2013/04/dude6-e1366638632352.jpg?w=550&#038;h=550" width="550" height="550" /></a><p class="wp-caption-text">Application Sending an Alert to key-fob</p></div>
<p>This is the application in action. If you use your imagination you can hear the buzzing and I can find my keys!</p>
<p>The key part of the application is where the Alert Level is sent to the device. Here’s the section of code that does this:</p>
<pre><b>void</b> <b>FindMeService::sendAlertRequest</b>() {

       uint8_t level[] = {0};

      <b>switch</b> (_alertLevel) {
            <b>case</b> FindMeService::<i>Off</i>:
                  level[0] = 0;
                  <b>break</b>;
            <b>case</b> FindMeService::<i>Mild</i>:
                  level[0] = 1;
                  <b>break</b>;
            <b>case</b> FindMeService::<i>High</i>:
                  level[0] = 2;
                  <b>break</b>;
            <b>default</b>:
                  level[0] = 0;
                  <b>break</b>;
      }

      errno = 0;

      <b>if</b> (bt_gatt_write_value_noresp(
                    _serviceInstance,
                    _alertLevelValueHandle, 0, 
                    level,
                    <b>sizeof</b>(level)
          ) != EOK) {

             <b>qDebug</b>() &lt;&lt; "errno=(" &lt;&lt; errno &lt;&lt; ") :" &lt;&lt; <b>strerror</b>(errno);
      }
}</pre>
<p>You can see that we’ve already connected to the Immediate Alert Service and have a reference to this in the variable _serviceInstance; we also have a handle to the Alert Level characteristic value _alertLevelValueHandle. The API used is bt_gatt_write_value_noresp()which means that the Alert Level (level) is written to the device and no acknowledgement is expected in return.</p>
<p>Wait, I hear you say! How did you know that you had to use a Write without Response to write the Alert Level value to the device? Well, it’s part of the definition of the Immediate Alert Service. Here (Figure 6) is the definition of the Alert Level characteristic from the definition of the <a href="http://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.immediate_alert.xml">Immediate Alert</a> Service. It says that this characteristic can be accessed only though the Write without Response request.</p>
<div id="attachment_14739" class="wp-caption aligncenter" style="width: 610px"><a href="http://rimdevblog.files.wordpress.com/2013/04/dude7.png"><img class="size-full wp-image-14739" alt="dude7" src="http://rimdevblog.files.wordpress.com/2013/04/dude7-e1366638797719.png?w=600&#038;h=182" width="600" height="182" /></a><p class="wp-caption-text">Immediate Alert Service Alert Level Characteristic Properties</p></div>
<p>And, just to confirm that the device understands and enforces this as well, Figure 7 shows this value in the GATT‘s entry for the Alert Level characteristic – the value <b>0&#215;04</b> in the green box is the encoding of this property.</p>
<div id="attachment_14740" class="wp-caption aligncenter" style="width: 610px"><a href="http://rimdevblog.files.wordpress.com/2013/04/dude8.png"><img class="size-full wp-image-14740" alt="Characteristic Properties of the Alert Level" src="http://rimdevblog.files.wordpress.com/2013/04/dude8-e1366638855672.png?w=600&#038;h=180" width="600" height="180" /></a><p class="wp-caption-text">Characteristic Properties of the Alert Level</p></div>
<p>We made a video which has Martin (@mdwrim) showing the application in action and explaining the code. Here it is:</p>
<p><a href="http://youtu.be/UXEt5tfUEdc">http://youtu.be/UXEt5tfUEdc</a></p>
<p>If you want to know more then check out the following resources:</p>
<ul>
<li>The complete source code for this application on Git Hub;
<ul>
<li><a href="https://github.com/blackberry/Cascades-Community-Samples">https://github.com/blackberry/Cascades-Community-Samples</a></li>
</ul>
</li>
<li>A Bluetooth Primer level Blog Post is available here to get you started:
<ul>
<li><a href="http://devblog.blackberry.com/2013/04/bluetooth-low-energy-and-the-internet-of-things/">http://devblog.blackberry.com/2013/04/bluetooth-low-energy-and-the-internet-of-things/</a></li>
</ul>
</li>
</ul>
<p>I hope you’ve enjoyed this short note and hope it has piqued your interest to find out more about Bluetooth Low Energy and how it can be integrated into your BlackBerry 10 applications.</p>
<div>
<hr align="left" size="1" width="33%" />
<div>
<p>[1] This should not be regarded as an endorsement by BlackBerry, explicit or implied.</p>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/14728/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/14728/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14728&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2013/04/dude-wheres-my-car-keys-bluetooth-le-and-blackberry-10-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/87d5f773c912570622fcb0a907a5636b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jcmurray2012</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/dude-e1366638135570.png" medium="image">
			<media:title type="html">dude</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/dude2-e1366638249812.png" medium="image">
			<media:title type="html">TITLE_IMAGE</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/dude3.png" medium="image">
			<media:title type="html">dude3</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/dude4-e1366638431681.png" medium="image">
			<media:title type="html">dude4</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/dude5-e1366638529222.png" medium="image">
			<media:title type="html">dude5</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/dude6-e1366638632352.jpg" medium="image">
			<media:title type="html">Application Sending an Alert to key-fob</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/dude7-e1366638797719.png" medium="image">
			<media:title type="html">dude7</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/dude8-e1366638855672.png" medium="image">
			<media:title type="html">Characteristic Properties of the Alert Level</media:title>
		</media:content>
	</item>
		<item>
		<title>Bluetooth Low Energy and the Internet of Things</title>
		<link>http://devblog.blackberry.com/2013/04/bluetooth-low-energy-and-the-internet-of-things/</link>
		<comments>http://devblog.blackberry.com/2013/04/bluetooth-low-energy-and-the-internet-of-things/#comments</comments>
		<pubDate>Mon, 08 Apr 2013 14:50:27 +0000</pubDate>
		<dc:creator>jcmrim</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Native SDK Development]]></category>
		<category><![CDATA[Bluetooth]]></category>
		<category><![CDATA[Bluetooth Low Energy]]></category>
		<category><![CDATA[nfc]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=14532</guid>
		<description><![CDATA[Having spent some time looking at Near Field Communication (NFC), my colleague Martin Woolley (@mdwrim) and I (@jcmrim) became really excited when we came across the new Bluetooth Low Energy APIs in BlackBerry 10. “Bluetooth Low Energy”, I hear you say. ”I know all about Bluetooth since that’s been around for many years. It’s what [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14532&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Having spent some time looking at Near Field Communication (NFC), my colleague Martin Woolley (<a href="http://twitter.com/mdwrim">@mdwrim</a>) and I (<a href="http://twitter.com/jcmrim">@jcmrim</a>) became really excited when we came across the new <a href="http://developer.blackberry.com/native/reference/bb10/bluetooth_libref/topic/about_btle_8h.html">Bluetooth Low Energy</a> APIs in BlackBerry 10.</p>
<p><a href="http://rimdevblog.files.wordpress.com/2013/04/lowenergy-1.png"><img class="alignleft size-full wp-image-14533" alt="lowenergy-1" src="http://rimdevblog.files.wordpress.com/2013/04/lowenergy-1-e1365432296600.png?w=200&#038;h=170" width="200" height="170" /></a></p>
<p>“Bluetooth Low Energy”, I hear you say. ”I know all about Bluetooth since that’s been around for many years. It’s what I use to connect my headset to my BlackBerry device and play music though my sound system. What’s this ‘Low Energy’ thing?”</p>
<p>Well, the Bluetooth specification went through a number of changes a couple of years ago when Bluetooth 4.0 was released. Bluetooth Low Energy (LE) is an addition to the classic specification that allows ultra low power devices to participate in Bluetooth Networks.</p>
<p><span id="more-14532"></span></p>
<p><!--more--></p>
<p>What does “Ultra low power” mean? Well, Bluetooth LE is designed to support devices that would typically be powered by battery cells like the one in this picture.</p>
<p>That means that such devices can have incredibly small footprints yet can be full participants in a Bluetooth network alongside larger devices like tablets or smart phones such as BlackBerry 10 smartphones.</p>
<p>It also means that this awesome technology is an enabler for the “Internet of things” where such devices can participate in an Internet populated with all sorts and sizes of devices ranging from large servers to intelligent thermometers; from tablets to intelligent sensors in your running shoes; from mobile phones to intelligent light switches in your home.</p>
<p>Imagine being able to use your BlackBerry 10 smartphone to tailor your environment to your preferences as you move around. It’s already capable of knowing where you are and Bluetooth LE gives it the capability of communicating with smart devices in your home or car. Imagine returning home and having your BlackBerry 10 smartphone communicate with your lighting to set it appropriately; your home entertainment system to play your favourite playlist; and your house’s environmental controls to set just the right temperature!</p>
<p>The diversity of potential applications is quite staggering. Sports, wearable devices, home automation, automotive and healthcare, are just a few of the sectors recognising the potential of Bluetooth LE.</p>
<p>And &#8230; BlackBerry 10 is a perfect fit here! So, we got to thinking how we could demonstrate how easy it is to integrate Bluetooth LE technology into your BlackBerry 10 application!</p>
<p>In order to provide some focus for this activity we acquired some Bluetooth LE technology and tools including a Wahoo Blue HR device to see what we could do with it. There are a number of similar devices on the market but this seemed like a good starting point. It’s a small, lightweight electronic device, encased in plastic. It has an adjustable strap to allow you to strap it around your chest and the strap has two conductive pads which need to be in contact with the skin.</p>
<p>The nice thing about Bluetooth LE is that there are standards for devices like this that support what’s called the Heart Rate Profile and we managed to develop a nice, even though I say it myself, self contained BlackBerry 10 application that interacted with the heart rate monitor and displayed it’s data.</p>
<p><img class="alignright size-full wp-image-14535" alt="lowenergy-2" src="http://rimdevblog.files.wordpress.com/2013/04/lowenergy-2-e1365432387754.png?w=200&#038;h=118" width="200" height="118" /></p>
<p>Take a look at the images below! The image on the left shows a typical trace for a healthy person like Martin who went on a long, exhausting bike ride to gather this data.</p>
<p>The middle one is probably from a small, hyperactive animal like this hamster; whilst the one on the right probably comes from a hibernating hedgehog I came across in my garden.</p>
<p>Rest assured that no small timid animals were involved in our testing other than in our imaginations!</p>
<h3><a href="http://rimdevblog.files.wordpress.com/2013/04/lowenergy-3.png"><img class="aligncenter size-full wp-image-14537" alt="TITLE_IMAGE" src="http://rimdevblog.files.wordpress.com/2013/04/lowenergy-3-e1365432471173.png?w=600&#038;h=327" width="600" height="327" /></a></h3>
<p>If you want to know more then check out the following resources:</p>
<ul>
<li>A much more <a href="http://supportforums.blackberry.com/t5/Native-Development/BlackBerry-10-Bluetooth-LE-primer-for-developers/ta-p/2287377" target="_blank">detailed article</a> describing the theory and practice behind this application</li>
<li>The complete <a href="https://github.com/blackberry/Cascades-Community-Samples" target="_blank">source code</a> for this application on Git Hub</li>
<li>A <a href="http://youtu.be/dcrJZSL7dpg" target="_blank">video</a> on YouTube showing an overview of the theory and practice behind this application</li>
</ul>
<p>I hope you&#8217;ve enjoyed this short note and hope it has piqued your interest to find out more about Bluetooth Low Energy and how it can be integrated into your BlackBerry 10 applications.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/14532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/14532/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14532&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2013/04/bluetooth-low-energy-and-the-internet-of-things/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/87d5f773c912570622fcb0a907a5636b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jcmurray2012</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/lowenergy-1-e1365432296600.png" medium="image">
			<media:title type="html">lowenergy-1</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/lowenergy-2-e1365432387754.png" medium="image">
			<media:title type="html">lowenergy-2</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/lowenergy-3-e1365432471173.png" medium="image">
			<media:title type="html">TITLE_IMAGE</media:title>
		</media:content>
	</item>
		<item>
		<title>Clearbridge Mobile and the USA Today on BlackBerry 10</title>
		<link>http://devblog.blackberry.com/2013/04/clearbridge-mobile-and-the-usa-today-on-blackberry-10/</link>
		<comments>http://devblog.blackberry.com/2013/04/clearbridge-mobile-and-the-usa-today-on-blackberry-10/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 14:25:48 +0000</pubDate>
		<dc:creator>Anzor B.</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Backbone]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[mobile web development]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Require]]></category>
		<category><![CDATA[USA Today]]></category>
		<category><![CDATA[webworks]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=14491</guid>
		<description><![CDATA[I’ve worked very closely with Clearbridge Mobile Inc. &#8211; the developers of USA TODAY for BlackBerry 10 and we could not be more pleased with the outcome. This application is a favorite among BlackBerry 10 users and maintains a solid five star rating in BlackBerry World with a range of fantastic reviews: “A beautiful use [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14491&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I’ve worked very closely with <a href="http://www.clearbridgemobile.com/" target="_new">Clearbridge Mobile Inc.</a> &#8211; the <a href="http://www.clearbridgemobile.com/" target="_new">developers</a> of USA TODAY for BlackBerry 10 and we could not be more pleased with the outcome. This application is a favorite among BlackBerry 10 users and maintains a solid five star rating in BlackBerry World with a range of fantastic reviews:</p>
<p><i>“A beautiful use of the BlackBerry 10 technology.”</i></p>
<p><i>“An absolutely amazing app. Well done.</i></p>
<p>Many of these reviews refer to USA TODAY as a Native app – in fact, some encourage Native developers to produce apps of this quality – especially impressive as it is a 100% HTML5 WebWorks app.</p>
<p><i>“Great Native App. Very addictive as you can easily navigate through the menu”</i></p>
<p><i>“Watch and learn, that’s how you make a native app”</i></p>
<p><i>“Must have. Go native or go home!”</i></p>
<p>USA TODAY is a perfect example of what can be achieved using HTML5 and the powerful BlackBerry 10 WebWorks Platform to produce an app that proudly carries the Built for BlackBerry ribbon.</p>
<p><span id="more-14491"></span></p>
<h3><strong>Performance</strong></h3>
<p>Performance was critical to USA TODAY &#8211; news, sports, weather, pictures and video sections are combined into a responsive, intuitive viewing experience. Each section contains subsections, while each subsection contains lists and grids of articles. With this much content, view management becomes quite difficult. Having worked closely with Backbone.js (<a href="http://backbonejs.org/" target="_neW">http://backbonejs.org</a>) for a few years, I did not hesitate to recommend it to be the ‘backbone’ of the USA TODAY application.</p>
<p>Backbone.js is a MVC (Model-View-Controller) framework that provides the tools and discipline to write de-coupled, re-usable code while not imposing any non-standard syntax. It is also highly customizable, which is ideal for large projects.</p>
<p>The USA TODAY application uses Backbone.js to its full potential. Articles, gallery, weather, videos, and other data are stored as Data Models and Collections, which are passed to views that combine the data with HTML templates to display it on the screen.</p>
<p>A View is a JavaScript object that contains a set of properties and methods responsible for displaying a region of the application UI. The View also maintains its own DOM structure, which is typically compiled with data to render and display on the screen. HTML templates are code snippets that are re-used across an application. These templates may vary from static pieces of UI to complex dynamic views that contain logic such as loops.</p>
<p>These views are also responsible for listening for changes in the data of the collections and updating regions of UI when a change occurs. Picture the weather section for example: if the weather data on the server changes, we need to update the UI. In order for the UI to reflect the change in the weather and change the graphic from cloudy to sunny, the data model can explicitly tell the view to update, but by doing so, the view becomes tightly coupled with the data model. If we were to add a weather widget to the main screen of the application – we are also required to add a call its update methods from within the data model and so on.</p>
<p>Backbone and other MVC frameworks encourage the use of Publish/Subscribe programming pattern, where views subscribe to changes on the data model. When the data changes on the server, subscribed views receive a change notification, which typically triggers an update of UI. The data model does not need to be aware of what views are subscribed, and therefore remains flexible and de-coupled. This is very similar to how we bind to click events on buttons &#8211; imagine having to change the button’s logic to call functions, versus listening for click events.</p>
<p>This pattern also allows for smaller UI region updates. For example, we can bind a function to only update the current weather UI region, if the weather for the week hasn’t changed. Smaller UI updates result in smaller re-render regions, which drastically improve performance, especially when targeting mobile.</p>
<p>The USA TODAY application uses this pattern throughout the application, which makes UI updates efficient and seamless.</p>
<h3><strong>Code organization</strong></h3>
<p>As the complexity of any application increases, organizing code into modules becomes a necessity. Unfortunately, JavaScript does not natively satisfy all use cases for ‘modules’ yet, so USA TODAY relies on Require.js (<a href="http://requirejs.org/" target="_new">http://requirejs.org</a>) to separate code into neatly organized modules that are confined to performing a single task. Require.js supports Asynchronous Module Definition (AMD), that allows modules to be loaded as needed at run-time, rather than making them available as the application initializes using tags. Require also adds the ability to define dependencies, similar to more traditional languages such as C++ and Java. This ensures required scripts or templates are available to the module when it is initialized. This also means fewer name conflicts, as libraries and functions are defined in the scope of the module rather than globally, as with the tag.</p>
<p>The source code for USA TODAY is inside an intuitive folder structure. Views, collections, models and templates are separate. Logic, structure and styles are separated into JavaScript, HTML and CSS respectively, which is a great practice for all HTML5 developers. This allows for easy maintenance and debugging as well as adding of new features, while maintaining stability. Modules can be swapped in and out, as they are designed to be de-coupled from one another, and communicate with each other using a router and URL hashchanges.</p>
<h3><strong>UI/UX decisions</strong></h3>
<p>Aside from great performance, USA TODAY offers stunning native looking graphics and transitions that make it shine as a <a href="http://developer.blackberry.com/builtforblackberry/" target="_new">Built for BlackBerry</a> App.</p>
<p>The menu, action bar and all other UI elements were made from scratch to closely mimic their native counterparts. They’ve closely followed our UI guidelines, including colors, graphics, sizes that make this application practically indistinguishable from a native BlackBerry 10 application.</p>
<p>(<a href="http://developer.blackberry.com/devzone/design/bb10/application_structure.html" target="_new">http://developer.blackberry.com/devzone/design/bb10/application_structure.html</a>).</p>
<p><img alt="" src="http://rimdevblog.files.wordpress.com/2013/04/usatoday1.jpg?w=250" /> <img alt="TITLE_IMAGE" src="http://rimdevblog.files.wordpress.com/2013/04/usatoday2.jpg?w=250&#038;h=416" width="250" height="416" /></p>
<p>When viewing an article, frequently used actions such as font size and share are located on the action bar, which is very intuitive to both existing BlackBerry 10 users as well as those new to the platform.</p>
<p>Within the article, USA TODAY allows navigating back and forth using swipe gestures. This allows the reader to navigate through a list of articles without ever leaving the article view &#8211; a fantastic UX decision that keeps the user immersed in the experience, which is one of the core promises of the BlackBerry 10 platform.</p>
<p>Using the font action, readers can quickly modify the font-size, which is a key feature in any news reader app.</p>
<p>The main menu reveals itself as the content view slides out in a smooth transition, thanks to hardware accelerated CSS3 animations. There is lots of attention to detail here &#8211; transitions are timed in way that they don’t interfere with each other, such as the gentle fading out of the content view to focus on the menu, which is done right after the menu is fully revealed, as to not interfere with the sliding animation resulting in a smooth transition.</p>
<p>The main menu is a great example of how to provide intuitive, easy to use navigation for an application that includes a ton of sections and sub-sections. It is also an excellent example of how developers can extend our UI guidelines to enhance the User Experience further. Unlike other BlackBerry 10 Applications, the menu contains sections as well as sub-sections, which adds a great personal touch to the user interface and makes an excellent use of space from a User Experience perspective.</p>
<p>Within ‘Day in Pictures’, clicking on a photograph reveals slideshow mode. Using WebWorks API, device orientation is rotated to landscape and photos are displayed and scrolled in widescreen HD. Tapping on the photo will reveal the header, description and action bar, which fades away in a few seconds – another example of attention to detail. Navigating between photos is done by swiping gestures very much like in the native Pictures app for BlackBerry 10.</p>
<p>(API here: <a href="https://developer.blackberry.com/html5/apis/blackberry.app.html#.rotate" rel="nofollow">https://developer.blackberry.com/html5/apis/blackberry.app.html#.rotate</a>)<br />
<img alt="" src="http://rimdevblog.files.wordpress.com/2013/04/usatoday3.jpg?w=500" /></p>
<h3><strong>Service Integration</strong></h3>
<p>Each article displays a share icon on the action bar, which integrates with the BlackBerry 10 Share framework to display all available media where the article may be shared. The USA TODAY application makes use of the invoke WebWorks API to query the device and return a list of all applications that can be used to share content.</p>
<p>(API here: &lt;a href=&#8221;<a href="https://developer.blackberry.com/html5/apis/blackberry.app.html#.rotate" target="_new">https://developer.blackberry.com/html5/apis/blackberry.invoke.html#.query</a>&#8221; target=&#8221;_new&#8221;&gt;<a href="https://developer.blackberry.com/html5/apis/blackberry.invoke.html#.query" rel="nofollow">https://developer.blackberry.com/html5/apis/blackberry.invoke.html#.query</a>)</p>
<h3><strong>Conclusion</strong></h3>
<p>When starting a new HTML5 project, developers have a plethora of frameworks to choose from. Some are used for data and view management alone, while others provide all-in-one solutions, both platform-specific and platform-agnostic. By leaning towards a custom solution with the help of Backbone.js and Require.js, developers at <a href="http://www.clearbridgemobile.com/" target="_new">Clearbridge Mobile Inc.</a> remained completely in control over the performance and user experience from start to finish, resulting in a very responsive and attractive application. They’ve followed our <a href="http://developer.blackberry.com/design/bb10/" target="_new">UI guidelines</a>, integrated platform services and added a personal touch to the user interface. As a result, USA TODAY is a perfect example of how to build a stunning HTML5 application that is truly <a href="http://developer.blackberry.com/builtforblackberry/" target="_new">Built for BlackBerry</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/14491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/14491/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14491&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2013/04/clearbridge-mobile-and-the-usa-today-on-blackberry-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/39587172e747f6f28b4a6ee4a906be0d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anzorb</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/usatoday1.jpg?w=250" medium="image" />

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/usatoday2.jpg?w=250" medium="image">
			<media:title type="html">TITLE_IMAGE</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/04/usatoday3.jpg?w=500" medium="image" />
	</item>
		<item>
		<title>BlackBerry Q10 Device Support Added for Android Apps</title>
		<link>http://devblog.blackberry.com/2013/03/blackberry-q10-android-apps/</link>
		<comments>http://devblog.blackberry.com/2013/03/blackberry-q10-android-apps/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 18:35:49 +0000</pubDate>
		<dc:creator>jamesdreherbb</dc:creator>
				<category><![CDATA[Android Development]]></category>
		<category><![CDATA[BlackBerry World]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[android apps]]></category>
		<category><![CDATA[BlackBerry Q10]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[Q10]]></category>
		<category><![CDATA[QWERTY]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=14289</guid>
		<description><![CDATA[With the upcoming (and much anticipated) release of the BlackBerry Q10, Android developers can now target the first qwerty-keyboard device to be released on the BlackBerry 10 mobile computing platform. The even better news for developers is that they can also port their existing BlackBerry 10 Android apps running on the BlackBerry Z10 and BlackBerry [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14289&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://rimdevblog.files.wordpress.com/2013/03/q10.png"><img class="aligncenter size-full wp-image-14290" alt="TITLE_IMAGE" src="http://rimdevblog.files.wordpress.com/2013/03/q10-e1364220550120.png?w=600&#038;h=600" width="600" height="600" /></a></p>
<p>With the upcoming (and much anticipated) release of the <a href="http://global.blackberry.com/smartphones/blackberry-q10.html" target="_blank">BlackBerry Q10</a>, Android developers can now target the first qwerty-keyboard device to be released on the BlackBerry 10 mobile computing platform. The even better news for developers is that they can also port their existing BlackBerry 10 Android apps running on the BlackBerry Z10 and BlackBerry PlayBook tablet to also include support for the BlackBerry Q10 within the same release build.</p>
<p><span id="more-14289"></span></p>
<p>While the <a href="http://developer.blackberry.com/android" target="_blank">BlackBerry Runtime for Android Apps</a> has a built-in screen manager which will scale the application to the screen size of the device, it’s always best to build your app specific to the device you are targeting to ensure it looks presentable to end-users.</p>
<h4>BlackBerry Z10</h4>
<p>For developers, the key difference between the BlackBerry PlayBook, BlackBerry Z10 and BlackBerry Q10 would be in regard to screen sizes. The all-touch BlackBerry Z10 features a resolution of 1280 x 768 (15:9) on a 4.2-inch, 356 PPI screen. Android resources are pulled in from the res/drawable-xhdpi project folder.</p>
<div id="attachment_14293" class="wp-caption aligncenter" style="width: 257px"><a href="http://rimdevblog.files.wordpress.com/2013/03/android-z10.png"><img class="size-full wp-image-14293" alt="android-z10" src="http://rimdevblog.files.wordpress.com/2013/03/android-z10.png?w=247&#038;h=399" width="247" height="399" /></a><p class="wp-caption-text">BlackBerry Z10 screenshot: 1280&#215;768 background image from res/drawable-xhdpi/device.png</p></div>
<h4>BlackBerry Q10</h4>
<p>The BlackBerry Q10 boasts a 330 PPI screen but with a resolution of 720 x 720 on a 3.1” screen (1:1 aspect ratio). When targeting the BlackBerry Q10, Android developers can leverage the res/drawable-small-square project folder.</p>
<div id="attachment_14292" class="wp-caption aligncenter" style="width: 273px"><a href="http://rimdevblog.files.wordpress.com/2013/03/android-q10.png"><img class="size-full wp-image-14292" alt="android-q10" src="http://rimdevblog.files.wordpress.com/2013/03/android-q10.png?w=263&#038;h=404" width="263" height="404" /></a><p class="wp-caption-text">BlackBerry Q10 screenshot: 720&#215;720 background image from res/drawable-small-square/device.png</p></div>
<h4>BlackBerry PlayBook</h4>
<p>In addition to the BlackBerry Z10 and BlackBerry Q10 models above, the BlackBerry PlayBook also supports Android apps. With a 7” screen resolution of 1024 x 600, this qualifies the BlackBerry PlayBook as an mdpi device pulling in resources from the res/drawable-mdpi project folder.</p>
<div id="attachment_14294" class="wp-caption aligncenter" style="width: 531px"><a href="http://rimdevblog.files.wordpress.com/2013/03/android-pb.png"><img class="size-full wp-image-14294" alt="android-pb" src="http://rimdevblog.files.wordpress.com/2013/03/android-pb.png?w=521&#038;h=338" width="521" height="338" /></a><p class="wp-caption-text">BlackBerry PlayBook screenshot: 1024 x 600 background image from res/drawable-mdpi/device.png</p></div>
<h4>ADT Project Structure</h4>
<p>Both the BlackBerry Z10 and BlackBerry Q10 support icons with a size of 114 x 114 pixels (BlackBerry PlayBook: 86 x 86 pixels) which should be placed within their respective res/drawable project folders as well. Within the same Android project you can target both of the BlackBerry 10 form factors within the same release build by following these standard Android best practices.</p>
<div id="attachment_14296" class="wp-caption aligncenter" style="width: 309px"><a href="http://rimdevblog.files.wordpress.com/2013/03/android-folders.png"><img class="size-full wp-image-14296" alt="android-folders" src="http://rimdevblog.files.wordpress.com/2013/03/android-folders.png?w=299&#038;h=560" width="299" height="560" /></a><p class="wp-caption-text">Single Android project structure for BlackBerry Z10, BlackBerry Q10 &amp; BlackBerry PlayBook</p></div>
<p>You can repackage your Android APK to the BlackBerry BAR file format using the new v1.5.2 SDK, and test/debug using device simulators for the BlackBerry Z10 (BlackBerry 10 Dev Alpha B), BlackBerry Q10 (BlackBerry Dev Alpha C) and BlackBerry PlayBook  tablet available within our <a href="https://developer.blackberry.com/android/tools/">Android tooling page</a>. Other pages which you should find useful would be our <a href="https://developer.blackberry.com/android/documentation/overview_plugin_1849581_11.html">documentation</a> page for the BlackBerry Plug-in for ADT and the Android <a href="https://developer.blackberry.com/android/apisupport/">API Support</a> page.</p>
<h3><b>BlackBerry World Submission</b></h3>
<p>After testing your Android application and repackaging it into the BAR file format, you can submit your app to the <a href="http://appworld.blackberry.com/isvportal" target="_blank">BlackBerry World</a> storefront via the following steps:</p>
<ol>
<li>Log into the <a href="https://appworld.blackberry.com/isvportal">vendor portal</a></li>
<li>Select Manage products</li>
<li>Add a new release</li>
<li>Set ‘supported devices’ appropriately based on BlackBerry Q10, BlackBerry Z10 and/or BlackBerry PlayBook support for your app. If the app supports more than one device you can choose to select multiple devices for the same release build (BAR file). On the contrary, you can also upload specific file bundles (BARs) for each BlackBerry 10 device.</li>
</ol>
<div id="attachment_14298" class="wp-caption aligncenter" style="width: 610px"><a href="http://rimdevblog.files.wordpress.com/2013/03/android-submit.png"><img class="size-full wp-image-14298" alt="android-submit" src="http://rimdevblog.files.wordpress.com/2013/03/android-submit-e1364230212726.png?w=600&#038;h=319" width="600" height="319" /></a><p class="wp-caption-text">Supported BlackBerry 10 devices within the BlackBerry World vendor portal</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/14289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/14289/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=14289&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2013/03/blackberry-q10-android-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/fd0d0b7be2e3c018911a84a02a72b22d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jamesdreherbb</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/03/q10-e1364220550120.png" medium="image">
			<media:title type="html">TITLE_IMAGE</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/03/android-z10.png" medium="image">
			<media:title type="html">android-z10</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/03/android-q10.png" medium="image">
			<media:title type="html">android-q10</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/03/android-pb.png" medium="image">
			<media:title type="html">android-pb</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/03/android-folders.png" medium="image">
			<media:title type="html">android-folders</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/03/android-submit-e1364230212726.png" medium="image">
			<media:title type="html">android-submit</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Create an App in Minutes Using BlackBerry App Generator</title>
		<link>http://devblog.blackberry.com/2013/02/blackberry-app-generator-setup/</link>
		<comments>http://devblog.blackberry.com/2013/02/blackberry-app-generator-setup/#comments</comments>
		<pubDate>Thu, 14 Feb 2013 18:07:25 +0000</pubDate>
		<dc:creator>Donny Halliwell</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[best BlackBerry development]]></category>
		<category><![CDATA[BlackBerry 10 apps]]></category>
		<category><![CDATA[Which BlackBerry apps]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=13767</guid>
		<description><![CDATA[(Originally posted on the Inside BlackBerry Blog) We spent part of last week at BlackBerry Jam Europe, which is generally a conference dedicated to those who already develop apps for BlackBerry. However, there are also many programs for beginners. Since I’ve never created an app, I decided to take a run at developing an app [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=13767&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><em>(Originally posted on the <a title="Inside BlackBerry Blog" href="http://blogs.blackberry.com/2013/02/blackberry-app-generator" target="_new">Inside BlackBerry Blog</a>)</em></p>
<p>We spent part of last week at <a href="http://www.blackberryjamconference.com/europe" target="_new">BlackBerry Jam Europe</a>, which is generally a conference dedicated to those who already develop apps for BlackBerry. However, there are also many programs for beginners. Since I’ve never created an app, I decided to take a run at developing an app for the Inside BlackBerry Blog. As I have literally no experience developing apps, I asked Alex and Luke for some help.</p>
<p>We used the <a href="http://www.blackberryappgenerator.com/blackberry/" target="_new">BlackBerry App Generator</a> to automatically pull content from the Inside BlackBerry Blog, and the <a href="https://www.facebook.com/BlackBerryNA" target="_new">BlackBerry Facebook</a> and <a href="http://www.youtube.com/user/BlackBerry" target="_new">BlackBerry YouTube</a> pages. It took us only about 10 minutes from start to finish and it was absolutely free. The result is a great-looking app that pulls in all of our articles, posts and videos. Let’s have a look as Alex walks us through the process.</p>
<p style="text-align:center;"><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='560' height='315' src='http://www.youtube.com/embed/5VelIsypz1o?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p style="text-align:center;">[ <a href="http://youtu.be/5VelIsypz1o" target="_new">YouTube link for mobile viewing</a> ]</p>
<p>See how easy it was? Using the BlackBerry App Generator you could have your own app up and running in just a few minutes, even with no development experience. Do you have a blog or content and think it would make a great app? Give the BlackBerry App Generator a try for yourself and let us know.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/13767/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/13767/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=13767&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2013/02/blackberry-app-generator-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d0c2b929f8b5acf1cf5659d9c787b19f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">donnyhalliwell</media:title>
		</media:content>
	</item>
		<item>
		<title>Marketing Your App – BlackBerry World Search Optimization</title>
		<link>http://devblog.blackberry.com/2013/01/marketing-your-app-blackberry-world/</link>
		<comments>http://devblog.blackberry.com/2013/01/marketing-your-app-blackberry-world/#comments</comments>
		<pubDate>Fri, 25 Jan 2013 20:47:35 +0000</pubDate>
		<dc:creator>rproudfoot</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[BlackBerry World]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[Discovery]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=13287</guid>
		<description><![CDATA[Here&#8217;s a guest post from Jeff Mayerczak &#8211; Ed. BlackBerry World 4.3 changes the BlackBerry World search algorithm to help make the discovery of your app or game easier for customers. To take advantage of these changes, we wanted to share with you how the following product attributes are prioritized to determine search results. The attributes are [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=13287&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><i>Here&#8217;s a guest post from Jeff Mayerczak &#8211; Ed.</i></p>
<p><a href="http://rimdevblog.files.wordpress.com/2013/01/devblog-appbbworld.png"><img class="aligncenter size-full wp-image-13289" alt="devblog - appbbworld" src="http://rimdevblog.files.wordpress.com/2013/01/devblog-appbbworld-e1359143893695.png?w=600&#038;h=248" width="600" height="248" /></a></p>
<p><a href="http://appworld.blackberry.com/webstore/" target="_blank">BlackBerry World</a> 4.3 changes the BlackBerry World search algorithm to help make the discovery of your app or game easier for customers. To take advantage of these changes, we wanted to share with you how the following product attributes are prioritized to determine search results. The attributes are listed in order of importance to the algorithm:<em></em></p>
<ol>
<li>Product Name</li>
<li>Keywords</li>
<li>Vendor Name</li>
<li>Short Description</li>
</ol>
<p>It is important to note that the Long Description is no longer considered by the Search algorithm.</p>
<p><span id="more-13287"></span></p>
<h3>Product Name</h3>
<p>The most important product attribute is the Product Name &#8211; the title of your application shown to the Consumer. Product Names can be specified by Platform and Language. This could allow you to have:</p>
<ul>
<li>‘Awesome App” for BlackBerry 10</li>
<li>“Awesome App HD” for BlackBerry PlayBook</li>
</ul>
<h3>Keywords</h3>
<p>Keywords are the second most important attribute in determining search results and provide new flexibility and creativity to get your product noticed. Introduced to the <a href="https://appworld.blackberry.com/isvportal" target="_blank">BlackBerry World Vendor Portal</a> in 2012, Keywords will now be used to determine search results. Keywords can be specified by Platform and Language.</p>
<p>Changing the Keywords from the Vendor Portal takes effect between one and nine hours after saving the changes.</p>
<ul>
<li><b>Number of Keywords.  </b>There are up to ten (10) Keywords per Platform and Language pairing.
<ul>
<li>
<address>For example, the BBOS Platform for French has up to 10 Keywords and the BBOS Platform for English has up to 10 keywords</address>
</li>
</ul>
</li>
<li><b>Maximum Length of a Keyword:</b> Each Keyword cannot be more than 100 characters or 3 words long.
<ul>
<li>
<address>For example, “Built For BlackBerry”</address>
</li>
</ul>
</li>
<li><b>Maximum Length of ALL Keywords for a Platform/Language Pair:</b> There is a 1,000 character maximum length for all the Keywords per Platform and Language pair.
<ul>
<li>
<address>For example, the BBOS Platform for French has a 1,000 character maximum and the BBOS Platform for English has a 1,000 character limit.</address>
</li>
</ul>
</li>
<li><b>Term Frequency within Keywords </b>– the number of times a term appears in the keywords increases the relevance.
<ul>
<li>
<address>For example, having “Black” 5 times within the Keywords gives more relevance than having “Black” only once.</address>
</li>
</ul>
</li>
<li><b>Term Proximity</b> – for multiple search terms, say A and B, the keyword where A is closer to B has higher relevance over keywords where A is further from B. For example:
<ul>
<li>
<address>Given:</address>
<ul>
<li>App #1 with Keyword = Built for BlackBerry</li>
<li>App #2 with Keyword = Built for the BlackBerry</li>
<li>Consumer search = “Built BlackBerry”</li>
</ul>
</li>
</ul>
</li>
</ul>
<address>
<ul>
<ul>
<li>Then Search Results:
<ul>
<li>App #1</li>
<li>App #2</li>
</ul>
</li>
</ul>
</ul>
</address>
<ul>
<ul>
<li>
<address>WHY? The number of characters between Built and BlackBerry is less in App #1’s keyword than in App #2’s.</address>
</li>
</ul>
<li><b>Relevance</b> – the keywords must be relevant to the product
<ul>
<li>
<address>Keywords cannot be competitive products or other product names.</address>
</li>
<li>
<address>Keywords cannot be popular terms for the sake of receiving a high hit rate.</address>
</li>
</ul>
</li>
</ul>
<h3>Vendor Name</h3>
<p>The third most important attribute is Vendor Name.</p>
<h3>Short Description</h3>
<p>The least important attribute is Short Description. It is also available by Platform and Language pairing.</p>
<p>Head over to BlackBerry World Vendor Portal and update your app today!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/13287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/13287/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=13287&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2013/01/marketing-your-app-blackberry-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b77ae3f6fe658f08cb49c46119549d9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rproudfoot</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/01/devblog-appbbworld-e1359143893695.png" medium="image">
			<media:title type="html">devblog - appbbworld</media:title>
		</media:content>
	</item>
		<item>
		<title>Have An Issue With Running Your Cascades Release Build?</title>
		<link>http://devblog.blackberry.com/2013/01/cascades-release-build-fix/</link>
		<comments>http://devblog.blackberry.com/2013/01/cascades-release-build-fix/#comments</comments>
		<pubDate>Tue, 22 Jan 2013 20:41:27 +0000</pubDate>
		<dc:creator>Paul Bernhardt</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Native SDK Development]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=12995</guid>
		<description><![CDATA[So you have been developing your Cascades app for a while. Everything is working great! You’re ready to just export the release build, double check that it works, and… oh, no, it’s broken. “PANIC!!!” you might think. Well, luckily you found this blog post. I am going to walk you through the all the steps you [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=12995&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>So you have been developing your Cascades app for a while. Everything is working great! You’re ready to just export the release build, double check that it works, and… oh, no, it’s broken.</p>
<p><b>“PANIC!!!” </b>you might think.</p>
<p>Well, luckily you found this blog post. I am going to walk you through the all the steps you need to get this working, so buckle up and sit tight, because the clock is ticking.</p>
<p><strong>Step one:</strong></p>
<p>Add Q_DECL_EXPORT in front of your main method, so it looks like this:</p>
<pre>Q_DECL_EXPORT <b>int</b> <b>main</b>(<b>int</b> argc, <b>char</b> **argv)</pre>
<p><strong>Step two:</strong></p>
<p>Nope, that’s it.</p>
<p>We added that requirement in the Gold SDK and added it to the template then, so if your project was created afterwards it’s already taken care of.</p>
<p>If you are still having problems, make sure you aren&#8217;t writing to the assets directory, as it’s read-only on release builds. If you want to change something there, copy it to the data folder first.</p>
<p>Anyway, the Q_DECL_EXPORT change was part of <a href="http://devblog.blackberry.com/2012/12/cascades-project-zygote/">Project Zygote</a>, so if you are running into this error you might want to go all the way through the process  and get a big start time decrease for your app. Again, apps built with the Gold SDK have already had this done for them. Don’t let those newbies show you up!</p>
<p>Good luck! We’re almost there!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/12995/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/12995/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=12995&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2013/01/cascades-release-build-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a3bf8c930434e9f401be449eb7ea556?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">paulbe1</media:title>
		</media:content>
	</item>
	</channel>
</rss>
