<?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; memory</title>
	<atom:link href="http://devblog.blackberry.com/tag/memory/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.blackberry.com</link>
	<description></description>
	<lastBuildDate>Tue, 18 Jun 2013 16:50:23 +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; memory</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>Navigate your app more quickly: BlackBerry WebWorks for Smartphones SDK 2.3 released</title>
		<link>http://devblog.blackberry.com/2012/01/blackberry-webworks-2-3-released/</link>
		<comments>http://devblog.blackberry.com/2012/01/blackberry-webworks-2-3-released/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 17:18:04 +0000</pubDate>
		<dc:creator>Ken W</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[BBM 6.1]]></category>
		<category><![CDATA[blackberry webworks]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=8226</guid>
		<description><![CDATA[The newest version of BlackBerry WebWorks for Smartphones - SDK 2.3 - has just been released.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=8226&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The latest version of the BlackBerry® WebWorks™ for Smartphones SDK v2.3 for Microsoft® Windows® and Mac is now <a href="http://developer.blackberry.com/html5/download/sdk" target="_new">available for download</a>. The main focus for this release was to greatly improve performance of applications taking advantage of Navigation Mode for BlackBerry® smartphones with optical trackpads. Navigation mode allows the BlackBerry WebWorks developer to specify which fields in their application should be focusable, and the framework will automatically move focus in the application based on user input from the trackpad. BlackBerry WebWorks developers can take advantage of the speed improvements in Navigation Mode just by recompiling their applications with the new 2.3 SDK.</p>
<p>We included a number of other features in this release that certainly deserve mention. The full list of improvements includes:</p>
<ul>
<li>Navigation mode speed enhancements and bug fixes</li>
<li>BBM™ 6.1 API support</li>
<li>Application Orientation lock (portrait/landscape)</li>
<li>Memory Management enhancements</li>
<li>Native-looking dialogs for selections, date/time, color picker</li>
</ul>
<p><strong>What can I do with the new BBM 6.1 APIs?</strong></p>
<p><span id="more-8226"></span></p>
<p>The BBM APIs for BlackBerry WebWorks have been upgraded to take advantage of the latest changes to the BBM Social Platform in BBM v6.1. The new Settings API allows applications to read BBM options for the application, such as whether the profile box is displayed. Applications can now send fire-and-forget content to contacts for later viewing using the Share Content API. New invocation points have been added for the Application Invoked API. Finally, you can determine which version of your application contacts are running.</p>
<p><strong><span style="color:#ff0000;">Important!</span></strong></p>
<p>Developers using the BBM APIs for BlackBerry WebWorks must be aware of the dependency on the latest BBM 6.1 at runtime. Your end users must have BBM 6.1 installed on their BlackBerry smartphone in order to use BlackBerry WebWorks applications that leverage BBM API capabilities for applications created using v2.3 of the BlackBerry WebWorks SDK. If you do intend on using BBM APIs, you can ensure a positive user experience by implementing a BBM version dependency check. <a href="http://us.blackberry.com/developers/blackberrymessenger/" target="_new">Please go here</a> for more information on developing a BlackBerry WebWorks application leveraging the power of the BBM Social Platform, and managing the BBM version dependency.</p>
<p><strong>So what about those dialogs?</strong></p>
<p>In the process of implementing the improvements to navigation mode, we needed to make some changes to the interface dialogs of the browser used for item selection, date/time selection, and color picker. We figured, why not make these dialogs general purpose and usable by our BlackBerry WebWorks developers in their own applications? Check out the <a href="http://developer.blackberry.com/html5/apis/blackberry.ui.dialog.html" target="_new">updated API reference</a> for more information on these dialogs.</p>
<p><strong>How will your memory be managed better?</strong></p>
<p>In BlackBerry WebWorks for Smartphones SDK v2.2, we introduced a “memory maid” that handled cleaning up after some memory leaks related to callbacks being held by the native Java® layer. The maid would, under certain conditions, trigger a Java garbage collection. In this version, we are fine-tuning the logic the memory maid uses in order to make this process less intrusive to the end user and will result in fewer hourglasses, especially the fairly prevalent one that happens immediately on load of some applications.<br />
Please check out the <a href="http://developer.blackberry.com/html5" target="_new">BlackBerry WebWorks development site</a> to learn more about how you can leverage your web technology skills to build applications for our &gt;70 million smartphone subscribers and BlackBerry® PlayBook™ tablet users.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/8226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/8226/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=8226&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2012/01/blackberry-webworks-2-3-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/3b422c1a037b89d4ddf5bef834dbdeef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kjwallis</media:title>
		</media:content>
	</item>
		<item>
		<title>Super Apps Series (Java): Running in the Background Part Four</title>
		<link>http://devblog.blackberry.com/2010/09/running-in-the-background-part-4/</link>
		<comments>http://devblog.blackberry.com/2010/09/running-in-the-background-part-4/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 10:42:20 +0000</pubDate>
		<dc:creator>Tim W.</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Java Development]]></category>
		<category><![CDATA[apis]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[super apps]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=2122</guid>
		<description><![CDATA[BlackBerry Development Super Apps (Java) Series part four. “Dos and don’ts” of running applications in the background.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=2122&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><img src="http://rimdevblog.files.wordpress.com/2010/09/backgroundpart4-browser1.jpg?w=480&#038;h=360" alt="" title="Running in the Background Part 4" width="480" height="360" class="aligncenter size-full wp-image-2123" /></p>
<p>In the course of this series on running in the background, we’ve covered how to run a process in the background (<a href="http://rimdevblog.files.wordpress.com/2010/09/backgroundpart4-list1.jpg2010/06/super-apps-java-series-running-in-the-background-part-1/">Part One</a>), how to move your application from foreground to background and vice versa (<a href="http://rimdevblog.files.wordpress.com/2010/09/backgroundpart4-list1.jpg2010/06/running-in-the-background-part-2/">Part Two</a>), and some of the reasons why you would want to (<a href="http://rimdevblog.files.wordpress.com/2010/09/backgroundpart4-list1.jpg2010/07/running-in-the-background-part-three/" target="_new">Part Three</a>). The previous articles have shown Super App features that enable both the “Always-on Experience” and “Tight Integration with the Native Apps”, as well as a “Proactive and Notification-driven Application”. Today, the focus will be on “Designing for Efficiency”.</p>
<p>In some ways, the mobile environment is constrained much more significantly than the desktop environment, with limits to battery life, wireless bandwidth, memory, and CPU cycles, among others. These constraints become even more important when running processes in the background. The last thing the user wants is a massive data bill, or a dead device due to a poorly behaved background application that they weren’t even aware of. With that said, let’s look at the “dos and don’ts” of running in the background.</p>
<p><span id="more-2122"></span></p>
<h2>Stop Painting</h2>
<p></p>
<p>If you have any looped painting, animations, or other UI processes on your screen, stop them when your application moves to the background. Verify that you don’t have UI threads running needlessly by using the Profiler view in the BlackBerry® Java® Plug-in for Eclipse®.</p>
<p><img src="http://rimdevblog.files.wordpress.com/2010/09/backgroundpart4-list1.jpg?w=600&#038;h=267" alt="" title="BlackBerry background processes" width="600" height="267" class="aligncenter size-full wp-image-2126" /></p>
<p></p>
<h2>Minimize Processing</h2>
<p></p>
<p>As in checking for painting threads, use the Profiler to ensure that you don’t have threads running that aren’t actually necessary. A careful balance must be maintained here; if you perform an action in your application that may take some time, the application will expect it to continue even if you go to another application in the meantime. Similarly, if your application is expected to do tasks in the background &#8211; such as downloading music or tracking GPS coordinates &#8211; then processing can’t be avoided. However, battery life will be greatly enhanced if your application does this processing all at once, with periods of full idleness in between processing blocks. Ensure that your processing is not spread out over a long period of time, and the device will be able to go to a low-power sleep mode.</p>
<h2>Be Aware of the Device Context</h2>
<p></p>
<p>Before your application runs a background process, check the status of the device to determine if it is an appropriate time, or to optimize the task itself. Check the Idle Time using DeviceInfo.getIdleTime() and Backlight.isEnabled() to determine if you are currently using the device. Heavy processing should be done when the device is idle in order to avoid an impact to the user.</p>
<p>If the task your application intends to do is lengthy, ensure that there is adequate battery power available, or wait until the device is connected to a charging source. The DeviceInfo.getBatteryLevel() API will return the percentage of remaining battery, while DeviceInfo.getBatteryStatus() &amp; DeviceInfo.BSTAT_CHARGING &gt;0 will determine if the battery is currently charging. Applications should not keep the backlight on unless the device is connected to a charger, or if the screen display is critical to the application. For example, navigation apps should shut off the backlight when not powered by a car charger, while a video player should enable the backlight while the video is playing but not when it finishes.</p>
<p>Finally, check the network coverage available if you need to make a network connection, or the GPS satellite coverage if you intend to use GPS. If coverage is poor, then it will take more power to use the radio, or it may be more effective to wait until coverage is better. In the case of network communication, it may be more effective to download a smaller, lower quality set of data immediately and wait until WiFi® coverage is available, or to sideload large data through USB. For GPS, cell site location will provide approximate location with very low power use almost instantaneously while waiting for a more accurate GPS satellite fix to occur. The BlackBerry location object can provide information on the number of satellites visible to determine the effectiveness of getting a satellite fix. Likewise, the RadioInfo.getSignalLevel() API will tell you how strong the signal is, and the CoverageInfo.isCoverageSufficient() or TransportInfo.hasSufficientCoverage() methods will tell you if a connection is possible through the transport that you require.</p>
<h2>Free Memory</h2>
<p></p>
<p>Dropping references to stale objects is important when your application is long-lived. Objects should be released when no longer needed, but not too aggressively. Since object creation is costly, you don’t want to churn through objects if you will need them again, so there is a balance to find here. For example, your application should not usually release screens it has on the stack immediately upon going to the background. If you switch back to your application, you do not want to wait for the screen to be recreated. However, if the screen contains information from an external source, that data structure could be released when it’s no longer current and refreshed when you return.</p>
<p>Running in the background is a pillar of the Super Apps concept, and with so many Super App features enabled by background processing, it’s critical to remember to “Design for Efficiency”. You’ll earn the gratitude of your users – and they will enthusiastically recommend your app to their friends and colleagues!</p>
<p>Have you tried integrating any of these tips into your Super Apps designs?  Let us know in the comments.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/2122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/2122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=2122&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2010/09/running-in-the-background-part-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/ebfb4d0e6ef9442e0abc42125ab51117?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">timwin1</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2010/09/backgroundpart4-browser1.jpg" medium="image">
			<media:title type="html">Running in the Background Part 4</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2010/09/backgroundpart4-list1.jpg" medium="image">
			<media:title type="html">BlackBerry background processes</media:title>
		</media:content>
	</item>
	</channel>
</rss>
