Header Ads

Getting started with Timescape™ extensions

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.
Read more after the jump.
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 develop Timescape™ extensions and use the Extension Development Kit, along with special sections on Developer Word dedicated to Timescape extensions and the Extension Development Kit (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.
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.

Robert Helmbro, Software Engineer at Sony Ericsson

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.
What is a Timescape™ extension?
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.
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.

Prerequisites for creating a Timescape™ extension
You should have basic knowledge about Android™ application development. 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.
Documentation and sample code
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 EDK developer section on Developer World. Download the Timescape™ code examples and documentation to get started. Once you’ve extracted the zip file, you’ll find the following content:
RSSExtension – A sample extension with some attached documentation, intended for RSS type of extensions.
SocialNetworkSample – A sample extension with some attached documentation. This sample is made to give an example of how a social network example can be made.
SampleExtension – A sample extension with some attached documentation.
EventStream_API.zip – Javadocs for the Event Stream API.
Introduction_Timescape_extensions.pdf – Contains some basic information.
SEMC_Xperia_Events_overview.pdf – Documentation about the visualisation application Xperia™ Events.
Timescape_icon_design_guideline.pdf – Guidelines about icons needed in an extension.
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.
Downloading the Extension Development Kit
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.
As mentioned before, Sony Ericsson has created the Extension Development Kit (EDK) 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 EDK developer section.
You should now be able to start an emulator with your newly created configuration (AVD) by following the steps below:
In Eclipse, press Window > Android SDK and AVD Manager.
Select your new AVD and press Start.
Wait for the emulator to boot up and then scroll the main menu and you will find the application Xperia™ Events.
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.

Using the Social network sample extension
In order to fill Xperia™ Events with some content, let’s try out the Social network sample extension.
Browse to the SocialNetworkSample folder from EdkSnsSampleApp1.zip.
Create an Android project in Eclipse: File > New > Project… > Android > Android Project.
Set the ‘Create project from existing source’ checkbox and navigate to your recently extracted folder containing SocialNetworkSample.
Check EDK 1.1 as Build Target and press Finish.
Install the SocialNetworkSample to the emulator by right clicking the newly created project and press Run As > Android Application.
Now launch Xperia™ Events in the emulator again. A new tab should be present. Follow these steps:
Press the new tab and then press Add account.
Press ‘SNS Sample extension – Register your account information’. Enter any user name and password you like and press Sign In.
Press back to see the dummy stream of events generated by the extension.
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 Infinite icon 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.
Time for coding
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.
Hopefully, this has given you enough information for you to start a prototype of your own extension. When you’re ready, download the EDK and give it a go. If you have any questions, just post them in the EDK thread on Google groups, which we will monitor and get back with answers as soon as possible. Happy coding!

No comments:

Powered by Blogger.