Android Tutorial: Stop Android Live Wallpapers from draining phone battery

September 2nd, 2010

Live wallpapers are fun and eye-catching, but an incorrect implementation of a live wallpaper can quickly drain the battery of any powerful Android™ phone. This tutorial will explain how big this problem can be, what the reasons are and show you a code example on how you can avoid this happening to your live wallpapers.

A live wallpaper in Android™ is implemented as an Android™ service and will stay alive running in the background as long as it is the currently active wallpaper. As a developer you will have access to hardware and framework components such as the camera, GPS, compass, accelerometer and 3D graphics, just as for any Android™ services and applications. The possibility to create a live wallpaper enhanced with visual effects and features are more or less unlimited. However, it must be remembered that from a power consumption perspective the more complex drawings and hardware features you add will affect the overall performance and battery life time since the Android™ framework will make sure that the live wallpaper service is kept alive forever. This is especially critical if the live wallpaper misbehaves in the background. The unintended power consumption can then quickly drain the battery and the user will be far from happy having to recharge the phone all too often.

Two examples

Let’s compare two live wallpapers in a test scenario where the user wakes up the phone from standby, switches to a live wallpaper and then puts the phone back to standby. The graph (ampere on Y-axis, time on x-axis) to the left shows a live wallpaper that handles the resources correct and the graph to the right shows a wallpaper that keeps listening for events from the orientation sensor even when it is put back to sleep.

From the graph to the left you can see that when all resources are turned off the live wallpaper is back to consuming as much current as before the phone woke up from sleep, around 3-5 mA in average. However, in the graph to the right the live  wallpaper keeps listening to events from the orientation sensor even when the phone is put to sleep and the power consumption is around 35 mA in average.

Read the rest of this entry »

Bookmark and Share

Retro games at Stockholm Android Hackathon, September 11th

September 1st, 2010

8-16 bit only games is the focus for the 11th of September Android Hackathon in Stockholm where retro gaming is the theme for the day. The developers that create the best games will win a Sony Ericsson X10 mini or X10 mini pro. Click here to register for this free event.

Bookmark and Share

SHOW ME THE MONEY – Sony Ericsson at APPNATION 2010 in San Francisco, Sept 13-14

August 30th, 2010

I would like to announce that Sony Ericsson is planning to attend the first ever APPNATION 2010 event this September. The APPNATION conference and expo will be held at the Moscone Convention Center in San Francisco, CA from September 13 to 14.

Our very own Sheana Hogan, Business Development Manager at Sony Ericsson, will be attending both days of the conference. Sheana, by the way, is responsible for defining partnership opportunities, driving developer ecosystems, and building strategic alliances with operators and independent software vendors. If you see her, please say hello and exchange a business card.

The theme for this year’s event – Show Me the Money – makes perfect sense when considering the lineup of conference schedule topics, which range from Entrepreneur’s Workshop Series: Where the Investment Dollars Will Flow in the Next 12 Months to Monetization Tactics: Monetizing on Android to App Business Models: How Do You Value Your Product and (What) Should You Charge for It?.  

I had the fortunate opportunity to have a quick Q&A session on August 27 with Drew Ianni, the founder of APPNATION, to ask him about the event:

What can attendees expect to get out of going to the APPNATION conference?

- Attendees will be immersed in engaging and informative dialogue surrounding the business of apps and the emerging app economy. Developers of all shapes-and-sizes, media and advertising executives, investors, hardware and infrastructure companies, and the broader app community will be mashed up and learn from one another about discoverability, monetization, new media business models, advertising and marketing strategies, product road maps and innovations, and consumer insights and analytics.

What is this year’s theme – Show Me the Money – all about?

- {The theme} is fundamentally about helping all companies in the app economy learn how to monetize, especially small-and-medium-sized developers.

Not only did I get an exclusive interview with Drew, he graciously provided Sony Ericsson with a super-secret, personal discount of 50% off the registration cost for an all-access, full conference pass. SCORE! Just use the promotion code DIFC50 on the APPNATION Conference online registration page.

Sony Ericsson hopes that you’re as excited to attend APPNATION 2010 as much as we are!!! Read the accompanying news article here. Stay tuned for more updates on this event and others on our Developer World event calendar.

Bookmark and Share

New version of Sony Ericsson’s WebSDK Packager tool available

August 24th, 2010

We are excited to introduce a new release of the WebSDK Packager tool, which now provides support for the Mac OS® X platform. WebSDK Packager version 1.2.1 is an all-in-one tool for building, simulating and packaging an application’s web components into a single native shell. The updated WebSDK Packager tool can be used across Windows or Mac OS platforms for development and deployment of web applications on Android™ and Symbian™ devices. WebSDK Packager also provides developers with exciting sample applications that can run on all Sony Ericsson Android and Symbian phones, including the Xperia™ X10 and Xperia X10 mini pro.

Based on PhoneGap’s open source framework, WebSDK Packager is a great tool for someone who has great expertise with HTML CSS and JavaScript and is adept at creating web applications, but is not familiar with the complexities of the mobile environment. WebSDK Packager allows Android™ developers to create mobile web applications by packaging their web components inside a native shell for Android. For Symbian developers, WebSDK Packager uses the PhoneGap API with web runtime (WRT) widgets. This truly enables developers to write code once and deploy on multiple platforms. With support of this tool on Windows and Mac OS platforms, developers can use the tool on their preferred platform.

For those not familiar with PhoneGap, it is an open source development framework for building cross-platform mobile apps that run on different mobile platforms including Android, Symbian, iPhone®, iPad®, Palm® and BlackBerry®. The PhoneGap open source code has been downloaded more than 250,000 times and there are thousands of PhoneGap-based apps in various platform stores. We also welcome the recent announcement by Symbian to integrate PhoneGap library in their web extensions package.

Sony Ericsson supports cross-platform web development and sees this as an important enabler for developers to create exciting new services across web and mobile. Sony Ericsson announced support for PhoneGap framework in 2009 and our WebSDK Packager as part of a broader approach to simplifying the application and services development on mobile devices for developers.

Additionally, we will begin referring to Sony Ericsson’s WebSDK as a “Packager”, which aligns with the true functionality of the product – a complete tool for developers to build, simulate and package their application’s web components into a single native shell.

Bookmark and Share

Android Tutorial: Reducing power consumption of connected apps

August 23rd, 2010

In this post I will cover a few important guidelines on how reduce power consumption of polling Android applications, i.e. applications that regularly connect to the internet, and get more out of the phone battery. I have crated a small sample app that puts all of the tricks into practice by setting up a background service that polls Twitter trends regularly and logs them to a file. By downloading the sample app and applying these guidelines, you will reduce the power consumption of your app by magnitudes, if you haven’t before. Click here to download the sample app. 

 

 

 

We will cover four guidelines: 

1. Synchronize you polls with other apps 

2. Make polls short 

3. Manage your connections 

4. Stop your services 

Read the rest of this entry »

Bookmark and Share

Three questions to Henrik Lindau, visiting the Game Developers Conference™ Europe

August 18th, 2010

Today is the last day of the Game Developers Conference™ Europe in Cologne, Germany. To get a hint of the hot topics I called my colleague Henrik Lindau, Partner manager at Sony Ericsson, who’s visiting this conference.

What are you doing at the Game Developers Conference™ Europe?
- I’m are here to check out the latest trends, to learn more about the industry, to learn more on how people are making money on games, and to see what games are best suited to include in our future phones. I’m also meeting a number of interesting partners in the industry, to see if there are any interesting collaboration opportunities, Henrik says.

What‘s in focus at this conference?
- I must say social games. Games where you combine classic game elements, your friends and social networks, and put it in a massive multiplayer environment. Many people and companies are focusing on this growing segment. Related to this, there is also a lot of focus on what games will be big in the future. For example, how casual games that you just play for a few minutes at a time will evolve and co-exist with the classic hardcore games that you play concentrated for a longer period of time. Some people say that casual games are already the new hardcore games.  The million dollar question is however how to make money out of your game. And there seems to be many different answers to that question. Many people seem to be looking at ads as a growing source of income for games though, at least when it comes to social games. 

What’s your biggest impression?
-
The one thing that strikes me the most is the fact that everyone is interested in games now. Success stories like Farmville, with up to 40 million daily users, has really opened a lot people’s eyes. But still some people say that we have only seen the tip of an iceberg. That’s where I see Sony Ericsson playing a big part. For example, by including a really interesting game in a phone, we can elevate new exciting cross platform game propositions. Users can play parts of the same game on the phone, on the computer and maybe on other platforms too, for example Facebook. Cross platform games will be an important part of the game industry in the coming years, Henrik sums it up.

Visit the Game Developers Conference™ Europe web site to find out more on this event.

Bookmark and Share

The Xperia™ X10 now available in the U.S. market

August 16th, 2010

The greatly anticipated Sony Ericsson Xperia™ X10 is now available to U.S. customers, as you might have seen in the announcement from AT&T and Sony Ericsson.  This surely is welcome news if you’re in the U.S. and keen to get your hands on the Xperia™ X10. What’s especially interesting with AT&T’s offer is the price – $149.99 on a two contract and minimum data plan. Sounds like a fair deal, right?

For developers, Sony Ericsson has put together an add-on for the Android™ SDK, including the splash screen, backgrounds, an Xperia™ X10 skin and some other stuff. Find out more on the Developer World web site.

Bookmark and Share

Android one finger zoom tutorial – Part 4

July 7th, 2010

Welcome to the fourth and final part of the Android tutorial on how to make your own zoom control like the one used in Sony Ericsson X10 Mini in the Camera and Album applications. Click here to go to the prevoius part of this tutorial. As usual the source code is included, see below. Don’t forgett to download ‘Sony Ericsson Tutorials’ from Android market to see demos of this and other tutorials in action.

[Download] One Finger Zoom sample project – Part 4 (220kb)

In this part we’ll focus on introducing dynamic behavior to our zoom such as fling and bounce by animating the zoom state. Dynamic behavior adds a lot in terms of looks, feedback and usability.

Dynamics

To implement dynamic behavior we’re going to subclass the Dynamics class introduced in the final part of the list tutorial. Make sure to read through that tutorial if you want to know more about the Dynamics base class.

The Dynamics class is useful for applying dynamic behavior to a value, the class itself holds a position and a velocity and functionality for setting min and max positions. When subclassing Dynamics we must implement the onUpdate(int) method that is responsible for updating the state. This gives us control over the dynamic behavior and in our Dynamics sub-class we’ll implement basic friction and spring physics to handle fling and edge bounce. If you want to know more about spring physics then this is a nice place to start.

Read the rest of this entry »

Bookmark and Share

Android Tutorial: Making your own 3D list – Part 3 (final part)

June 23rd, 2010

Introduction

This is the third and final article in the series of how to make your own list view. Right now we have a basic working list with some nice graphics. Click here to go to the previus part of this tutorial. In this article we will add some behavior to our list and add the fling and bounce/snap effects. Fling support is in my view mandatory for any list where you navigate by touch. As a user I wouldn’t expect that the list simply stops when I lift my finger from the touch screen. If I give the list a velocity, I expect it to continue scrolling for a while, and gradually slow down until it comes to a halt. Fortunately, supporting fling is no big deal. In fact it’s very simple. Below is the source code for this part of the tutorial ready to be set up in e.g. Eclipse. And as usual: Don’t forget to download the ‘Sony Ericsson Tutorials’ app from Android market where all sample apps for this and other tutorials are collected.

[Download] 3D List sample project – Part 3 (37kb)

Read the rest of this entry »

Bookmark and Share

Xperia™ news!

June 17th, 2010

As many of you probably saw yesterday Sony Ericsson announced a new product in the Xperia™ product line called X8. X8 brings together features from both X10 and X10 mini and will retail for under €200 in most markets. The X8 comes with a HVGA screen and a 3.2 mega pixel camera. Below is a short video showing what the X8 looks like.

More info on X8 and the Q3 update to Android 2.1 for X10 and X10 mini/pro can be found on our sister blog, the Sony Ericsson Product Blog

Bookmark and Share