<?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; Camera API</title>
	<atom:link href="http://devblog.blackberry.com/tag/camera-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.blackberry.com</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 15:08:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='devblog.blackberry.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/9ef0a66c09615fa946c4179662398878?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>BlackBerry Developer Blog &#187; Camera API</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>Getting Rolling with the Camera API</title>
		<link>http://devblog.blackberry.com/2012/07/camera-api/</link>
		<comments>http://devblog.blackberry.com/2012/07/camera-api/#comments</comments>
		<pubDate>Fri, 20 Jul 2012 18:19:21 +0000</pubDate>
		<dc:creator>Paul Bernhardt</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[BlackBerry 10]]></category>
		<category><![CDATA[BlackBerry 10 Dev Alpha]]></category>
		<category><![CDATA[Camera API]]></category>
		<category><![CDATA[sample codeQML]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=10375</guid>
		<description><![CDATA[Troubleshooting the Camera API in the current beta of BlackBerry 10.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=10375&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-10376" title="" src="http://rimdevblog.files.wordpress.com/2012/07/camera.jpg?w=550&#038;h=244" alt="TITLE_IMAGE" width="550" height="244" /></p>
<p>With the release of the BlackBerry® Native SDK Beta 2 comes the Cascades™ Camera API. If you want to see it in action, check out the spiffy Photobomber sample app available in the <a href="https://developer.blackberry.com/cascades/sampleapps/" target="_new">BlackBerry Jam Zone</a> and on <a href="https://github.com/blackberry/Cascades-Samples/tree/master/photobomber" target="_new">GitHub</a>. You can just import it, compile it, install it on your BlackBerry® 10 Dev Alpha and go.</p>
<p>However, there are a couple of set-up gotchas in the current beta you are going to run into if you are just trying to add Camera functionality to your own app. Luckily, they are pretty simple to get past, especially with me here telling you exactly what to do! Let’s quickly run through them.</p>
<p><span id="more-10375"></span></p>
<h3><strong>1. QML Imports</strong></h3>
<p>In your QML file, right underneath the default:</p>
<pre>import bb.cascades 1.0</pre>
<p>you want to also add:</p>
<pre>import bb.cascades.multimedia 1.0</pre>
<p>This will let the QML editor know about the camera components so it doesn’t complain at you.</p>
<h3><strong>2. Include the Camera headers</strong></h3>
<p>This is pretty standard C++ stuff, but don’t forget to also import the headers into your C++ code. In your default app.cpp you will want to import at least this:</p>
<pre>#include &lt;bb/cascades/multimedia/Camera&gt;</pre>
<p>You may also end up needing a few others if you are doing more involved camera work in C++, like this:</p>
<pre>#include &lt;bb/cascades/multimedia/CameraSettings.hpp&gt;</pre>
<pre>#include &lt;bb/cascades/multimedia/CameraTypes.hpp&gt;</pre>
<h3><strong>3. Register the Camera in C++</strong></h3>
<p>In your default app.cpp file, right before the call to:</p>
<pre>	QmlDocument *qml = QmlDocument::create("main.qml");</pre>
<p>Add:</p>
<pre>	bb::cascades::multimedia::Camera::registerQmlTypes();</pre>
<p>If you don’t do this, the Camera components won’t actually get loaded and you’ll get an error. This is also why you imported the Camera header file, if you are doing the rest of the camera work in QML.</p>
<h3><strong>4. Link to the Multimedia Libraries</strong></h3>
<p>Right now the linker isn’t quite set up properly to connect your app to some of the new libraries added in R6. For now, you’ll want to manually open the <code>&lt;appname&gt;.pro </code>file and add the following line:</p>
<pre>LIBS   += -lcamapi -lscreen  -lbbsystem  -lbbcascadesmultimedia –lzxing</pre>
<p>Not all of those are strictly necessary (for example, the zxing library will only be helpful if you want to connect to <a href="http://code.google.com/p/zxing/" target="_New">ZXing</a> to do some custom barcode scanning. We’ll talk about how to do that in a future blog post), but it’s not going to hurt, and the names of the libraries are not terribly discoverable on your own.</p>
<p>You’ll note there is no <code>LIBS</code> line by default in your <code>.pro</code> file. I like to add mine below the <code>CONFIG</code> line, though I’m not sure it really matters.</p>
<h3><strong>5. Done!</strong></h3>
<p>That’s it, you’re all set up! Now you can use the Camera API to your heart’s content. If doing so results in your app taking a lot of pictures, don’t forget you can use the <a href="https://developer.blackberry.com/cascades/reference/bb__system__invokemanager.html" target="_new">Invoke Framework</a> to let your users easily share them. It’s a snap.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/10375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/10375/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=10375&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2012/07/camera-api/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>

		<media:content url="http://rimdevblog.files.wordpress.com/2012/07/camera.jpg" medium="image">
			<media:title type="html">TITLE_IMAGE</media:title>
		</media:content>
	</item>
	</channel>
</rss>
