<?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/"
	>

<channel>
	<title>Developer World &#187; applications</title>
	<atom:link href="http://developer.sonyericsson.com/wp/tag/applications/feed/" rel="self" type="application/rss+xml" />
	<link>http://developer.sonyericsson.com/wp</link>
	<description>Sony Ericsson Developer World</description>
	<lastBuildDate>Wed, 08 Feb 2012 21:32:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Getting started with Timescape™ extensions</title>
		<link>http://developer.sonyericsson.com/wp/2011/11/07/getting-started-with-timescape-extensions/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-timescape-extensions</link>
		<comments>http://developer.sonyericsson.com/wp/2011/11/07/getting-started-with-timescape-extensions/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 19:20:49 +0000</pubDate>
		<dc:creator>Joe Padre</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ADT]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[android development]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[edk]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[music player]]></category>
		<category><![CDATA[sony ericsson]]></category>
		<category><![CDATA[timescape]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://developer.sonyericsson.com/wp/?p=4404</guid>
		<description><![CDATA[Ready to take your Android™ development one step further? Do you want your app to get visible to thousands of Sony Ericsson phones? Haven’t checked out the Timescape™ developer section yet? If so, then follow along with Sony Ericsson Software Engineer, Robert Helmbro, as he’s provided this step-by-step tutorial for developing your own Timescape™ extension. [...]]]></description>
			<content:encoded><![CDATA[<p>Ready to take your Android™ development one step further? Do you want your app to get visible to thousands of Sony Ericsson phones? Haven’t checked out the Timescape™ developer section yet? If so, then follow along with Sony Ericsson Software Engineer, Robert Helmbro, as he’s provided this step-by-step tutorial for developing your own Timescape™ extension.</p>
<p>Read more after the jump.</p>
<p><span id="more-4404"></span></p>
<p>Over the past few months, we’ve been giving you some important information and tools to help you learn about Timescape™ extensions, including articles on how to <a title="Developing Timescape extensions" href="http://developer.sonyericsson.com/wp/2011/02/13/timescape-extensions/?comment_order=latestfirst" target="_blank">develop Timescape™ extensions</a> and <a title="Creating Timescape and music extensions with the EDK" href="http://developer.sonyericsson.com/wp/2011/07/13/create-timescape%E2%84%A2-and-music-player-extensions-with-the-new-edk-v-1-1/" target="_blank">use the Extension Development Kit</a>, along with special sections on Developer Word dedicated to <a title="Timescape Extensions developer page" href="http://developer.sonyericsson.com/wportal/devworld/technology/android/edk/timescape-extensions?cc=gb&amp;lc=en" target="_blank">Timescape extensions</a> and the <a title="Extension Development Kit developer page" href="http://developer.sonyericsson.com/wportal/devworld/technology/android/edk/overview?cc=gb&amp;lc=en" target="_blank">Extension Development Kit</a> (EDK). In case you missed all of this, you will get a new chance now as Robert Helmbro will guide you in how to create your very own Timescape™ extension – an excellent way to get visibility in Sony Ericsson phones. </p>
<p>Starting with the 2011 Xperia™ phones and the updated software on the Xperia™ X10, you’ll be able to develop your own extensions for the Timescape™ application, Sony Ericsson’s unique feature that displays Facebook™, Twitter™, text messages, e-mails and alerts from your contacts as a flowing column on the home screen. And to help you develop your own Timescape™ app extension, we’ve got the Extension Development Kit (EDK) that includes all the necessary tools and documentation.</p>
<div id="attachment_4409" class="wp-caption alignnone" style="width: 185px"><a href="http://developer.sonyericsson.com/wp/2011/11/07/getting-started-with-timescape-extensions/robert_helmbro/" rel="attachment wp-att-4409"><img class="size-full wp-image-4409" src="http://developer.sonyericsson.com/wp/files/2011/11/robert_helmbro.jpg" alt="Robert Helmbro" width="175" height="200" /></a><p class="wp-caption-text">Robert Helmbro, Software Engineer at Sony Ericsson</p></div>
<p>If you already have a bit of Android™ development knowledge, you’ll find it fairly easy to create your own Timescape™ extensions. If you’re still a bit new to Android™ development, no worries, just familiarise yourself first with the Android development documentation mentioned below.</p>
<p><strong>What is a</strong> <strong>Timescape™ extension?</strong></p>
<p>For those of you who are new to the Timescape™ world, a Timescape™ extension is an Android™ application that provides Timescape™ connected UIs with content through a specified API.</p>
<p>The API is called Event Stream API, which can be thought of as a database of time-centric content. The extensions put content into the database. Then the visualisation application, such as the Timescape™ application, Infinite view or Timescape™-widget, presents the content to the user in an integrated way.</p>
<p><a href="http://developer.sonyericsson.com/wp/2011/11/07/getting-started-with-timescape-extensions/timescape/" rel="attachment wp-att-4412"><img class="alignnone size-full wp-image-4412" src="http://developer.sonyericsson.com/wp/files/2011/11/Timescape.jpg" alt="Timescape application" width="270" height="485" /></a></p>
<p><strong>Prerequisites for creating a Timescape™ extension</strong></p>
<p>You should have basic knowledge about <a title="Android Developer Resource page" href="http://developer.android.com/index.html." target="_blank">Android™ application development</a>. Such things as intents, broadcast events and content providers are central concepts in extension development. It is also assumed that Eclipse with the Android development tools (ADT) plug-in is up and running.</p>
<p><strong>Documentation and sample code</strong></p>
<p>Now, let’s get to the heart of this tutorial. First, download some documentation and code examples. This is, and more information about it, is available from the <a title="EDK developer page" href="http://developer.sonyericsson.com/wportal/devworld/technology/android/edk/overview?cc=gb&amp;lc=en" target="_blank">EDK developer section</a> on Developer World. Download the <a title="Timescape application code examples" href="http://developer.sonyericsson.com/wportal/devworld/downloads/download/timescapeextcodeexanddocsv11?cc=gb&amp;lc=en" target="_blank">Timescape™ code examples</a> and documentation to get started. Once you’ve extracted the zip file, you’ll find the following content:</p>
<ul>
<li><em>RSSExtension</em> – A sample extension with some attached documentation, intended for RSS type of extensions.</li>
<li><em>SocialNetworkSample</em> – A sample extension with some attached documentation. This sample is made to give an example of how a social network example can be made.</li>
<li><em>SampleExtension</em> – A sample extension with some attached documentation.</li>
<li><em>EventStream_API.zip</em> – Javadocs for the Event Stream API.</li>
<li><em>Introduction_Timescape_extensions.pdf</em> – Contains some basic information.</li>
<li><em>SEMC_Xperia_Events_overview.pdf</em> – Documentation about the visualisation application Xperia™ Events.</li>
<li><em>Timescape_icon_design_guideline.pdf</em> – Guidelines about icons needed in an extension.</li>
</ul>
<p>A good starting point is to read the Javadoc for the Event Stream API. Extract the EventStream_API.zip. Go to the EventStream_API folder and open the index.html file in your favourite browser. Read carefully about the EventStream class. This will give you a good overview of how Timescape™ extensions work.</p>
<p><strong>Downloading the Extension Development Kit</strong></p>
<p>You are now probably excited for some hands on programming. Maybe you’re ready to look at the sample extensions and start modifying the code to try out your ideas, but hang on a little while longer.</p>
<p>As mentioned before, Sony Ericsson has created the <a title="Extension Development Kit overview" href="http://developer.sonyericsson.com/wportal/devworld/technology/android/edk/overview?cc=gb&amp;lc=en">Extension Development Kit (EDK)</a> that can be used while developing extensions. The EDK consists of an emulator add-on containing, among other things, the Event Stream API and two visualization applications – Xperia™ Events and Infinite view. You can find out more about these applications later in the text. To install the EDK and create an Android Virtual Device (AVD), follow the “Installing the EDK” instructions on the <a title="EDK developer page" href="http://developer.sonyericsson.com/wportal/devworld/technology/android/edk/overview?cc=gb&amp;lc=en">EDK developer section</a>.</p>
<p>You should now be able to start an emulator with your newly created configuration (AVD) by following the steps below:</p>
<ol>
<li>In Eclipse, press <strong>Window &gt; Android SDK and AVD Manager</strong>.</li>
<li>Select your new AVD and press <strong>Start</strong>.</li>
<li>Wait for the emulator to boot up and then scroll the main menu and you will find the application Xperia™ Events.</li>
</ol>
<p>Xperia™ Events is a tool for testing Timescape™ extensions. Events are shown in a similar way as they will be shown on a real device. Now launch Xperia™ Events. You will only see an almost empty screen, since there are no extensions installed yet.</p>
<p><a href="http://developer.sonyericsson.com/wp/2011/11/07/getting-started-with-timescape-extensions/emulatorwithxperiaevents/" rel="attachment wp-att-4413"><img class="alignnone size-full wp-image-4413" src="http://developer.sonyericsson.com/wp/files/2011/11/EmulatorwithXperiaEvents.jpg" alt="Emulator with Xperia Events" width="560" height="479" /></a> </p>
<p> <strong>Using the Social network sample extension</strong></p>
<p>In order to fill Xperia™ Events with some content, let’s try out the Social network sample extension.</p>
<ol>
<li>Browse to the <em>SocialNetworkSample</em> folder from EdkSnsSampleApp1.zip.</li>
<li>Create an Android project in Eclipse: <strong>File &gt; New &gt; Project&#8230; &gt; Android &gt; Android Project</strong>.</li>
<li>Set the <em>&#8216;Create project from existing source&#8217;</em> checkbox and navigate to your recently extracted folder containing <em>SocialNetworkSample</em>.</li>
<li>Check <em>EDK 1.1</em> as <em>Build Target</em> and press <em>Finish</em>.</li>
<li>Install the SocialNetworkSample to the emulator by right clicking the newly created project and press <strong>Run As &gt; Android Application</strong>.</li>
</ol>
<p>Now launch <em>Xperia™ Events</em> in the emulator again. A new tab should be present. Follow these steps: </p>
<ol>
<li>Press the new tab and then press <em>Add account</em>.</li>
<li>Press <em>&#8216;SNS Sample extension – Register your account information&#8217;</em>. Enter any user name and password you like and press <em>Sign In</em>.</li>
<li>Press back to see the dummy stream of events generated by the extension.</li>
</ol>
<p>Try to press an event to see the detail view of it. At the bottom of the screen, it is possible to scroll all data in the database for this event entry. This is really useful when developing extensions. Also try to press the <strong>Infinite icon</strong> at the top right corner. What you should see now is the Infinite view. Infinite view is the detailed view of a contact. This shows everything related to the selected contact collected. For example, your extension gets its own tab with all events from the current friend.</p>
<p><strong>Time for coding</strong></p>
<p>Similar procedures could be done with the RSSExtension and SampleExtension. Some documentation is attached to all sample extensions. If you would like to create your own extension by modifying one of the sample extensions, I would recommend selecting the RSSExtension since it is most complete.</p>
<p>Hopefully, this has given you enough information for you to start a prototype of your own extension. When you’re ready, <a title="EDK download page" href="http://developer.sonyericsson.com/wportal/devworld/downloads/download/timescapeextensiondevelopmentkitalltoolsanddocumentation?cc=gb&amp;lc=en" target="_blank">download the EDK</a> and give it a go. If you have any questions, just post them in the <a title="Sony Ericsson EDK Google Groups developer thread" href="http://groups.google.com/group/android-developers/browse_thread/thread/8b3bf9a94628543d?pli=1" target="_blank">EDK thread</a> on Google groups, which we will monitor and get back with answers as soon as possible. Happy coding!</p>
<p><strong>More information</strong></p>
<ul>
<li>Learn more about <a title="Timescape Extensions developer page" href="http://developer.sonyericsson.com/wportal/devworld/technology/android/edk/timescape-extensions?cc=gb&amp;lc=en" target="_blank">Timescape extensions</a>.<strong></strong></li>
<li>Download the <a title="EDK download page" href="http://developer.sonyericsson.com/wportal/devworld/downloads/download/timescapeextensiondevelopmentkitalltoolsanddocumentation?cc=gb&amp;lc=en" target="_blank">Sony Ericsson EDK</a>.<strong></strong></li>
<li>Download the <a title="Timescape extensions code examples and documentation kit" href="http://developer.sonyericsson.com/wportal/devworld/downloads/download/timescapeextcodeexanddocsv11?cc=gb&amp;lc=en" target="_blank">Timescape™ extensions code example &amp; documentation kit</a>.<strong></strong></li>
<li>Get an overview of the <a title="Extension Development Kit developer page" href="http://developer.sonyericsson.com/wportal/devworld/technology/android/edk/overview?cc=gb&amp;lc=en" target="_blank">Sony Ericsson EDK</a>.<strong></strong></li>
<li>Ask a question though the <a title="Sony Ericsson EDK Google groups thread" href="http://groups.google.com/group/android-developers/browse_thread/thread/8b3bf9a94628543d?pli=1" target="_blank">EDK thread</a> on Google groups<strong></strong></li>
<li>Check out the <a title="EDK Frequently Asked Questions" href="http://developer.sonyericsson.com/wportal/devworld/technology/android/edk/faq?cc=gb&amp;lc=en" target="_blank">EDK Frequently Asked Questions</a>.<strong></strong></li>
<li>Read more about <a title="Android Developer Resources page" href="http://developer.android.com/index.html." target="_blank">Android application development</a>.<strong></strong></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://developer.sonyericsson.com/wp/2011/11/07/getting-started-with-timescape-extensions/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Use the multiple APK support in Android Market</title>
		<link>http://developer.sonyericsson.com/wp/2011/10/11/use-the-multiple-apk-support-in-android-market/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-the-multiple-apk-support-in-android-market</link>
		<comments>http://developer.sonyericsson.com/wp/2011/10/11/use-the-multiple-apk-support-in-android-market/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 18:01:02 +0000</pubDate>
		<dc:creator>Joe Padre</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[android development]]></category>
		<category><![CDATA[Android Market]]></category>
		<category><![CDATA[APK]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[multiple APKs]]></category>
		<category><![CDATA[publishing]]></category>
		<category><![CDATA[sony ericsson]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Xperia]]></category>

		<guid isPermaLink="false">http://developer.sonyericsson.com/wp/?p=4175</guid>
		<description><![CDATA[Google recently announced multiple APK support in Android Market™, which allows you to upload multiple versions of an APK for a single product listing, instead of having to upload a single APK file for every version of your product. We got the lowdown from Anupam Nath, a Developer Support Engineer at Sony Ericsson, who explains [...]]]></description>
			<content:encoded><![CDATA[<p>Google recently announced multiple APK support in Android Market™, which allows you to upload multiple versions of an APK for a single product listing, instead of having to upload a single APK file for every version of your product. We got the lowdown from Anupam Nath, a Developer Support Engineer at Sony Ericsson, who explains in more detail about how this new feature can help solve some of your issues when publishing your app on Android Market™. See more after the jump.</p>
<p><span id="more-4175"></span></p>
<div id="attachment_4204" class="wp-caption alignnone" style="width: 185px"><a href="http://developer.sonyericsson.com/wp/2011/10/11/use-the-multiple-apk-support-in-android-market/anupam_nath_175x200/" rel="attachment wp-att-4204"><img class="size-full wp-image-4204" src="http://developer.sonyericsson.com/wp/files/2011/10/anupam_nath_175x200.jpg" alt="Anupam Nath" width="175" height="200" /></a><p class="wp-caption-text">Anupam Nath</p></div>
<p>Back at Google I/O, Google had announced plans to add several capabilities to help developers manage their products more effectively on Android Market™. In particular, a very helpful publishing option – multiple APK support – is now available. With multiple APK support, you can have different versions of an APK file under the same product listing. The APKs file versions are completely independent APKs that share the same product name, but contain code and resources targeted for your particular set of customers. </p>
<p>This feature also resolves some of the questions and comments we frequently get from developers, such as:</p>
<ul>
<li><em>Can we use an SDK lower than 2.3 and still support Xperia™ PLAY (which runs on Android™ 2.3)?</em></li>
<li><em>We want to create high graphics textures for Xperia™ PLAY but other devices don’t support it and we don’t want to upload a separate application on Android Market™. What should we do?</em> </li>
</ul>
<p>The multiple APK support option helps you manage all the above tasks without uploading a separate application to Android Market™ with a different package name for Xperia™ PLAY, or other specific devices. Leverage this feature to support various devices (such as phones and tablets), Android platform versions, or screen sizes, all while keeping the application builds inside the same package and product name.</p>
<p><strong>Setting up Multiple APKs</strong> </p>
<p>If you’re new to publishing on Android Market™, I’d recommended first going over the <a title="Preparing to Publish checklist - Android Developers reference" href="http://developer.android.com/guide/publishing/preparing.html" target="_blank">Preparing to Publish checklist</a> and <a title="Publishing topic on Android Developers reference" href="http://developer.android.com/guide/publishing/publishing.html" target="_blank">publishing on Android Market</a> page on the Android Developers reference site to understand what you need to do if you plan to publish your application. Also review the <a title="Publishing concepts - Android Developers reference" href="http://developer.android.com/guide/market/publishing/multiple-apks.html" target="_blank">publishing concepts for Android Developers</a>. Here you’ll find a good explanation on key concepts regarding how the Android Market publisher site works, including descriptions on active APKs, simple mode versus advanced mode and the difference between “publish” and “save”. Most importantly, this page explains exactly how multiple APKs work.</p>
<p>Once you’ve made the decision to use multiple APKs on Android Market™, take the following facts into consideration:</p>
<ul>
<li>You will have just one entry in Android Market™ for your application, and different devices might download a different APK.</li>
<li>You maintain one set of product details (app description, icons, screenshots, etc.). This also means you <em>cannot</em> charge different prices for different APKs.</li>
<li>All users see only one version of your application on Android Market™.</li>
<li>If you publish different APKs for different versions of Android, then when a user’s device receives a system update that qualifies them for a different APK you’ve published, Android Market™ automatically updates the user’s application to the appropriate APK.</li>
</ul>
<p><strong>Publishing multiple APKs</strong></p>
<p>Assuming you’ve already prepared your application for publishing (including signing and versioning your application), you should be ready to publish on Android Market.</p>
<p>To activate multiple APK in the Developer console for Android Market, ensure you have the following settings:</p>
<p>1. In the <strong>Product details</strong> tab of <strong>Edit Application</strong> screen, an <strong>Upload new APK</strong> window opens when you first begin uploading your software. Click the <strong>Choose file</strong> button to navigate to and select the APK file.<a href="http://developer.sonyericsson.com/wp/2011/10/11/use-the-multiple-apk-support-in-android-market/multiapks_1/" rel="attachment wp-att-4181"><img class="alignnone size-large wp-image-4181" src="http://developer.sonyericsson.com/wp/files/2011/10/MultiAPKs_1-590x337.jpg" alt="Multiple APK support - screenshot example #1" width="590" height="337" /></a></p>
<p>2. When your APK file is uploaded, click the <strong>Save</strong> button.<a href="http://developer.sonyericsson.com/wp/2011/10/11/use-the-multiple-apk-support-in-android-market/multiapks_2/" rel="attachment wp-att-4184"><img class="alignnone size-large wp-image-4184" src="http://developer.sonyericsson.com/wp/files/2011/10/MultiAPKs_2-590x303.jpg" alt="Multiple APK support - screenshot example #2" width="590" height="303" /></a></p>
<p>3. Go to the <strong>APK files</strong> tab of the <strong>Edit Application</strong> screen. <img src="http://developer.sonyericsson.com/wp/files/2011/10/MultiAPKs_3-590x423.jpg" alt="Multiple APK support - screenshot example #3" width="590" height="423" /></p>
<p>4. Click <strong>Switch to advanced mode</strong>.</p>
<p> <img class="alignnone" src="http://developer.sonyericsson.com/wp/files/2011/10/MultiAPKs_4-590x305.jpg" alt="Multiple APK support - screenshot example #4" width="590" height="305" /></p>
<p>5. Click the <strong>Upload APK</strong> button and select the additional versions of the APK file to add. Select the <strong>Activate</strong> link to activate the APK.</p>
<p><img class="alignnone size-large wp-image-4189" src="http://developer.sonyericsson.com/wp/files/2011/10/MultiAPKs_5-590x357.jpg" alt="Multiple APK support - screenshot example #5" width="590" height="357" /></p>
<p>6. When you are finished adding all the versions of your APK files for your application, click the <strong>Publish</strong> button to publish the APK files to Android Market™, or click the <strong>Save</strong> button to save your files.</p>
<p>The description circled below indicates which devices running a particular version of Android (in this case, API level 10 or 8-10) will be able to download this APK. The information shown in the description is automatically extracted from the manifest file.</p>
<p><a href="http://developer.sonyericsson.com/wp/2011/10/11/use-the-multiple-apk-support-in-android-market/multiapks_6/" rel="attachment wp-att-4190"><img class="alignnone size-large wp-image-4190" src="http://developer.sonyericsson.com/wp/files/2011/10/MultiAPKs_6-590x341.jpg" alt="Multiple APK support - screenshot example #6" width="590" height="341" /></a></p>
<p><strong>Let us know&#8230;</strong></p>
<p>We hope you take full advantage of the publishing options that the multiple APK support feature provides. If you have any questions, let us know through the Comments link at the end of this post.</p>
<p><strong>More information</strong></p>
<ul>
<li>Learn about <a title="Multiple APK support topic - Android Developers resource" href="http://developer.android.com/guide/market/publishing/multiple-apks.html" target="_blank">multiple APK support</a> in detail on the Android Developers site.</li>
<li>Review the <a title="Preparing to publish topic - Android Developers resource site" href="http://developer.android.com/guide/publishing/preparing.html" target="_blank">Preparing to Publish checklist</a> and <a title="Publishing topic - Android Developers resource site" href="http://developer.android.com/guide/publishing/publishing.html" target="_blank">publishing on Android Market</a> page on the Android Developers site.</li>
<li>Read about multiple APK support on the <a title="Android Developers Blog" href="http://android-developers.blogspot.com/2011/07/multiple-apk-support-in-android-market.html" target="_blank">Android Developers Blog</a>.</li>
<li>Get familar with our <a title="Xperia game developer recommendations" href="http://developer.sonyericsson.com/wportal/devworld/technology/android/xperiaplay/game-developer-recommendations?cc=gb&amp;lc=en" target="_blank">Xperia<sup>TM</sup> game developer recommendations</a>.</li>
<li>Check out all of our <a title="Xperia game developer tips and tutorials" href="http://developer.sonyericsson.com/wp/tag/tutorial/" target="_blank">game developer tips and tutorials</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://developer.sonyericsson.com/wp/2011/10/11/use-the-multiple-apk-support-in-android-market/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ericsson kick-starts EAA 2012 with mini-challenge</title>
		<link>http://developer.sonyericsson.com/wp/2011/08/29/ericsson-kick-starts-eaa-2012-with-mini-challenge/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ericsson-kick-starts-eaa-2012-with-mini-challenge</link>
		<comments>http://developer.sonyericsson.com/wp/2011/08/29/ericsson-kick-starts-eaa-2012-with-mini-challenge/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 17:16:27 +0000</pubDate>
		<dc:creator>Joe Padre</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[EAA]]></category>
		<category><![CDATA[ericsson]]></category>
		<category><![CDATA[ericsson application awards]]></category>
		<category><![CDATA[mobile application]]></category>
		<category><![CDATA[promotion]]></category>
		<category><![CDATA[sony ericsson]]></category>

		<guid isPermaLink="false">http://blogs.sonyericsson.com/wp/?p=3791</guid>
		<description><![CDATA[Developers, are you up for a challenge? We’re proud to team up with Ericsson to co-sponsor this year’s Ericsson Application Awards (EAA), and we’re very excited to announce the first mini-challenge for EAA 2012, which starts September 14. By taking part in the EAA competitions, developers have a unique opportunity to gain exposure within the [...]]]></description>
			<content:encoded><![CDATA[<p>Developers, are you up for a challenge? We’re proud to team up with Ericsson to co-sponsor this year’s Ericsson Application Awards (EAA), and we’re very excited to announce the first mini-challenge for EAA 2012, which starts September 14. By taking part in the EAA competitions, developers have a unique opportunity to gain exposure within the telecommunications world, as well as a chance to reach out to customers through Ericsson’s marketing channels, PLUS the opportunity to win Sony Ericsson phones and €15,000 in prize money.</p>
<p><span id="more-3791"></span></p>
<p><a href="http://blogs.sonyericsson.com/wp/2011/08/29/ericsson-kick-starts-eaa-2012-with-mini-challenge/eaapicture2_590x396/" rel="attachment wp-att-3797"><img class="alignnone size-medium wp-image-3797" src="http://blogs.sonyericsson.com/wp/files/2011/08/EAAPicture2_590x396-425x285.jpg" alt="Ericsson Application Awards 2011" width="425" height="285" /></a></p>
<p>The winning team from last year, Team HipSnip, has already benefitted from the EAA spotlight, as they have been able to secure angel funding for their business. You can read about their inspirational journey in <a title="Ericsson Application Awards guest blog" href="http://www.ericssonapplicationawards.com/team/blog/guest-bloggers-eaa2011-winners-team-hipsnip" target="_blank">this article on the EAA guest blogger site</a>. Now that the doors for success have opened up for Team HipSnip, are you ready for your turn? If you are up to the challenge, take part in the first mini-challenge, which begins September 14. Learn how to get started <a title="Ericsson Application Awards 2012 - Getting started" href="http://www.ericssonapplicationawards.com/getting-started" target="_blank">here</a>.</p>
<p><strong>More information</strong></p>
<ul>
<li>Watch this short <a title="Ericsson Application Awards 2012 Official Launch video" href="http://www.youtube.com/watch?v=bXs_JA3tX3A" target="_blank">message from Tommy Arngren</a>, our fellow blogger from Ericsson.</li>
<li>Get yourself started in the <a title="Ericsson Application Awards 2012 - Getting Started" href="http://www.ericssonapplicationawards.com/getting-started">Ericsson Application Awards 2012</a>.</li>
<li>Read about EAA 2011 winners <a title="Ericsson Application Awards Guest Blog - Team HipSnip" href="http://www.ericssonapplicationawards.com/team/blog/guest-bloggers-eaa2011-winners-team-hipsnip">Team HipSnip</a>.</li>
<li>Check out the latest EAA news and stories at <a title="Ericsson Application Awards - Tommy's blog" href="http://www.ericssonapplicationawards.com/blogs/tommy-0">Tommy’s EAA blog</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://developer.sonyericsson.com/wp/2011/08/29/ericsson-kick-starts-eaa-2012-with-mini-challenge/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to take advantage of the pinch-to-zoom feature in your Xperia™ X10 apps &#8211; Part 2</title>
		<link>http://developer.sonyericsson.com/wp/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%e2%84%a2-10-apps-part-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%25e2%2584%25a2-10-apps-part-2</link>
		<comments>http://developer.sonyericsson.com/wp/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%e2%84%a2-10-apps-part-2/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 20:02:54 +0000</pubDate>
		<dc:creator>Ed Ort</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[x10]]></category>
		<category><![CDATA[xperia x10]]></category>
		<category><![CDATA[Zoom]]></category>

		<guid isPermaLink="false">http://blogs.sonyericsson.com/developerworld/?p=2149</guid>
		<description><![CDATA[Recently Sony Ericsson rolled out an update to the Android™ 2.1 operating system in its Xperia™ X10 phones. One of the important new features in the update is support for a multi-touch gesture called pinch-to-zoom. The first part of this two-part tutorial showed how to take advantage of the pinch-to-zoom feature in your apps. In [...]]]></description>
			<content:encoded><![CDATA[<p>Recently Sony Ericsson rolled out an update to the Android™ 2.1 operating system in its Xperia™ X10 phones. One of the important new features in the update is support for a multi-touch gesture called pinch-to-zoom. The <a title="Pinch to zoom feature in Xperia X10 tutorial - Part 1" href="http://blogs.sonyericsson.com/developerworld/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%e2%84%a2-10-apps-part-1/" target="_blank">first part of this two-part tutorial </a>showed how to take advantage of the pinch-to-zoom feature in your apps. In this second part of the tutorial, you’ll examine a code example that uses the pinch-to-zoom feature.<br />
<span id="more-2149"></span></p>
<p><strong>A pinch-to-zoom code example</strong></p>
<p>Now that we’ve looked at some of the basics of implementing pinch-to-zoom, let’s examine a pinch-to-zoom listener class named PinchZoomListener that puts those basics into action. The PinchZoomListener class is part of a project which you can download and use to build the application.</p>
<p><a title="Pinch to zoom sample project download" href="http://developer.sonyericsson.com/wportal/devworld/downloads/download/xperiax10pinchzoomcodeexampleszip?cc=gb&amp;lc=en" target="_blank">Download the pinch-to-zoom sample project (0.66 MB)</a></p>
<p>Remember that the application can recognize and process pinch-to-zoom gestures in Xperia™ X10 only if you install the pinch-to-zoom support in the device.</p>
<p><strong>Implementing the OnTouchListener interface</strong></p>
<p>The first thing to notice about PinchZoomListener is that it implements the View.OnTouchListener interface. This is indicated in the class definition, as shown below.</p>
<pre>public class PinchZoomListener implements View.OnTouchListener {

    …

{</pre>
<p>By implementing the View.OnTouchListener interface, PinchZoomListener is invoked when a user touches the screen.</p>
<p><strong>Registering the listener</strong></p>
<p>Remember that the listener needs to be registered by an activity. In the application, it is registered in an activity class, TutorialZoomActivity4, as follows:</p>
<pre>import com.sonyericsson.zoom.ImageZoomView;
import com.sonyericsson.zoom.PinchZoomListener;
import android.view.View;

public class TutorialZoomActivity4 extends Activity {

private ImageZoomView mZoomView;
private PinchZoomListener mPinchZoomListener;

   @Override
      public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);  

         mPinchZoomListener = new PinchZoomListener(getApplicationContext());
         mZoomView.setOnTouchListener(mPinchZoomListener);
         …
      }</pre>
<p>Notice the use of the ImageZoomView class. This class provides a View that is capable of drawing an image at different zoom levels. The ImageZoomControl class is explained in <a title="One finger zoom tutorial" href="http://blogs.sonyericsson.com/developerworld/2010/05/18/android-one-finger-zoom-tutorial-part-1/" target="_blank">Android one finger zoom tutorial- Part 1 that was published earlier in this blog</a>.</p>
<p>If you’re familiar with the one finger zoom sample project that accompanies the Android one finger zoom tutorial, you’ll notice that the pinch-to-zoom sample is architected quite similarly to the one finger zoom application. The major difference is the addition of the PinchZoomListener.</p>
<p><strong>Defining listener modes</strong></p>
<p>The next thing to notice in PinchZoomListener is that it defines three listener modes, each indicating a touch state. Here is the definition:</p>
<pre>private enum Mode {
    UNDEFINED, PAN, PINCHZOOM
}

private Mode mMode = Mode.UNDEFINED;</pre>
<p>The three listener mode constants and their meanings are:</p>
<ul>
<li>PAN. Indicates that the user touched the screen and moved his or her finger over the view.</li>
<li>PINCHZOOM. Indicates that the user touched the screen with a second finger while continuing to touch the screen with the first finger.</li>
<li>UNDEFINED. Indicates that the state is not PAN or PINCHZOOM. The user may or may not be touching the screen. Initially the listener sets the state to UNDEFINED.</li>
</ul>
<p><strong>Handling gestures</strong></p>
<p>The core of the processing is focused on handling user gestures. Recall from <a title="Pinch to zoom feature for Xperia X10 tutorial - Part 1" href="http://blogs.sonyericsson.com/developerworld/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%e2%84%a2-10-apps-part-1/" target="_blank">Part 1 of the tutorial</a> that the handler uses the onTouch() method in the View.OnTouchListener interface to process touch events. Here is part of the definition of the onTouch() method in PinchZoomListener.</p>
<pre>private VelocityTracker mVelocityTracker;
public boolean onTouch(View v, MotionEvent event) {
    final int action = event.getAction() &amp; MotionEvent.ACTION_MASK;
    final float x = event.getX();
    final float y = event.getY();
if (mVelocityTracker == null) {
    mVelocityTracker = VelocityTracker.obtain();
   }
        mVelocityTracker.addMovement(event);
   …
 }</pre>
<p>The onTouch() method uses the getAction() method to get the action from the MotionEvent object for the touch event. To get the action code, the onTouch() method performs a bitwise AND operation on the retrieved action and the ACTION_MASK constant. Then the method gets the X and Y coordinates of the touched position on the screen.</p>
<p>Notice the use of the VelocityTracker class. A VelocityTracker object will be used to track the velocity of the touch events.</p>
<p><strong>Handling ACTION_DOWN events</strong></p>
<p>After getting the action-related information from the MotionEvent object, your application needs to handle the action. Here is how the listener processes an ACTION_DOWN event, that is, when the user touches the screen with one finger:</p>
<pre>switch (action) {
    case MotionEvent.ACTION_DOWN:
        mZoomControl.stopFling();
        mDownX = x;
        mDownY = y;
        mX = x;
        mY = y;
        break;</pre>
<p>As its name implies, mZoomControl controls zooming in the application. It is assigned a DynamicZoomControl object that is provided in the setZoomControl() method of the application, as shown below.</p>
<pre>public void setZoomControl(DynamicZoomControl control) {
    mZoomControl = control;
}</pre>
<p>The DynamicZoomControl class is fully explained in <a title="Android one finger zoom tutorial - Part 4" href="http://blogs.sonyericsson.com/developerworld/2010/07/07/android-one-finger-zoom-tutorial-part-4/" target="_blank">Android one finger zoom tutorial – Part 4</a>, published earlier in this blog. The stopFling() method of DynamicZoomControl stops the animation associated with a fling gesture. A fling gesture means that the user dragged an object across the screen and then removed his or her finger from the screen. This result is an animation in which the object continues to move but slows over time. The ACTION_DOWN event invokes stopFling() to stop processing the fling gesture. This handles the situation where the user made a fling gesture before retouching the screen.</p>
<p>The mX and mY variables are used to record the X and Y coordinates, respectively, of the current touch on the screen. The mDownX and mDownY variables are used to record the X and Y coordinates, respectively, of the previous touch on the screen. The four variables are set to the coordinate values for the current ACTION_DOWN event.</p>
<p><strong>Handling ACTION_POINTER_DOWN events</strong></p>
<p>Now let’s look at the code in PinchZoomListener that processes an ACTION_POINTER_DOWN event.</p>
<pre>case MotionEvent.ACTION_POINTER_DOWN:
    if (event.getPointerCount() &gt; 1) {
        oldDist = spacing(event);
        if (oldDist &gt; 10f) {
            midPoint(mMidPoint, event);
            mMode = Mode.PINCHZOOM;
        }
    }
    break;</pre>
<p>In this case, the user should have two fingers touching the screen. If so, the listener calculates the distance between the two fingers using a spacing() method, as follows.</p>
<pre>private float spacing(MotionEvent event) {
    float x = event.getX(0) - event.getX(1);
    float y = event.getY(0) - event.getY(1);
    return FloatMath.sqrt(x * x + y * y);</pre>
<p>You might wonder why the distance between the fingers is tested, that is, if(oldDist &gt; 10f) {…}. The test is needed because the support in Android for multi-touch events such as pinch-to-zoom is still not optimal (see <em>Limitations</em> below). For example, sometimes Android incorrectly reports that two fingers are touching in almost the same position. To guard against anomalous situations such as this, the listener ignores events where the distance between the two fingers is less than a certain threshold (in this case 10f). If the distance is greater than the threshold, the listener finds the midpoint of the distance using a midPoint() method, as shown below. The midpoint will be used as the center point of the zoom.</p>
<pre>private void midPoint(PointF point, MotionEvent event) {
        float x = event.getX(0) + event.getX(1);
        float y = event.getY(0) + event.getY(1);
        point.set(x / 2, y / 2);</pre>
<p>With the two fingers now touching the screen, the listener sets the mode to PINCHZOOM.</p>
<p><strong>Handling ACTION_MOVE events</strong></p>
<p>Next, let’s look at the code in PinchZoomListener that handles an ACTION_MOVE event, where the user moves a finger across the screen.</p>
<pre>case MotionEvent.ACTION_MOVE:
    final float dx = (x - mX) / v.getWidth();
    final float dy = (y - mY) / v.getHeight();

    if (mMode == Mode.PAN) {
        mZoomControl.pan(-dx, -dy);
    } else if (mMode == Mode.PINCHZOOM) {
        float newDist = spacing(event);
        if (newDist &gt; 10f) {
            final float scale = newDist / oldDist;
            final float xx = mMidPoint.x / v.getWidth();
            final float yy = mMidPoint.y / v.getHeight();
            mZoomControl.zoom(scale, xx, yy);
            oldDist = newDist;
        }
    } else {
        final float scrollX = mDownX - x;
        final float scrollY = mDownY - y;

        final float dist =
            (float)Math.sqrt(scrollX * scrollX + scrollY * scrollY);

        if (dist &gt;= mScaledTouchSlop ){
            mMode = Mode.PAN;
        }
    }

    mX = x;
    mY = y;
    break;</pre>
<p>Here, the listener determines if the action is part of a pan gesture or a pinch-to-zoom gesture. In either case, it uses the dynamic zoom control to handle the gesture. The zoom action is handled by the zoom() method in the DynamicZoomControl class. The method performs its actions based on the scale of the zoom, an invariant X coordinate position, and an invariant Y coordinate position. The scale of the zoom and the invariant coordinates are defined as follows:</p>
<table width="100%">
<tbody>
<tr>
<td valign="top" width="35%">scale of the zoom</td>
<td valign="top" width="65%">The distance between the finger before the move (oldDist) divided by the distance between the fingers after the move (newDist).</td>
</tr>
<tr>
<td valign="top" width="35%">invariant X coordinate</td>
<td valign="top">The midpoint of the distance between the fingers divided by the width of the view.</td>
</tr>
<tr>
<td valign="top" width="35%">invariant Y coordinate</td>
<td valign="top" width="65%">The midpoint of the distance between the fingers divided by the height of the view.</td>
</tr>
</tbody>
</table>
<p>Here, the term <em>invariant</em> means the zoom method ensures that the coordinate value does not change during the course of the zoom.</p>
<p>Notice that the listener ignores the event if the mode is PINCHZOOM and the distance between the points is less than the space threshold. Again, this is to protect against anomalous results.</p>
<p>If the node is not PAN or PINCHZOOM, the listener tests to see if the move distance exceeds the distance at which the movement is considered scrolling in pixels. The listener sets the threshold from the current context using the getScaledTouchSlop() method. Here is the call to getScaledTouchSlop() in the listener.</p>
<pre>private final int mScaledTouchSlop;

public PinchZoomListener(Context context) {
    mScaledTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    …
}</pre>
<p>If the move distance does exceed the threshold, the listener sets the mode to PAN.</p>
<p><strong>Handling ACTION_POINTER_UP events</strong></p>
<p>The next event type to examine is ACTION_POINTER_UP, the case where the user releases one finger while continuing to touch the screen with the other finger. Here is the code that handles that case.</p>
<pre>case MotionEvent.ACTION_POINTER_UP:
    if(event.getPointerCount() &gt; 1 &amp;&amp;  mMode == Mode.PINCHZOOM){
       panAfterPinchTimeout = System.currentTimeMillis() + 100;
    }
    mMode = Mode.UNDEFINED;
    break;</pre>
<p>There is no zoom processing to perform for this event, so the listener simply sets a timeout threshold that it will use if the user subsequently pans across the screen. It then sets the mode to UNDEFINED.</p>
<p><strong>Handling ACTION_UP events</strong></p>
<p>Last, here is the way the ACTION_UP event is handled in the PinchZoomListener.</p>
<pre>case MotionEvent.ACTION_UP:
    if (mMode == Mode.PAN) {
        final long now = System.currentTimeMillis();
        if(panAfterPinchTimeout &lt; now){
           mVelocityTracker.computeCurrentVelocity(1000,
                  mScaledMaximumFlingVelocity);
           mZoomControl.startFling(
                  -mVelocityTracker.getXVelocity() / v.getWidth(),
                  -mVelocityTracker.getYVelocity() / v.getHeight());
        }
        } else if(mMode != Mode.PINCHZOOM) {
                  mZoomControl.startFling(0, 0);
        }
        mVelocityTracker.recycle();
        mVelocityTracker = null;</pre>
<p>The ACTION_UP event covers the situation where the user has one finger touching the screen and then removes it from the screen. If the user was panning across the screen before removing the finger, the listener checks to see that timeout threshold wasn’t reached. If the threshold wasn’t reached, the listener starts a fling animation by calling the startFling() method of the Dynamic ZoomControl object.</p>
<p>When it makes the call to startFling(), the listener specifies the velocity in the X and Y dimensions. These velocities are used by the method in calculating the physics of the animation. If the mode is not PAN or PINCHZOOM, the listener simply releases control by calling the startFling() method and specifying 0 for the velocities in the X and Y dimensions.</p>
<p><strong>Limitations</strong></p>
<p>Xperia™ X10 is not yet fully optimized for multi-touch. There are some cases where a pinch-to-zoom gesture generates unusual behavior. For example, a user might not see the expected zoom in or zoom out in the field of view if he or she crosses the X or Y axis during a pinch-to-zoom gesture. For instance, the zoom in or zoom out might appear jumpy, as illustrated below.</p>
<p><a href="http://blogs.sonyericsson.com/developerworld/files/2011/04/CrossAxis2sm.jpg"><img class="alignnone size-full wp-image-2189" src="http://blogs.sonyericsson.com/developerworld/files/2011/04/CrossAxis2sm.jpg" alt="crossing axis can be jumpy" width="152" height="114" /></a></p>
<p>In addition, a user might not see a smooth zoom in or zoom out movement if his or her fingers are aligned along the X or Y axis, as illustrated below.</p>
<p><a href="http://blogs.sonyericsson.com/developerworld/files/2011/04/SameAxis2sm.jpg"><img class="alignnone size-full wp-image-2191" src="http://blogs.sonyericsson.com/developerworld/files/2011/04/SameAxis2sm.jpg" alt="same axis issues" width="150" height="57" /></a></p>
<p>Note too that the all points addressable screen in the Xperia™ X10 consists of an intersection matrix of row and column sense elements, as illustrated below.</p>
<p><a href="http://blogs.sonyericsson.com/developerworld/files/2011/04/matrix.jpg"><img class="alignnone size-full wp-image-2194" src="http://blogs.sonyericsson.com/developerworld/files/2011/04/matrix.jpg" alt="dual layer" width="141" height="126" /></a></p>
<p>This arrangement is termed dual layer.</p>
<p>The dual layer hardware registers the touch position of a finger in terms of a row and column. For two fingers, it registers two rows and two columns. However, the hardware does not necessarily distinguish which finger is touching the screen at the registered row and column. Also, the hardware does not necessarily distinguish which recorded value represents the row and which the column. As a result, when two fingers touch the screen, as in a pinch-to-zoom gesture, there are four possibilities of how the combined event is registered.</p>
<p>Suppose, for example, that the first finger (let’s call it finger A) touches the screen at row 1 column 1, and the second finger (let’s call it finger B) touches the screen at row 3 column 6, as shown in the following image.</p>
<p><a href="http://blogs.sonyericsson.com/developerworld/files/2011/04/PinchToZoom_rowcolumn.jpg"><img class="alignnone size-full wp-image-2196" src="http://blogs.sonyericsson.com/developerworld/files/2011/04/PinchToZoom_rowcolumn.jpg" alt="pinch zoom row column issues" width="517" height="287" /></a></p>
<p>The hardware might register the fingers in any of the following four ways:</p>
<ul>
<li>Finger A at row 1 and column 1 and finger B at row 3 column 6.</li>
<li>Finger A at row 3 column 6 and finger B at row 1 column 1.</li>
<li>Finger A at row 3 column 1 and finger B at row 1 column 6.</li>
<li>Finger A at row 1 column 6 and finger B at row 3 column 1.</li>
</ul>
<p>This type of axis flipping is also a general problem reported about the multi-touch support in Android 2.1.</p>
<p>Beyond the axis flipping problem, Android 2.1 sometimes records touches by multiple fingers as one finger touch or as multiple fingers touching at almost the same position. So it’s important to check for anomalous results where you can, as the PinchZoomListener in this tutorial does. Recall that the PinchZoomListener tests whether the distance between the two fingers is below a specified distance (10f), and if that distance is below the threshold, the listener ignores the touch event.</p>
<p>If you’re interested in testing your Xperia™ X10 device for multi-touch, you can use the MultiTouch Visualizer 2 application, which you can find in Android Market.</p>
<p><strong>More information</strong></p>
<ul>
<li><a title="Pinch to zoom for Xperia X10 tutorial - Part 1" href="http://blogs.sonyericsson.com/developerworld/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%e2%84%a2-10-apps-part-1/" target="_blank">How to take advantage of the pinch-to-zoom feature in your Xperia™ 10 apps – Part 1&gt;&gt;&gt;</a></li>
<li><a title="Visualizer 2" href="https://market.android.com/details?id=org.metalev.multitouch.visualizer2" target="_blank">Learn more about Visualizer 2 in AndroidMarket&gt;&gt;&gt;</a></li>
<li><a title="Sony Ericsson Android development" href="http://developer.sonyericsson.com/wportal/devworld/technology/android/get-started?cc=gb&amp;lc=en" target="_blank">Learn more about Android development on Developer World&gt;&gt;&gt;</a></li>
<li><a title="Xperia X10 description" href="http://www.sonyericsson.com/cws/products/mobilephones/overview/xperiax10?cc=gb&amp;lc=en" target="_blank">See Xperia™ X10 on the consumer website&gt;&gt;&gt;</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://developer.sonyericsson.com/wp/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%e2%84%a2-10-apps-part-2/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How to take advantage of the pinch-to-zoom feature in your Xperia™ X10 apps &#8211; Part 1</title>
		<link>http://developer.sonyericsson.com/wp/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%e2%84%a2-10-apps-part-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%25e2%2584%25a2-10-apps-part-1</link>
		<comments>http://developer.sonyericsson.com/wp/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%e2%84%a2-10-apps-part-1/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 19:44:57 +0000</pubDate>
		<dc:creator>Ed Ort</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[x10]]></category>
		<category><![CDATA[Xperia]]></category>
		<category><![CDATA[Zoom]]></category>

		<guid isPermaLink="false">http://blogs.sonyericsson.com/developerworld/?p=2062</guid>
		<description><![CDATA[&#160; Recently Sony Ericsson rolled out an update to the Android™2.1 operating system in its Xperia™ X10 phones. One of the important new features in the update is support for a multi-touch gesture called pinch-to-zoom. In this first part of a two-part tutorial, you will learn how to take advantage of the pinch-to-zoom feature in [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>Recently Sony Ericsson rolled out an update to the Android™2.1 operating system in its Xperia™ X10 phones. One of the important new features in the update is support for a multi-touch gesture called pinch-to-zoom. In this first part of a two-part tutorial, you will learn how to take advantage of the pinch-to-zoom feature in your apps. In the <a title="Pinch to zoom feature in Xperia X10 tutorial - Part 2" href="http://blogs.sonyericsson.com/developerworld/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%E2%84%A2-10-apps-part-2/" target="_blank">second part of the tutorial</a>, you’ll examine a code example that uses the pinch-to-zoom feature.<br />
<span id="more-2062"></span><br />
The pinch-to-zoom feature allows users to zoom in and get a closer, more detailed view of a display, or zoom out and get a wider field of view. For example, in the side-by-side image below, the image on the left shows a display zoomed out for a wider field of view. The image on the right shows the display zoomed in for a closer view.</p>
<table width="80%" border="0">
<tbody>
<tr>
<td><a href="http://blogs.sonyericsson.com/developerworld/files/2011/04/X10_zoomout.jpg"><img class="size-full wp-image-2085" src="http://blogs.sonyericsson.com/developerworld/files/2011/04/X10_zoomout.jpg" alt="zoom out " width="214" height="85" /></a></td>
<td width="50%"><a href="http://blogs.sonyericsson.com/developerworld/files/2011/04/X10_zoomin1.jpg"><img class="alignright size-full wp-image-2089" src="http://blogs.sonyericsson.com/developerworld/files/2011/04/X10_zoomin1.jpg" alt="zoom in" width="214" height="85" /></a></td>
</tr>
</tbody>
</table>
<p><em>The pinch-to-zoom feature lets users zoom out for a wider field of view, or zoom in for a closer view.</em></p>
<p>Although not initially available in the Android 2.1 support in Xperia™ X10, pinch-to-zoom is now available as an over-the-air (OTA) enhancement. Note however that Xperia™ X10 is not yet fully optimized for multi-touch. There are some cases where a pinch-to-zoom gesture generates unusual behavior. For more information, see the Limitations section in Part 2 of the tutorial.</p>
<p>You can take advantage of the pinch-to-zoom feature in applications that you develop for Xperia™ X10. Two applications that are packaged with Xperia™ X10 already take advantage of the feature: the web browser and Google Maps. There are also other applications that make use of this feature, such as Angry Birds.</p>
<p>Below is a video that demonstrates the pinch-to-zoom feature in Xperia™ X10.</p>
<p><object width="425" height="350"><param name="movie" value="868sPlG3dCY"></param><param name="wmode" value="transparent" ></param><embed src="http://www.youtube.com/v/868sPlG3dCY" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></p>
<p><strong>Providing pinch-to-zoom capability in your Xperia™ X10 application</strong></p>
<p>Your Xperia™ X10 application needs to do the following to provide pinch-to-zoom capability:</p>
<ul>
<li>Detect that the user has made a pinch-to-zoom gesture, such as moving two fingers across the screen. This is further explained below in Detecting and getting information about the gesture.</li>
<li>Get information about the gesture, such as what the action was and when it took place. This is further explained below in Detecting and getting information about the gesture.</li>
<li>Process the gesture, that is, respond to the user’s action, as appropriate. This is further explained below in Processing the gesture.</li>
</ul>
<p><strong>Detecting and getting information about the gesture</strong></p>
<p>When a user touches the screen, Android creates an Android™ <a title="Motion Event description" href="http://developer.android.com/reference/android/view/MotionEvent.html" target="_blank">MotionEvent</a> object to record information about the touch event, such as the action the user performed and the time when the user performed it. Your application needs to access the object in order to detect a pinch-to-zoom gesture and get information about it. This requires the application to first import the MotionEvent class as follows:</p>
<pre>import android.view.MotionEvent;</pre>
<p><strong>Processing the gesture</strong></p>
<p>To process the gesture, you create a callback handler. You can use the callback handler to take actions such as get information about a pinch-to-zoom gesture. However, first you need to register the callback handler using the <a title="setOnTouchListener method" href="http://developer.android.com/reference/android/view/View.html#setOnTouchListener(android.view.View.OnTouchListener)" target="_blank">setOnTouchListener()</a> method of the Android <a title="Android View class" href="http://developer.android.com/reference/android/view/View.html" target="_blank">View</a> class, as shown in the following code snippet.</p>
<pre>import android.view.View;
import android.view.View.OnTouchListener;
…
view.setOnTouchListener(onTouchListener);</pre>
<p>The parameter to view.setOnTouchListener represented by <code>onTouchListener</code> is the callback handler, that is, the touch listener that you want to register. The callback handler is attached to a specific view. Touch events that are posted to that view are processed by the associated callback handler.</p>
<p>The callback handler must implement Android’s <a title="View.OnTouchListener interface description" href="http://developer.android.com/reference/android/view/View.OnTouchListener.html" target="_blank">View.OnTouchListener</a> interface and use the <a title="onTouch method" href="http://developer.android.com/reference/android/view/View.OnTouchListener.html#onTouch%28android.view.View,%20android.view.MotionEvent%29" target="_blank">onTouch()</a> method defined in the interface to process the touch events. When you call the onTouch() method, you need to supply as parameters a View object and a MotionEvent object, as shown below.</p>
<pre>public class MyPinchZoom extends Activity implements OnTouchListener {

   public boolean onTouch(View v, MotionEvent event) {
      // Process touch events
   }

}</pre>
<p>A user starts a pinch-to-zoom gesture by touching the screen with one finger. This event is represented in the MotionEvent object by the constant ACTION_DOWN. When the user touches the screen with a second finger while continuing to touch the screen with the first finger, that event is recorded in the MotionEvent object by the constant ACTION_POINTER_DOWN. Other constants represent other actions taken during the pinch-to-zoom gesture. Here are the set of action-related constants for the pinch-to-zoom gesture:</p>
<table width="100%" border="0">
<tbody>
<tr>
<td width="35%">ACTION_DOWN</td>
<td width="65%">The user touched the screen.</td>
</tr>
<tr>
<td width="35%">ACTION_POINTER_DOWN</td>
<td width="65%">The user touched the screen with a second finger while continuing to touch the screen with the first finger.</td>
</tr>
<tr>
<td width="35%">ACTION_MOVE</td>
<td width="65%">The user moved a finger on the screen.</td>
</tr>
<tr>
<td width="35%">ACTION_POINTER_UP</td>
<td width="65%">The user released one finger from the screen while continuing to touch the screen with the other finger.</td>
</tr>
<tr>
<td width="35%">ACTION_UP</td>
<td width="65%">The user released the finger from the screen (only only one finger was touching the screen).</td>
</tr>
<tr>
<td>ACTION_CANCEL</td>
<td width="65%">The user cancelled the current gesture.</td>
</tr>
</tbody>
</table>
<p>After you register the callback handler, you can use it to call methods on the MotionEvent object to get information about a pinch-to-zoom related event. For example, the getAction() method returns the type of action performed: up down, move , or cancel. The following code snippet shows a call to the getAction() method.</p>
<pre>// Process touch events
      int action = event.getAction();</pre>
<p>The lowest 8 bits of the action returned by getAction() represent the action code. To access the action code, you can perform a bitwise AND operation (using the &amp; operator). The two operands of the AND operation are the result returned by getAction() and the MotionEvent constant, <a title="ACTION_MASK description" href="http://developer.android.com/reference/android/view/MotionEvent.html#ACTION_MASK" target="_blank">ACTION_MASK</a>. The ACTION_MASK constant is a bit mask of the part of the action code that represents the action itself. The following line of code performs a bitwise AND operation on the action returned by getAction() and the ACTION_MASK constant.</p>
<pre>int actionCode = action &amp; MotionEvent.ACTION_MASK;</pre>
<p>You can get the number of pointers (fingers) associated with the event by calling the getPointerCount() method of the MotionEvent object, as shown below.</p>
<pre>int pCount = event.getPointerCount();</pre>
<p>You can also retrieve the X and Y coordinates associated with the touch event by calling the <a title="getX() method description" href="http://developer.android.com/reference/android/view/MotionEvent.html#getX()" target="_blank">getX()</a> and <a title="getY() method description" href="http://developer.android.com/reference/android/view/MotionEvent.html#getY()" target="_blank">getY()</a> methods of the MotionEvent object, respectively. Here is an example that retrieves first the X coordinate and then the Y coordinate.</p>
<pre>float xcoord = event.getX;
float ycoord = event.getY;</pre>
<p>By identifying a pointer index as a parameter to getX() and getY(), you can retrieve the X and Y coordinates of a specific pointer. The following example shows how to get the X coordinate and Y coordinate of the first pointer.</p>
<pre>Float  xcoord = event.getX(0);   //Get the X coordinate for the first
                                 // pointer
Float  ycoord = event.getY(1);   //Get the Y coordinate for the second
                                 // pointer</pre>
<p><strong>More information</strong></p>
<ul>
<li><a title="Pinch to zoom for Xperia X10 tutorial - Part 2" href="http://blogs.sonyericsson.com/developerworld/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%E2%84%A2-10-apps-part-2/" target="_blank">How to take advantage of the pinch-to-zoom feature in your Xperia™ X10 apps – Part 2&gt;&gt;&gt;</a></li>
<li><a title="Sony Ericsson Android dvelopment resource pages" href="http://developer.sonyericsson.com/wportal/devworld/technology/android/get-started?cc=gb&amp;lc=en" target="_blank">Learn more about Android development on Developer World&gt;&gt;&gt;</a></li>
<li><a title="Xperia X10 description" href="http://www.sonyericsson.com/cws/products/mobilephones/overview/xperiax10?cc=gb&amp;lc=en" target="_blank">See Xperia™ 10 on the consumer website&gt;&gt;&gt;</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://developer.sonyericsson.com/wp/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia%e2%84%a2-10-apps-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find the tools and services you need in the Developer resources section</title>
		<link>http://developer.sonyericsson.com/wp/2011/04/01/find-the-tools-and-services-you-need-in-the-developer-resources-section/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=find-the-tools-and-services-you-need-in-the-developer-resources-section</link>
		<comments>http://developer.sonyericsson.com/wp/2011/04/01/find-the-tools-and-services-you-need-in-the-developer-resources-section/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 19:41:17 +0000</pubDate>
		<dc:creator>Ed Ort</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[services]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blogs.sonyericsson.com/developerworld/?p=2017</guid>
		<description><![CDATA[&#160; Are you looking for a way to build a mobile app that can run cross-platform? Do you need help in advertising your app? Do you want to integrate social networking into your app? You can find tools and services that can help you do these things and more in the Developer resources section on [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>Are you looking for a way to build a mobile app that can run cross-platform? Do you need help in advertising your app? Do you want to integrate social networking into your app? You can find tools and services that can help you do these things and more in the <a title="Sony Ericsson Developer Resource Directory" href="http://developer.sonyericsson.com/wportal/devworld/technology/developerresources?cc=gb&amp;lc=en" target="_blank">Developer resources section on Developer World</a>.</p>
<p><span id="more-2017"></span></p>
<p>The Developer resources section lists more than 60 tools and services grouped into 13 categories &#8212; anywhere from advisory services, to games and gaming services, to performance tracking services, to user interface design services. Within those categories, you can find tools and services that can help you perform a wide range of tasks related to making your mobile app a success. For example, If you’re a developer interested in developing a business strategy for your app, you can find various services that can help you do that in the Advisory services category. Or perhaps you need help in adding navigation and other location-based features to your app. You can find various tools to help with that in the Location-based services category. Looking for a service to help monetize your app? You can find monetization-related services in the Billing services category.</p>
<p>The list of tools and services in the Developer resources section is dynamic and growing. You can contribute to that growth. If you have any suggestions or recommendations for additional tools and services that you found interesting or useful for your projects, let us know at DeveloperServices at sonyericsson.com.</p>
<p>Note that the tools and services listed in the Developer resources section are for informational purposes only. Sony Ericsson does not make any representation as to the suitability or usefulness of these resources.</p>
<p><strong>More information</strong></p>
<ul>
<li><a title="Sony Ericsson Developer Resources Directory" href="http://developer.sonyericsson.com/wportal/devworld/technology/developerresources?cc=gb&amp;lc=en" target="_blank">Get information tools and services in the Developer resources section on Developer World&gt;&gt;&gt;</a></li>
<li><a title="Sony Ericsson Developer World Technology page" href="http://developer.sonyericsson.com/wportal/devworld/technology/overview?cc=gb&amp;lc=en" target="_blank">Learn about Sony Ericsson phones, technologies and tools in the Technology page on Developer World&gt;&gt;&gt;</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://developer.sonyericsson.com/wp/2011/04/01/find-the-tools-and-services-you-need-in-the-developer-resources-section/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: basic

Served from: blogs.sonyericsson.com @ 2012-02-13 10:56:40 -->
