tag:blogger.com,1999:blog-320059422024-03-14T13:24:35.989+00:00GeekYouUp's Mobile BlogFor Android updates follow <a href="http://twitter.com/geekyouup">@GeekYouUp</a> on Twitter.Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.comBlogger51125tag:blogger.com,1999:blog-32005942.post-63855288523568209082014-08-04T17:40:00.000+00:002014-08-04T17:40:14.372+00:00USW-SVN+Git-ABS+ABC-ADT+Gradle = The Ultimate Refresh<div dir="ltr" style="text-align: left;" trbidi="on">
The <a href="https://play.google.com/store/apps/details?id=com.geekyouup.android.ustopwatch">Ultimate Stopwatch</a> is a pretty long running project in the Android scheme of things and when I kicked it off I had the source code in a CVS repo on a private server with regular(ish) backups.<br />
<br />
In 2011 I relinquished the server and migrated to an SVN repo hosted on <a href="http://code.google.com/">Google Code</a>. But, setting up Subversion with any sort of IDE support is somewhat unpleasant, so I've decided to migrate again, this time to Git on GitHub. But SVN->Git isn't enough, so at the same time I'm throwing in a migration from <a href="http://actionbarsherlock.com/">ActionBarSherlock</a> (thank you <a href="https://plus.google.com/+JakeWharton/posts">Jake Wharton</a>) to <a href="https://developer.android.com/tools/support-library/features.html#v7-appcompat">ActionBarCompat</a> and finally migrating the build from the Ant based Android Dev Tools to Gradle for good measure. Sometimes you just need to spring clean a project and sweep away the barriers holding back progress into new features like Custom Notifications, Cast and Android Wear.<br />
<br />
<center>
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ4kZImN9XCjQdu1-h09SeX3DvMSXFa0_cfbAj3Gj4uUglAG5P4S_ZAIfeH3KTLQ2q5SBN-pIDBTnCk5QIeMzWh-TxpjkD6441erzk23-hG67hVbJyirfn5toXxTL9_-fTtjTMtg/s320/IMG_20140804_152517.jpg" height="120" />
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiorVN_piPWHIdon9tgnOzl6KwI2T4Lp0Xlg_pcAKn1__hcUuRlN2RgZi9VsSug6xIngVa_Bl8upH7bXELeMkB0gLrGpdWvk9nArXzxnFWsdeZFUCcphLvat5km_eVExc1E3Mcr8Q/s320/IMG_20140804_152455.jpg" height="120" />
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmmni7cpaplygUqbSL_lQcoqgsTNmPBjTyeDjotDieWy06zLtNohWRNCfrKFAs-opDBeCfsfS410Pl3LL_z8E3MyW10OHbrh7jS9Re49qFYQCyxzbdTqqyILsAV__VBmnewHiOSw/s320/Screen+Shot+2014-03-20+at+11.32.06+AM.png" height="120" /></center>
<br />
There is more testing to do, but the new repo/build/actionbar are all in at <a href="https://github.com/geekyouup/ultimatestopwatch">https://github.com/geekyouup/ultimatestopwatch</a> and the new features will be coming soon.<br />
<br />
By far the easiest step of the migration was getting from SVN to Git, although it should have been even easier. The 'git svn ...' command does a great job of reading every commit from the SVN repo and playing it back into the new Git repo, so you keep all the history. However git-svn didn't work on my Mac, all I achieved was the error <span style="color: #008800; font-family: monospace, serif; font-size: 13px; white-space: pre-wrap;">"</span><span class="str" style="color: #008800; font-family: monospace, serif; font-size: 13px; white-space: pre-wrap;">Can't locate SVN/Core.pm in @INC"</span>. Fortunately I wasn't the first and <a href="http://blog.victorquinn.com/fix-git-svn-in-mountain-lion">Victor Quinn's guide</a> to fix the fact that git-svn is broken on Mavericks and Mountain Lion was most useful. After that it was plain sailing, creating the GitHub project and syncing the repo.<br />
<br />
ActionBarSherlock to the Android Support Library AppCompat Action Bar was a little more painful and the only reason I voluntarily dived in was to gain access to <a href="https://developer.android.com/reference/android/support/v7/media/MediaRouteProvider.html">MediaRouteProvider</a> to later add Cast Support. A solid first step in using ActionBarCompat is to check out the <a href="https://www.blogger.com/First,%20watch%20the%20video%20https://plus.google.com/+AndroidDevelopers/posts/9Tw5zZvAGnq">G+ post and video</a> by <a href="https://plus.google.com/+ChrisBanes">Chris Banes</a> to pick up the basics.<br />
<br />
Then I plugged through the following steps:<br />
<ol style="text-align: left;">
<li>Add a project dependancy on support-v7-appcompat, <a href="https://developer.android.com/tools/support-library/setup.html">official guide</a></li>
<li>Switch Activity/Fragment/Manager classes from:</li>
<ol>
<li><i>SherlockActivity</i> -> <i>android.support.v7.app.ActionBarActivity</i></li>
<li><i>SherlockFragment</i> -> <i>android.support.v4.app.Fragment</i></li>
<li><i>SherlockFragmentActivity</i> -> <i>android.support.v7.app.ActionBarActivity</i></li>
<li><i>SherlockListFragment</i> -> <i>android.support.v4.app.ListFragment</i></li>
<li><i>SherlockFragmentManager</i> -> <i>android.support.v4.app.FragmentManager</i></li>
</ol>
<li>Switch the packages of a number of imports throughout the project:</li>
<ol>
<li><i>import com.actionbarsherlock.view.Menu</i> -> <i>android.view.Menu</i></li>
<li><i>import com.actionbarsherlock.view.MenuItem</i> -> <i>android.view.MenuItem</i></li>
<li><i>import com.actionbarsherlock.view.MenuInflater </i>-> <i>android.view.MenuInflater</i></li>
<li><i>import com.actionbarsherlock.view.ActionMode</i> -> <i>android.view.ActionMode</i></li>
<li><i>import com.actionbarsherlock.app.ActionBar</i> -> <i>android.support.v7.app.ActionBar</i></li>
</ol>
<li>Replace some Sherlock specific function calls:</li>
<ol>
<li><i>getSupportMenuInflater()</i> -> <i>getMenuInflater()</i></li>
<li><i>getSherlockActionBar() </i>-> <i>getSupportActionBar()</i></li>
<li><i>getSherlockActivity() </i>-> <i>getActivity()</i></li>
<li><i>invalidateOptionsMenu</i> -> <i>supportInvalidateOptionsMenu()</i></li>
</ol>
<li>Update the <i>menu.xml</i> files to use the AppCompat implementation of <i>app:showAsAction=""</i> instead of <i>android:showAsAction=""</i></li>
<li>Fortunately I'd generated my ActionBarSherlock theme using <a href="https://plus.google.com/+JeffGilfelt">Jeff Gilfelt's</a> <a href="http://jgilfelt.github.io/android-actionbarstylegenerator/">ActionBarStyleGenerator</a>, so it was relatively simple to go back and generate the style for AppCompat and replace the theme in my project. I also has a couple of custom themes that were based on Sherlock styles e.g. '<i>@style/Sherlock.Widget.ActionBar.Title</i>', which needed switching to the AppCompat equivalent '<i>@style/Widget.AppCompat.ActionBar.Title'</i></li>
</ol>
<div>
I was also using NineOldAndroids for the ValueAnimator backwards compatibility, but unfortunately there isn't a Support library version, so for project cleanliness I decided to deprecate the animations support for pre-ICS, add a little API-gating around those methods and remove the option from settings.</div>
<div>
<br /></div>
<div>
Part 2 will cover the migration from ADT to Gradle.</div>
</div>
Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com3tag:blogger.com,1999:blog-32005942.post-81865352708654316802013-07-01T16:33:00.000+00:002013-07-01T16:49:13.567+00:00Ultimate Stopwatch version 6.0.4<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeUHcOlMDVREEnBmFlvj93qLrWTyoJvtb82rg6MWuoB6hnlyxj8SSCiuewy92ndrH99DPP1M1GCcTreld1jitETRPweAyKw5s1adxu4KmpWHSe2k8tTLd87lkCI0czoemg6ikRGg/s1280/Screenshot_2013-07-01-16-00-43.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeUHcOlMDVREEnBmFlvj93qLrWTyoJvtb82rg6MWuoB6hnlyxj8SSCiuewy92ndrH99DPP1M1GCcTreld1jitETRPweAyKw5s1adxu4KmpWHSe2k8tTLd87lkCI0czoemg6ikRGg/s200/Screenshot_2013-07-01-16-00-43.png" width="120" /></a><span style="font-family: Arial, Helvetica, sans-serif;"></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-family: Arial, Helvetica, sans-serif;">Fresh from being used to demo <a href="http://developer.android.com/sdk/installing/studio.html">Android Studio</a> at Google I/O, the </span><a href="https://play.google.com/store/apps/details?id=com.geekyouup.android.ustopwatch">Ultimate Stopwatch</a> <span style="font-family: Arial, Helvetica, sans-serif;">v</span>ersion 6.0.4 is rolling out with a couple more tweaks and bug fixes. This has also given me the opportunity to try the Google Play <a href="https://support.google.com/googleplay/android-developer/answer/3131213?hl=en">staged rollout</a> feature.</span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">First up, overdraw has been reduced again, this time by removing the background drawable for the window. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> UltimateStopwatchActivity.onCreate(){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> getWindow().setBackgroundDrawable(null);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> }</span><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZp5hgpvdP9iysZkC8gnc8OAmVSUbEP3q32Ot3o9Fe_T28X-EJLz0pPJkE953tF-Va4nLxEIFPvjc5i2RcGbS62B3rTjeRd_u694xrBeQufoVNAX6H-GKAH7UXXnMA1PzvYaHb1A/s1280/Screenshot_2013-07-01-17-01-08+copy.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZp5hgpvdP9iysZkC8gnc8OAmVSUbEP3q32Ot3o9Fe_T28X-EJLz0pPJkE953tF-Va4nLxEIFPvjc5i2RcGbS62B3rTjeRd_u694xrBeQufoVNAX6H-GKAH7UXXnMA1PzvYaHb1A/s200/Screenshot_2013-07-01-17-01-08+copy.png" width="120" /></a><span style="font-family: Arial, Helvetica, sans-serif;"><br />Resulting in an almost totally green/blue layout, the only remaining red section is in the overlap of the minute and second hands. The screen was already drawing in a fraction of the time needed to maintain 60fps, so at this point it is really just optimizing for the sake of optimizing. Removing the window background had the side effect of a lap time screen without a background at all, leaving a hole in the UI and some freaky results. That was quickly resolved by setting a background color on that view.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">I've gone one step further in an experimental version, which results in 0 overdraw for most of the app, but there are still a few margins left with no background color, so it needs a little more work and testing.</span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Another minor change in 6.0.4 was in the animation timing code. The animation runnable was already using <a href="http://developer.android.com/reference/android/view/View.html#postInvalidateOnAnimation()">postInvalidateOnAnimation()</a> for JB+ devices, an optimization to cause redraws to happen on the next display frame:</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> if(JELLYBEAN_OR_ABOVE) postInvalidateOnAnimation();<br /> else invalidate();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">However, <a href="https://plus.google.com/+ChrisBanes">+ChrisBanes</a> pointed out that there is a version of this in <a href="http://developer.android.com/reference/android/support/v4/view/ViewCompat.html">ViewCompat</a>. ViewCompat is a backwards compatible helper provided in the <a href="http://developer.android.com/tools/extras/support-library.html">Support Library</a> for accessing </span><span style="font-family: Courier New, Courier, monospace;">View</span><span style="font-family: Arial, Helvetica, sans-serif;"> features introduced after API level 4. So, the custom view animation runnable now looks like this:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> //Stopwatch animation runnable</span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> private final Runnable animator = new Runnable() {</span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> @Override</span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> public void run() {</span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> updateWatchState(false);</span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> if(mIsRunning)</span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> {</span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> invalidate();</span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> removeCallbacks(this);</span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> <b>ViewCompat.postOnAnimation(StopwatchCustomView.this, this);</b></span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> }</span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> }</span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> };</span></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Which is more pleasing to the eye, easier to understand for devs reading the code and would benefit from any future advances in ViewCompat.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br />There are also a couple of other bug fixes in this release:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">Issue #42: Fixed - Hands don't reset on Stopwatch when hand animations turned off.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">Issue #47: Fixed - Ticking sounds go wrong during onPause onResume cycle.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">As always the full source code to Ultimate Stopwatch is available at <a href="https://code.google.com/p/android-ultimatestopwatch">https://code.google.com/p/android-ultimatestopwatch</a></span><br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com0tag:blogger.com,1999:blog-32005942.post-89299281084762135832013-02-23T16:12:00.000+00:002013-07-01T16:40:06.873+00:00Custom Paint Job: Accelerating the Ultimate Stopwatch<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd-gW6YQ5IKJuICpjLJ4jKFAGUwsnvctSnOTxHMZTjgeddasWBj1z74ROZ5LTtLYajGYE5Uh5TOt0udjFKkrQatkkVMwFUgpJYTBuG76RWGC64pumfF-y_8L-AwRc1dA4ATTH2NQ/s1600/usw_ss2+face.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd-gW6YQ5IKJuICpjLJ4jKFAGUwsnvctSnOTxHMZTjgeddasWBj1z74ROZ5LTtLYajGYE5Uh5TOt0udjFKkrQatkkVMwFUgpJYTBuG76RWGC64pumfF-y_8L-AwRc1dA4ATTH2NQ/s200/usw_ss2+face.png" width="195" /></a></div>
<span style="font-family: Arial, Helvetica, sans-serif;">(Edit - 1st July 2013: Animator runnable updated again and one more layer of overdraw removed, details in <a href="http://geekyouup.blogspot.co.uk/2013/07/ultimate-stopwatch-version-604.html">new blog post</a></span><span style="font-family: Arial, Helvetica, sans-serif;">)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Creating a custom Android view in 2013 isn't exactly breaking new ground, but the time was long overdue to relegate the old </span><a href="http://developer.android.com/reference/android/view/SurfaceView.html" style="font-family: Arial, Helvetica, sans-serif;">SurfaceView</a><span style="font-family: Arial, Helvetica, sans-serif;"> to history and move on; a task I was looking forward to but had kept putting off. Anyway, </span><a class="g-profile" href="http://plus.google.com/115374955104579332297" style="font-family: Arial, Helvetica, sans-serif;" target="_blank">+Marie Schweiz</a><span style="font-family: Arial, Helvetica, sans-serif;">'s great new </span><a href="https://play.google.com/store/apps/details?id=com.geekyouup.android.ustopwatch" style="font-family: Arial, Helvetica, sans-serif;">Ultimate Stopwatch</a><span style="font-family: Arial, Helvetica, sans-serif;"> designs deserved a hardware accelerated home.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">The <a href="http://developer.android.com/training/custom-views/index.html">Android Developers training class</a> breaks down the job of developing a Custom view into a few simple steps:
</span><br />
<ol style="text-align: left;">
<li><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Subclass a View</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Implement custom drawing</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Make the view interactive</span></li>
</ol>
<div>
<div style="text-align: left;">
<span style="font-family: arial, sans-serif;"><span style="line-height: 18px;">In practice, when it came to the animations I also grabbed a couple of hints from <a href="https://twitter.com/andersericsson">Anders Ericsson</a>'s <a href="http://www.jayway.com/2012/08/29/creating-custom-android-views-part-3-animating-your-custom-views-smoothly/">post at JayWay</a>, as the mental model is also slightly different and I'd seen his related talk at Droidcon London 2012. In the SurfaceView I had a thread constantly looping to call the update/draw methods, however in a custom view it will redraw each time you call <a href="http://developer.android.com/reference/android/view/View.html#invalidate()">invalidate()</a>. So, instead of a looping thread I can just call invalidate() after each cycle completes to start the next paint. This is done by posting a runnable to the View's message queue, I'm aiming for 15ms update cycles for just over 60fps.</span></span><br />
<span style="font-family: arial, sans-serif;"><span style="line-height: 18px;"><br /></span></span></div>
</div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> private Runnable animator = new Runnable() {</span></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;"> @Override</span></span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small; line-height: 18px;"> public void run() {</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small; line-height: 18px;"> updateWatchTime();</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small; line-height: 18px;"> invalidate();</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small; line-height: 18px;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small; line-height: 18px;"> if (mIsRunning) postDelayed(this, 15);</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small; line-height: 18px;"> }</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small; line-height: 18px;"> };</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">The onDraw() methods from my SurfaceView and Custom view are identical, so just a copy and paste job there. The onTouch() and Activity communications handler also remained untouched. So in the end the Custom view is considerably simpler as there is no surface creation/destruction to worry about or separate thread to maintain.</span></div>
</div>
</div>
</div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">A really nice feature of a Custom view is the ability to configure your own XML attributes. Previously I had to instantiate the SurfaceView and pass in details on whether it should represent the Stopwatch or Countdown view, with a Custom view I can add the following into </span><span style="font-family: Courier New, Courier, monospace;">attrs.xml</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <resources></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <declare-styleable name="StopwatchCustomView"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <attr name="watchType" format="enum"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <enum name="stopwatch" value="1"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <enum name="countdown" value="0"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </attr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </declare-styleable></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </resources></span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Then by adding the name space </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">xmlns:custom="http://schemas.android.com/apk/res-auto" </span><span style="font-family: Arial, Helvetica, sans-serif;">in my layout, I can use the attribute </span><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">custom:watchType="stopwatch" </span><span style="font-family: Arial, Helvetica, sans-serif;">in the layout file and retrieve it in the code during instantiation. Being able to configure the custom view in XML can really simplify code and make the source easier to understand. Here is the code to retrieve the value:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<div style="line-height: 18px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> TypedArray a = context.getTheme().obtainStyledAttributes(</span></div>
<div style="line-height: 18px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> attrs,</span></div>
<div style="line-height: 18px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> R.styleable.StopwatchCustomView,</span></div>
<div style="line-height: 18px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> 0, 0);</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"> try{</span></div>
<div style="line-height: 18px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> isStopwatch = a.getBoolean(R.styleable.StopwatchCustomView_watchType,true);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> }finally{</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> a.recycle();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> }</span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">That's it. The view is hardware accelerated where available and due to some optimizations the refresh rate has also increased when h/w acceleration is absent.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Some small improvements were gained by refactoring, but the main increases were delivered using the '<a href="http://developer.android.com/about/versions/jelly-bean.html#42-dev-options">Show GPU overdraw</a>' feature of Android's Developer Options, which is now available as I'm using the GPU to draw. It's immediately clear that before optimization there's excessive overdraw, highlighted by the red areas. This was almost entirely down to background colours being set on layers that weren't visible; the ViewPager, the layout of the custom view and also in the onDraw() of the Custom View. Eliminating these unseen, but still drawn, background colours reduced the graphics load and improved performance.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPMgkccYV8DMKlby0mvTKTc33gUKba2E_3eYI0x_6w8WJlpgG75vMhRoo7eBQzlQU1eRuGwTEt_1jNtTgVg_5cp0H0Bk99rgyKbFh5CVbiLw0c5LwI7RaNYllzcdIrbHcjTCI3BA/s1600/old_usw_gpu_overdraw2.png" width="500" /></div>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Now we have a wondrous, hardware accelerated Custom view we're in a much better position to add some final flourishes to improve the application. Later I'll write about some custom animations I've added, as suggested by <a class="g-profile" href="http://plus.google.com/118292708268361843293" target="_blank">+Nick Butcher</a> to not only improve the perceived quality but also the usability.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><span style="font-family: Arial, Helvetica, sans-serif;">The Ultimate Stopwatch and Timer is open source at <a href="https://code.google.com/p/android-ultimatestopwatch/source/browse/#svn%2Ftrunk">android-ultimatestopwatch.googlecode.com</a>, designed by <a class="g-profile" href="http://plus.google.com/115374955104579332297" target="_blank">+Marie Schweiz</a> and makes use of the awesome <a href="http://actionbarsherlock.com/">ActionBarSherlock</a> by <a href="https://plus.google.com/108284392618554783657/posts">Jake Wharton</a>.</span></div>
Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com1tag:blogger.com,1999:blog-32005942.post-25505506163514875082012-01-06T16:46:00.002+00:002013-02-23T14:50:46.057+00:00Ultimate Stopwatch & Timer finally updated!<div class="separator" style="clear: both; text-align: center;"><img style="float:right;" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF0-ghYFl1RUcDkTKjw-iajwaj8itCDi_yJzaPfhxE6n6J968cB7vjHDF_6sB-TmlMuO9v3lXfuIBldu_1OdK_ZyQDOomkWEcvF325NUUA1UNUqRyW9T-5XUDpMMGOCicT5uR02w/s320/usw_ss1.png" /></div>Finally after almost a year of good intent, the updated version of Ultimate Stopwatch & Timer for Android has just gone live, v5.0.0. It'll be making its way through the interweb caches to an Android Market near you soon.<br />
<br />
Thank you so much +Marie Schweiz (http://marie-schweiz.de/) for your awesome designs!<br />
<br />
Updates:<br />
- New clean design<br />
- Action Bar on all versions (using ActionBarCompat)<br />
- Touch feedback on all elements<br />
- Light face for stopwatch, Dark face for countdown<br />
- Lap Times separated out<br />
- Built for Android 4.0 with support for versions 2.0+<br />
- Portrait / Landscape layouts for all sceen sizes including QVGA and Tablets <br />
<br />
Big fixes:<br />
- Sporadic countdown alarm notifications fixed<br />
- Galaxy Tab time appearance fixed<br />
- QVGA layouts fixed<br />
- Other minor issues resolved<br />
<br />
Source available at http://android-ultimatestopwatch.googlecode.com<br />
Comments and questions to the post on Google+ please so I can respond https://plus.google.com/u/0/115995639636688350464/posts/KhqUhC1ezB4
Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com2tag:blogger.com,1999:blog-32005942.post-74304041232789010002011-12-19T15:21:00.000+00:002011-12-19T15:21:35.402+00:00Android 4.0 ADB Backup / Restore<div class="separator" style="clear: both; text-align: center;"><a href="https://lh4.ggpht.com/9l3sUROhFWL143s45foZNGi9QC4gFuEihlyCswOhvyZ9DpT5Pmm-3XSVd0AmRc_tXz7x=w124" imageanchor="1" style="clear:right; float:right; margin-left:1em; margin-bottom:1em"><img border="0" height="124" width="124" src="https://lh4.ggpht.com/9l3sUROhFWL143s45foZNGi9QC4gFuEihlyCswOhvyZ9DpT5Pmm-3XSVd0AmRc_tXz7x=w124" /></a></div>Android 4.0 ADB Backup/Restore<br />
I switch phones quite a bit and the cloud is immensely useful for that, almost all of my #Android apps restore and most of the data is up there, even my wifi settings and wallpaper get reinstalled. But games are still lagging behind on this, they rarely keep their settings in the cloud or give a backup/restore option.<br />
<br />
I really didn't want to lose my 'World of Goo' progress so I've just used adb backup/restore to pull it off one ICS device and push it onto another. Worked a treat.<br />
<br />
The command lines I used:<br />
> <i>adb backup -f worldofgoo.bak com.twodboy.worldofgoofull</i><br />
and a little dialog appears on the phone screen to confirm the backup and offer the chance to enter a password to protect.<br />
<br />
> <i>adb restore worldofgoo.bak</i><br />
and another little dialog appears to confirm the restore<br />
<br />
et voila, done. Other options on adb backup allow for full user data backups (-all), just type adb to see all options.<br />
<br />
<br />
<b>adb backup</b> [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]<br />
- write an archive of the device's data to <file>.<br />
If no -f option is supplied then the data is written<br />
to "backup.ab" in the current directory.<br />
(-apk|-noapk enable/disable backup of the .apks themselves<br />
in the archive; the default is noapk.)<br />
(-shared|-noshared enable/disable backup of the device's<br />
shared storage / SD card contents; the default is noshared.)<br />
(-all means to back up all installed applications)<br />
(-system|-nosystem toggles whether -all automatically includes<br />
system applications; the default is to include system apps)<br />
(<packages...> is the list of applications to be backed up. If<br />
the -all or -shared flags are passed, then the package<br />
list is optional. Applications explicitly given on the<br />
command line will be included even if -nosystem would<br />
ordinarily cause them to be omitted.)<br />
<br />
<b>adb restore</b> <file> - restore device contents from the <file> backup archiveAnonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com4tag:blogger.com,1999:blog-32005942.post-68249193915301504492011-07-23T06:11:00.015+00:002011-07-26T15:50:23.565+00:00ViewPager example from PAUGDuring a recent session at the Paris Android User Group (hi <a href="http://www.meetup.com/Android-Paris/">PAUG</a>!) we did a live coding of a ViewPager example, it took around 5 minutes. What is a ViewPager? It is a tasty new class smothered in awesome sauce on a bed of rocking adapters, seriously I think I may use at least one in every Android app I make from now on. It was released as part of the updated <a href="http://developer.android.com/sdk/compatibility-library.html">Compatibility Package</a>.<br /><br /><iframe width="480" height="300" src="http://www.youtube.com/embed/50-UaNZF_xM" frameborder="0" allowfullscreen></iframe> White on green was a great choice, right? very.... visible.<br /><br />If you search for 'android view pager' you'll see many questions on how to implement smooth, finger tracking, horizontal view paging in Android, so it seems appropriate the solution is called ViewPager. ViewPager was launched at the end of last week as part of the updated Compatibility package and supports Android 1.6+.<br /><br />Some of you may have been aware of the Workspace example open sourced with the <a href="http://code.google.com/p/iosched/">I/O Sched</a> app. An important difference between ViewPager and Workspace is that ViewPager pulls its views from an adapter, so like with a ListView as the items are slid off the screen they can be recycled and/or brought back in on the right side of the screen. The sample code for ViewPager shows this being done with a FragmentPagerAdapter, where each view is a fragment, giving you an amazing amount of control over your application.<br /><br />In this example we are just sliding TextViews on and off the screen, here is the complete guide:<br /><br />1) Download the update from Android SDK & AVD manager: Available Packages -> Android Repository -> Android Compatibility Package, revision 3. It will be installed in <android-sdk>\extras\android\compatibility\v4<br /><br />2) Create a new Android Project (I'm using Eclipse) and include the library. Properties -> Java Build Path -> Libraries -> Add External JARs -> android-support-v4.jar, it is in the install directory.<br />Update: As <a href="http://blog.tomtasche.at/">Thomas</a> says if you're using the latest ADT you can now just right-click on your project -> Android Tools -> Add Compatibility Library<br /><br />3) Your should now be able to use ViewPager in your Activity<br /><br />4) If you use ViewPager in an xml layout, be sure to use the full reference, e.g.<br /><span style="font-style:italic;"><br /><android.support.v4.view.ViewPager<br /> android:layout_width="match_parent" <br /> android:layout_height="match_parent" <br /> android:id="@+id/awesomepager"/></span><br /><br />5) Create a PagerAdapter to serve up your Views to the ViewPager. The key methods to implement are getCount(), instantiateItem(), destroyItem() and isViewFromObject() here are <a href="http://code.google.com/p/viewpagerexample/source/browse/trunk/AwesomePager/src/com/geekyouup/paug/awesomepager/AwesomePagerActivity.java">my implementations</a> along with some JavaDoc from the source. <br /><br />Note: It is up to the developer to add the views they are creating in instantiateItem() to the collection being passed in. The converse applies to destroyItem(), you must remove the item from the collection. The collection in this example is the ViewPager that is using the PagerAdapter.<br /><br />The complete project source is at <a href="http://code.google.com/p/viewpagerexample/">http://code.google.com/p/viewpagerexample/</a><br /><br />A more professional and complete example can be found in the Compatibility Package samples (in the install directory), where a FragmentPagerAdapter implementation is provided. Using fragments inside a ViewPager can provide much better structure to an application as each view has its own FragmentActivity.Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com43tag:blogger.com,1999:blog-32005942.post-51601438986209735422011-06-21T06:08:00.014+00:002011-06-24T17:09:18.905+00:00Supporting Honeycomb pt2: Updating the Ultimate Stopwatch<img style="float:right; margin:0 0 10px 10px;width: 192px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimUiY1PvyMl6KrqR2AYyUssu_cd-2I-xc7DDDE8bYgvskhj5utQC7m9LV5z4ZlIkSVbsZ23lHA7NeaN9dn9x6wIgK8PuTrVKn5t9ZvMrrzHjbnoPPE-gc_afxhXYwocqv6NHbRBQ/s320/hdpi_screenshot1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5621810215893967426" />For most developers, taking advantage of the features of Honeycomb is also going to involve ensuring their app runs on tablets. It is one thing to do this right from the inception of an app or game, but often a much harder task to upgrade an already complete project to look great on larger screens.<br /><br />If your app has multiple views then you can utilise <a href="http://developer.android.com/guide/topics/fundamentals/fragments.html">fragments</a> to show more than one of them at the same time. If not then you can think about any other data or views that may be able to augment it, or possibly increase the size of some elements.<br /><br />In the case of the Ultimate Stopwatch the counting digits clearly need to be larger, then the remaining screen space can be used to include an easier to access list of lap times and split times. I mocked up some wire frames and settled on the following design.<br /><br /><img style="display:block; margin:0px auto 10px; text-align:center;width: 500px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9MdGlMqde6g9ZBhcAOveXk7IxGU0AJ7aLF2tLruISNLq7wSkymUyXZz9wwim1wrZOizWLK-060J1V3aZHabRJSjO4eGx2bQXYp_chyphenhyphengHvGgM8NJ4hn1VljTJ-R7E6m3VkoDrUuQ/s1600/hc_screenshot.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5621810086841465506" /><br />So how do you make this magic happen? Well, as the Ultimate Stopwatch uses a SurfaceView and I spent so long getting the small screen UI right, I didn't really want to mess with it, so I'm going to leave it alone and just add new layouts for x-large devices. For many apps, especially those using standard layouts, it is less of an issue and the <a href="http://android-developers.blogspot.com/2011/03/fragments-for-all.html">Android Compatibility package</a> is the best option for a consistent application. I am however going to use fragments for the new layouts, to give me the best control over the larger screen whilst keeping my class files smaller. I'll have a fragment for the animated stopwatch view, one for the counter digits and one for the lap times.<br /><br />1. In your project properties set the Android Build Target to 11<br /><br />2. Tell Android that your app is optimised for Honeycomb by updating the androidmanifest.xml by adding <span style="font-style:italic;"><uses-sdk android:targetSdkVersion="11" /></span> as per my last <a href="http://geekyouup.blogspot.com/2011/05/supporting-honeycomb-pt1.html">post</a>, which also shows how to enable hardware acceleration for good measure.<br /><br />3. To totally segment my previous code I created a <a href="http://code.google.com/p/android-ultimatestopwatch/source/browse/trunk/stopwatch/src/com/geekyouup/android/ustopwatch/UltimateStopwatchLauncher.java">new Activity</a> which decides which version of the app to launch based on OS version and screen size, not forgetting to update the <a href="http://code.google.com/p/android-ultimatestopwatch/source/browse/trunk/stopwatch/AndroidManifest.xml">AndroidManifest.xml</a>.<br /><br /><img style="float:right; margin:0 0 10px 10px;width: 200px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv_5kLFHJRW-o9zXYKr_nx92a4R2hV3q98og6O_tEyLytqMtY_2-pCZg2P30DnPFmglXygiBvBuAYIYKSUXyYGCODBxkkfdykx8ujr5x5cfE5Pueul1FyXEr3H2AjYqxWFHlRGxw/s320/hc_screenshot_portrait.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5621821056828842434" />4. I've done custom layouts for both landscape and portrait to give optimal experiences. As I'd used fragments it made the portrait view much easier, it only took a couple of minutes.<br /><br />5. Another thing to remember is that your menu items will now appear in the Action Bar. It is good practice to let Android know which items it can hide under the overflow button if necessary by appending <span style="font-style:italic;">android:showAsAction="ifRoom"</span> in to the item in your <a href="http://code.google.com/p/android-ultimatestopwatch/source/browse/trunk/stopwatch/res/menu/menu.xml">Menu.xml</a>.<br /><br />6. When building the layouts and activities, be mindful of the <a href="http://developer.android.com/guide/topics/fundamentals/fragments.html">fragment lifecycle</a>, making sure to inflate your views in the onCreateView() method.<br /><br />7. To add a little more Honeycomb goodness I also used <a href="http://developer.android.com/reference/android/animation/ObjectAnimator.html">ObjectAnimator</a> to do a 180 degree animation on the lap times fragment when switching to Countdown Mode and back again, this hides the times and informs the user of the mode the app is in. I also freshened up the Countdown time select dialog with the new <a href="http://developer.android.com/reference/android/widget/NumberPicker.html">NumberPicker</a>.<br /><br /><img style="display:block; margin:0px auto 10px; text-align:center;width: 320px; height: 197px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPRxdfbX5TAkrx74WHF6URba4ZyGVwlV1-g2TW4S00tdwLod8LoHDIR0zPQB7q_lb5_-1MD8FAsFgBNt859L2qwMxaRUzFIskY-IFFXSgGT5ic5BAW9KkzkfTsGVmsVCY1aZGNWA/s320/hc_screenshot3_cdnp.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5621814818064285618" /><br />Launching this update was also a great opportunity to refresh the <a href="https://market.android.com/details?id=com.geekyouup.android.ustopwatch">Android Market listing</a>, adding new screenshots, featured image and descriptions.<br /><br />The full source of the Ultimate Stopwatch & Timer is available at <a href="http://code.google.com/p/android-ultimatestopwatch/">http://code.google.com/p/android-ultimatestopwatch/</a><br /><br />For those of you who want to know how USW looked in landscape on a tablet before this overhaul, prepare yourselves:<br /><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEWqKd-yej4rq17Kv6GXnzwTIPgCTK6P5dkDBp1hu1_YnQhkBm0s2Tnctu3Dqim79-nZus4olh1OfD_J00DPas9dj1HFhqMZY2pg6MHowHPIilCpHoyNRhxs2j7sLQzHVGCVRKQA/s1600/hc_old_screenshot.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5621834119327271138" /><br /><br /><a href="http://twitter.com/geekyouup">Follow me</a> on twitter for further Android related updates.Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com2tag:blogger.com,1999:blog-32005942.post-44796067421199608142011-05-21T15:59:00.023+00:002011-05-31T11:28:36.439+00:00Supporting Honeycomb pt1: targetSdkVersion=11<img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 51px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMaZIuvED6y10FHC4y36ifGF7HqimxS-u-RHovLBsZP9xUF-eBXgr9wH6VdhXiP0bGBuwsRgnjc1ytV0DkPwNHu9qN4-DvTpkhpsdAAYvn81pW9lsoYvfuGWJtnwVehoiUGWTzNA/s320/hc2.png" alt="" id="BLOGGER_PHOTO_ID_5609525217731721490" border="0"><br /><br />Since the day I started at Google I've been trying to find the time to update all of my Android apps to support Honeycomb. However, I'm into my 3rd month and various distractions, like the awesome I/O, have meant that I haven't touched any of them.<br /><br /><img style="float:right" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglhZ8dwG2-2F1qXw51sCDhjT0CRNYhz27glNa0b5UyvfgzGUDligQVmmUFupMjcYufGtQybvUO6GO4wEAja5ks4cWlll9m7jOYTqVVFEkVJvA3rcFxDE3bSqS-pl-W88NbAIN4Ug/s320/icon.png" border="0">So, here we go, part 1, Honeycomb support for 3 of the 9 apps I have live in the Android Market. I'll confess now that I've chosen the easiest 3, in fact they are all so easy that there is just one line to change. The apps are Auto Bright, Dimmer (Night Mode) and The Cleaner.<br /><br />These apps all run in compatibility mode on Honeycomb, which means it shows the 'menu button' in the system bar to the right of the previous tasks, home and back buttons. To sort this out all you have to do is update the AndroidManifest to ensure it includes:<br /><br /><font style="font-style:italic;" size="2"><uses-sdk android:targetSdkVersion="11"/></font><br /><br />Now that extra compatibility icon will vanish and technically these apps will support Honeycomb, perfect!<br /><br />For the sake of completeness I've taken this opportunity to also furnish 'The Cleaner' with support for Honeycomb's Lights out Mode. This mode reduces the system bar elements on a Honeycomb device to small dots, making them less distracting. It is usually used for immersive experiences in games, video players, image galleries, etc...<br /><br />To set Lights Out Mode on a view, just set the system UI visibility to STATUS_BAR_HIDDEN.<br /><font style="font-style:italic;" size="2"><br />v.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);</font><br /><br />--- Updated 24/05/2011 --- <br />As WarGoth points out there is no need to use reflection to maintain backwards compatibility, simply wrapping the code in an android.os.Build.VERSION.SDK_INT>=android.os.Build.VERSION_CODES.HONEYCOMB check is sufficient. Clarification in the comments from Weeds that this only applies to Android 2.0+, the class loader would throw a java.lang.VerifyError on 1.5/1.6.<br /><br /><font style="font-style:italic;" size="2">if(android.os.Build.VERSION.SDK_INT>=android.os.Build.VERSION_CODES.HONEYCOMB) {<br/> v.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);<br/>}</font><br />--- End ---<br /><br /><del>I did it slightly differently by using reflection to maintain compatibility with older versions of Android without duplicating classes:<br /><br /><font style="font-style:italic;" size="2">Class classView = Class.forName("android.view.View");<br />Method methodSetSystemUIVisibility = classView.getDeclaredMethod("setSystemUiVisibility", int.class);<br />methodSetSystemUIVisibility.invoke(v,1);</font></del><br /><br /><br />The full source of these apps is available on <a href="http://code.google.com/u/@UxlQS1ZWABFAVgN5/">Google Code</a><br /><br />Part 2 of this series will take on converting one of my more complicated applications.Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com12tag:blogger.com,1999:blog-32005942.post-35765973356563811692010-12-21T10:00:00.009+00:002010-12-21T10:46:59.954+00:00Android Nexus 1 Flashing - assert failed: write_raw_image("/tmp/boot.img", "boot") - solved<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicqJsX8gPRYbWvhgW-pw-olJ4Ley7omm2-6MeXsZna2U3pDFAlOdiqvcsCeY_5OfwbsjaquTTQKQvnGbKBep51ntHZF8f3lwwmS7yyDiuML7ECSO5MPuk2XYKDW9YbvpyU-bsOnQ/s1600/gingerbread.png"><img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400x;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicqJsX8gPRYbWvhgW-pw-olJ4Ley7omm2-6MeXsZna2U3pDFAlOdiqvcsCeY_5OfwbsjaquTTQKQvnGbKBep51ntHZF8f3lwwmS7yyDiuML7ECSO5MPuk2XYKDW9YbvpyU-bsOnQ/s320/gingerbread.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5553081508862146946" /></a><div>NOTE: I've since noticed that WiFi doesn't work with the method outlined below, however it does work with "fastboot boot boot.img" so further investigation is required. Some other users are saying that reflashing the hboot helps, but there are drawbacks to that as well.... Still if you are having this error and want to try gingerbread asap then the solution below is good:<br /><br />It is a fun error isn't it, thousands of Nexus 1 users are happily flashing the latest ROMs onto their devices with no issues and when you try it you get something a little like this:</div><span style="font-style:italic;"><br />Installing update...<br />assert failed: write_raw_image("/tmp/boot.img", "boot")<br />E:Error in /sdcard/update.zip<br />(Status 7)<br />Installation aborted.</span><br /><br />Same here, however there is light at the end of the tunnel. The problem is a lack of space to flash the new boot image, the cause could be one of two things:<br /><br />1) You have some corrupted memory in the boot space, shrinking the size of the available boot partition and not allowing larger boot images to reside there.<br />2) This is a guess and I'd be interested in feedback: The Nexus 1 I use for custom ROMs is from the very very first Google seeding back in late 2009. I wonder if these devices had slightly smaller boot partitions.<br /><br />Either way, there is a solution! The boot partition and the recovery partition are physically very similar, so after flashing the latest Gingerbread ROM (Gingerbread-Rooted-Gapps-v.06-signed.zip in this case, from the awesome XDA forums), I do this:<br /><br />1) Extract boot.img from the ROMs zip file<br />2) Connect my N1 to my PC via USB<br />3) Boot the N1 into Fastboot by holding down the trackball when turning it on.<br />4) Flash the boot.img into the recovery partition: <br /><span style="font-style:italic;">"fastboot flash recovery boot.img"</span> (fastboot is in the platform-tools directory of the SDK these days)<br /><br />Now when I boot my Nexus 1 I hold down the trackball to get to Fastboot and then choose recovery mode, et voila Gingerbread launches.<br /><br />If you need to get back to a real recovery mode you can either boot into Fastboot then boot a recovery image from your PC e.g. "fastboot boot recovery-RA-nexus-v2.0.0-CM.img"<br />Or reflash a recovery image, do your thing and then reflash the boot image.<br /><br />I found this trick out at XDA Forums (where else?), here http://forum.xda-developers.com/showthread.php?t=731657Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com9tag:blogger.com,1999:blog-32005942.post-34362893699847959452010-12-01T09:49:00.005+00:002010-12-01T10:13:17.197+00:001 day into a relationship with the SonyEricsson LiveView<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglm4MwlP79IpGE4NeUj3IZs9Q6TMdUkLjPlx3IiBA7KJV9mjeRg0X46Q5PdpuY9DDJBCwv6LLw2lPQpw4uxmBOxe_XlNLuoiCEo0VoN-eoP2E7sJtNJCRx-qYJBDNSOOcCbfoc3w/s1600/sonyericsson-liveview.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 142px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglm4MwlP79IpGE4NeUj3IZs9Q6TMdUkLjPlx3IiBA7KJV9mjeRg0X46Q5PdpuY9DDJBCwv6LLw2lPQpw4uxmBOxe_XlNLuoiCEo0VoN-eoP2E7sJtNJCRx-qYJBDNSOOcCbfoc3w/s200/sonyericsson-liveview.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5545653707429523906" /></a>I absolutely love its geekiness. I'm running it with a stock Nexus 1 on 2.2.1. Yes It does disconnect all the time and I spend quite a lot of time turning it off and on again, re-pairing the bluetooth and generally willing it into life. But, I'll definitely knock a couple of apps up for it in the hope that SonyEricsson make a second generation device with a higher res screen, full touch support and a longer battery life. Some say the battery life is pathetic, but that is an understatement, a watch that doesn't get through half a day is crazy. <br /><br />So far the best use for it is remote controlling the music players, i've had no problem with the built in Music remote control and my Nexus 1. It supports play/pause, volume control, next/previous track. The Where Am I plugin is ok, brings up a map of your current location on the LiveView. The GMail and SMS plugins don't seem particularly reliable, but I'll keep persisting.Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com0tag:blogger.com,1999:blog-32005942.post-90340248318963266572010-08-24T07:12:00.013+00:002010-08-24T07:24:56.633+00:00Providing your Android Activity with a Theme<img style="float:right; margin:0 0px 10px 10px;width: 160px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaqe1DVhaKboJ-ZWI1TNCqv9sevexmz4fkwQ762NTdJdonRliLwg8oIyrnfAVQXH9KgemaOVxyr6dXv7-Q_z85jYNj_VHTaG3nId72-n5bVssSwAVK31VDfgAPNpo-dxsk0hZ4UQ/s200/techwidget_ss2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5508873119622855906" />I've recently been asked a couple of times by new Android developers how 'Tech Buzz Widget' manages to overlay itself ontop of the desktop, allowing your wallpaper to show through. Assuming that it is easier to Google the answer than ask me, it may be somethiing that there isn't enough detail on already. So here is my 10 cents.<br /><br />The main detail is to set the correct android:theme for your activity in the AndroidManifest.xml. For Tech Buzz Widget we used <i>android:theme="@android:style/Theme.Translucent.NoTitleBar"</i><br /><br />So the activity looked like this:<br /><br /><i><activity android:name=".FullArticleView" class=".FullArticleView"<br /> android:theme="@android:style/Theme.Translucent.NoTitleBar"<br /> android:configChanges="orientation|keyboardHidden"><br /> <intent-filter><br /> <action android:name="android.intent.action.MAIN" /><br /> </intent-filter><br /></activity></i><br /><br />Once you've done that you you'll see that any elements of your layout that are transparent or unfilled will show through onto the underlying application or desktop. To make this more obvious in Tech Buzz we put a margin around the entire layout.<br /><br />The exact details of all the activity themes available in the current Android platform are available in the Android source here: <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/themes.xml">http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/themes.xml</a><br /><br />Search for Theme.Translucent and you'll get the idea. There are fullscreen themes as well if you want to get rid of the notification bar. You can also define your own themes in a similar way.Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com0tag:blogger.com,1999:blog-32005942.post-10274210684427586572010-06-15T08:34:00.009+00:002010-06-15T09:00:37.452+00:001 Million Installs of Battery Widget for Android!!<img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_J6CKbf2-0m8sxjqwcmsQEMZBLr4pOYR0I386hwJSNbayyuzT32O6zF6NfYDXjloXyRSqYB4ZQE2hxgol7w0s0mn21mrbjd6uWuHkqsxKvYJXASa19wvaXxGQZuZbrYJTy1jbPg/s1600/BatteryWidget1million.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5482917317399406306" /><br />As far as milestones go I'm thinking that this is a pretty big one. I've just returned from a trip to the Le Mans 24 hour race to find out that the first Android app that I submitted to the Market has shot through 1m installs. Fingers crossed that this is the one that gets you an E-mail from Mr Rubin ;)<br /><br />Battery Widget is currently ranked 24th 'top free' application in the Productivity category in the UK and has been in the top 30 for over a year with a top 5 spot for a while. I'm thinking it may be time to revisit the app and sharpen it up for the higher res screens of today's Android devices and allow a few different colour combinations.<br /><br />Although I'm super happy that Battery Widget is staying up the Android charts it is a double edged sword. As an Android fan-boi super-user fanatic there is definitely still an issue with freshness and churn in the top spots of the Free/Paid Android apps/games in the Market. The Market algorithm that is keeping Battery Widget up near the top for over a year is also making it hard for new apps to break through and for me as a user to find those exciting new applications. I'd 100% definitely sacrifice the popularity of this app for a more harsh ranking of older applications. I wonder what it would take now for a new application to enter the store and knock Battery Widget down a spot or two? It is still getting more new installs a day than all of my other apps combined. <br /><br />You may say that the Market is favouring new Android users and making it easier for them to setup their devices with top apps, but there should be a better way for long time users of discovering new awesomeness without trawling through hundreds of pages of 'Just In' apps. The awesome apps are out there and I usually find multiple new great apps or games each time I have 15+ minutes to spare to 'trawl'. No doubt Google are fully aware of this and it'll just be a matter of time.<br /><br />Thanks to all who have downloaded! Here's to the next Million.Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com11tag:blogger.com,1999:blog-32005942.post-75462296397813780702010-04-12T09:16:00.011+00:002010-04-12T09:38:53.194+00:00Creating an Android Activity with no UI<img src="http://fs01.androidpit.de/aico/x65/192265.png" align="left"/><img align="right" src="http://fs01.androidpit.de/aqr/x53/300553.png"/>Since I released <a href="http://www.androidpit.com/en/android/market/apps/app/com.geekyouup.android.dimmer/Dimmer">'Dimmer (Night Mode)'</a> into the Android Market I've had a few Android devs asking how to create Activity based applications with no UI.<br />The answer is that you need to set the activity theme in the manifest, for dimmer I use:<br /><br/><span style="font-style:italic;">android:theme="@android:style/Theme.Translucent.NoTitleBar"</span><br/><br />like this in AndroidManifest.xml:<br /><br/><span style="font-style:italic;"><activity android:name=".Dimmer"<br /> android:theme="@android:style/Theme.Translucent.NoTitleBar"<br /> android:label="@string/app_name"><br /> <intent-filter><br /> <action android:name="android.intent.action.MAIN" /><br /> <category android:name="android.intent.category.LAUNCHER" /><br /> </intent-filter><br /></activity></span><br/><br />The latest set of activity themes are defined in /res/values/themes.xml in the <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/themes.xml;h=6b3d7407d1c895a3c297e60d5beac98e2d34c271;hb=HEAD">Android source here</a>.<br /><br />Which may not be particularly user friendly but it also demonstrates how you can create your own activity themes in your own /res/values/themes.xml if you so desire.<br /><br />Note I'm not using the theme 'NoDisplay' as I do actually show notifications on the screen as the Activity is going about its business.Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com1tag:blogger.com,1999:blog-32005942.post-68510065396526163192010-02-21T08:14:00.015+00:002010-02-21T09:33:33.356+00:00Getting Started with a Nexus 1 - Apps, Hints & TipsQuite a few of my friends, especially in the mobile industry, have aquired Nexus One's recently and more often than not it is their first foray into the world of Android. <br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQkEdXWrhCRXUQO8CqeiwfNTXv0FMiL_Wllr4twE_MvQGVw0JxKKF4Pn3R-ud6kDtQ3fMKMQW2It3gYrnnCYLMI09Ih82iwegP6lR_nQRHRmkClswHFcVSYxOxREzODEYzALO_Sw/s1600-h/nexus-1.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQkEdXWrhCRXUQO8CqeiwfNTXv0FMiL_Wllr4twE_MvQGVw0JxKKF4Pn3R-ud6kDtQ3fMKMQW2It3gYrnnCYLMI09Ih82iwegP6lR_nQRHRmkClswHFcVSYxOxREzODEYzALO_Sw/s320/nexus-1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5440623810635040418" /></a><br />Over the last couple of days I've been asked to help set several of them up with my preferred settings, applications, games, etc... So I'll maintain this post and from now on I can point people here.<br /><br /><span style="font-weight:bold;">First Boot</span><br />First and most importantly is that if you have multiple G-Mail and Google Apps accounts, make sure you sign in with your 'primary' one first. The N1 may have multiple GMail account support but it will only sync one calendar, the first one you enter. Also the first sync is going to use a whole bunch of data, so best to be on wifi.<br /><br />If you received your Nexus 1 at MWC 2010 it will now inform you that a firmware update is ready. This update adds multi-touch support to the Browser, Gallery and Google Maps, go for it, it doesn't take long.<br /><br /><span style="font-weight:bold;">Android Usage Hints</span><br /><span style="font-weight:bold;">Notification Bar</span> - Top of the screen where the clock and battery level resides. New notifications from the apps on your phone will appear here. To see the detail of the notifications just drag the bar down.<br /><br /><span style="font-weight:bold;">Menu Button</span> - On the N1 it is the second button in, above the trackball, with the 4 lines on it. Most apps have a Menu and this button makes it appear. Holding the button for a second also forces the On Screen Keyboard to appear, which can be a useful override at times.<br /><br /><span style="font-weight:bold;">Home Button</span> - A bit like the button on the iPhone, always gets you back to your home screen. Hold it down to view the last 6 apps that you've run. These aren't necessarily still running.<br /><br /><span style="font-weight:bold;">Long Press</span> - One of the interaction metaphors in Android, especially on items shown in a list. It is akin to the right click in Windows. Just touch and hold an item for a couple of seconds and sometimes a context sensitive menu will appear.<br /><br /><span style="font-weight:bold;">Stars</span> - Look for small stars in the top right of UI's. They appear in G-Mail (you should know about them there for 'starring' mails), but they also appear on Google Maps for saving favourties if you long press on a location and touch the address bubble. Another place is in contacts, you can star a contact and then add a live-folder called 'Starred Contacts' to your home screen, keeping the most contacted people easy to access.<br /><br /><span style="font-weight:bold;">Widgets</span> - Android allows Widgets to be displayed on all 5 of your N1's home screens. Press the 'Menu' button, then Add, Widgets. If the 'Add' button is greyed out then you probably don't have enough space on the current home screen to add another widget, try swiping to another one first.<br /><br /><span style="font-weight:bold;">Shortcuts</span> - You can easily add shortcuts on your home screens, not only to apps but also Contacts, Bookmarks, etc. Go to Menu, Add, Shortcuts<br /><br />Folders - Very handy at keeping related shortcuts together. I have a Games folder on my desktop with shortcuts to all my games in it. To change the name of a folder, open it then long press on the current name, a change name dialog will appear.<br /><br /><span style="font-weight:bold;">Google Search box</span> / Search button: This little box or button can do a whole lot. It searches contacts, applications and the internet. Try it out, also supports voice search.<br /><br /><span style="font-weight:bold;">Settings</span><br />You can find your Nexus's settings by pressing the 'Menu' button, then selecting 'Settings'. For example I go into Settings -> Wireless & Networks -> Wi-Fi Settings -> Press 'Menu' Button -> Advanced -> Wi-Fi sleep policy, and set it to Never as I have issues with the N1 failing to reconnect to our office Network. Then I manage when wifi is on or off with the pre-installed 'Power Control' home screen widget.<br /><br />Auto Screen Brightness is useful at getting the best out of the N1's OLED screen and battery life, it is in Settings -> Sound & Display -> Brightness -> Automatic brightness<br /><br />Allow non-market application downloading/side-loading by going to Settings -> Applications -> Unknown sources<br /><br />Add a little security to your N1 by setting an unlock pattern in Settings -> Locations & Security -> Set unlock pattern. If you enter the wrong pattern too many times the phone locks up until you re-enter your G-Mail password.<br /><br />Check for System updates from time to time in Settings -> About Phone -> System Updates<br /><br />Also in 'About Phone' there is an item 'Battery use' which shows you a breakdown of which apps are using the most battery.<br /><br /><span style="font-weight:bold;">Applications</span><br /><span style="font-weight:bold;">Market:</span> This is your app-store now, get used to it. All the following apps are in there somewhere. NOTE: If you don't have a SIM card in your phone, or if the Android Market doesn't support payments in your country you will not see any paid apps. It's a feature.<br /><br /><span style="font-weight:bold;">Google Maps:</span> Updates to this are delivered via the Market, the latest update right now includes Multi-Touch and Google Buzz.<br /><br /><span style="font-weight:bold;">Google Listen:</span> Number 1 podcasting app for Android, search for your podcasts or import them and let it get on with it.<br /><br /><span style="font-weight:bold;">beebPlayer:</span> iPlayer for UK Android users, awesome, amazing, thank you.<br /><br /><span style="font-weight:bold;">Weather Widget - Free by Android Apps:</span> In my opinion the best looking weather widget in the Market, I use the 2x1 'Weather Small' varient.<br /><br /><span style="font-weight:bold;">Barcode Scanner:</span> QR Codes are a decent way of transferring data between devices, if this is installed you can not only scan QR Codes but also create them from Contacts, Clipboard, Bookmarks or Applications.<br /><br /><span style="font-weight:bold;">Seesmic:</span> My current fave Twitter client for Android<br /><br /><span style="font-weight:bold;">Flickr Droid:</span> One of several Flickr uploaders, does a decent enough job and adds a Share to Flickr intent into the Gallery sharing options.<br /><br /><span style="font-weight:bold;">London City / London Tube: </span>Both very valuable for someone who uses the London Underground frequently. Between them you get a decent map, line status's, routing and live departure boards (as widgets!)<br /><br /><span style="font-weight:bold;">Qik:</span> If you're into Qik'ing, then the Android client is solid.<br /><br /><span style="font-weight:bold;">gTasks:</span> Syncs with your G-Mail tasks lists if you have any.<br /><br /><span style="font-weight:bold;">Battery Widget:</span> (Yes it is one of mine) I like to know the exact battery level so I have this widget on one of my screens.<br /><br /><span style="font-weight:bold;">Tech/News/Gossip/Gaming Buzz Widgets & Buzz Deck:</span> A set of Widgets/Apps from us at Mippin to keep you upto date with the latest news in your chosen category.<br /><br /><span style="font-weight:bold;">Astro:</span> My favourite file manager for Android, always in beta but works well.<br /><br /><span style="font-weight:bold;">MP3 Store:</span> The Amazon MP3 store is preinstalled on the N1, has previews, special offers and can be a tad dangerous when drunk.<br /><br />Shazam, Ultimate Stopwatch (me again), Compass, Urban Spoon, i-Music, Google Googles are all also worth checking out<br /><br /><span style="font-weight:bold;">Games</span><br />Tower Defence games have taken off well on Android and there are quite a few around. The original was Plox, it is a year old now but worth a bash, the most popular is Robo Defence.<br /><br />There are also many 'Flight Control' style games, my fave right now is 'Air Control', smooth gameplay, online scores and suitably difficult.<br /><br />My top 3D games right now are Raging Thunder, Iron Sight, Breakout Legend<br /><br />I still also like a good card game, there are loads. <br /><br /><span style="font-weight:bold;">Live Wallpapers</span><br />The Nexus 1 is the first Android device to support animated, interactive Wallpapers. Check out the preinstalled ones by pressing the 'Menu' Button, then Wallpaper, and Live wallpapers.<br /><br />There are quite a few new ones now in the market including the 'Digital Rain' from the Matrix and my favourite 'Starfield 3D' which includes double tap for Hyper-space! I've knocked up 'Duck Paper' which is a Duck Hunt based Live Wallpaper, also available in the Market. We're intending on knocking a few more of these out over the next few weeks.<br /><br /><span style="font-weight:bold;">Rooting / Jail breaking</span><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinx-6YuPPyWTrc1jKqJbW6msZbn54BRVhHFnshyphenhyphenVpQ8r5p1yt7-Z-s069X3Y2ZTWJokhI2sV4fYBYuirCLU6V6SBAMhDun-ejXUf4IROA2WMvo0Zr8HTe6CWlrvYziUWloAiNO9Q/s1600-h/2010-02-21+08.36.46.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 121px; height: 200px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinx-6YuPPyWTrc1jKqJbW6msZbn54BRVhHFnshyphenhyphenVpQ8r5p1yt7-Z-s069X3Y2ZTWJokhI2sV4fYBYuirCLU6V6SBAMhDun-ejXUf4IROA2WMvo0Zr8HTe6CWlrvYziUWloAiNO9Q/s200/2010-02-21+08.36.46.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5440625144624918482" /></a><br />If you're top of your techy game and fancy being able to perform some more advanced functions on your Nexus 1 you need to get root access. Once done you'll be able to install apps for wired tether, wireless tether, screenshot, strobe light, boot animations, Apps to SD, no limits. You'll have super-user root access to your device in the terminal as well. The first stage of gaining root access is to unlock your bootloader, enabling the install of custom ROMs. Google were very clever about this and provided a simple method for doing it, but it warns you it will invalidate your warrenty and place an open padlock onto your boot screen.<br /><br />I followed the guide over at Android & Me: <a href="http://androidandme.com/2010/01/hacks/video-how-to-unlock-and-root-a-nexus-one/">http://androidandme.com/2010/01/hacks/video-how-to-unlock-and-root-a-nexus-one/</a><br /><br />Thanks for reading and happy Android'ingAnonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com13tag:blogger.com,1999:blog-32005942.post-15131087680145584792010-01-27T16:59:00.005+00:002010-01-27T17:24:52.255+00:00Android App Optimization: Using Reflection to test if an Android device is using 'Live Wallpapers'I agree this may be a a pretty rare usecase, but I've just spent an hour figuring the details out so I thought it only polite to share them. Oneday, someone, somewhere may benefit.<br /><br /><b>What is Reflection?</b><br/>It's been around almost as long as Java, described <a href="http://en.wikipedia.org/wiki/Reflection_%28computer_science%29">here</a> and examples from Sun <a href="http://java.sun.com/developer/technicalArticles/ALT/Reflection/">here</a><br/><br /><b>Why bother?</b><br/>We've been receiving complaints that our Buzz Widgets are lagging on the Google Nexus One when Live Wallpapers are enabled. A little testing showed that this was down to the apps blurring out the desktop and rendering the content on top of it. If the desktop has a Live Wallpaper running on it, then blurring it eats some serious processor cycles. I understand that Reflection is more costly than directly calling the APIs, but this is just one simple call.<br /><br /><b>Why use reflection, not the actual API?</b><br/>I'd much prefer to only have one version of each of our apps in the Android Market and the APIs for this only became available in the 2.1 SDK. Reflection enables us to use the APIs where available, whilst still letting the app run on devices with older firmwares.<br /><br /><b>How?</b><br/>Well to get to the point we want to perform the test<br/><br /><div style="font-size: 12px; font-style: italic"> if(WallpaperManager.getInstance(this).getWallpaperInfo() != null){//Live Paper, don't blur}</div><br />To do this with Reflection we have to use the methods Class.forName(""), Class.getDeclaredMethod() and Object.invoke() a little like this:<br/><br /><div style="font-size: 12px; font-style: italic"> <br />boolean blurBackground = true;<br />//get the WallpaperManager Class<br />Class classWallpaperManager = Class.forName("android.app.WallpaperManager");<br />if(classWallpaperManager != null)<br />{<br /> //find its .getInstance(this) method<br /> Method methodGetInstance = classWallpaperManager.getDeclaredMethod("getInstance", Context.class);<br /> //invoke the WallpaperManager's .getInstance(this) method to get one<br /> Object objWallpaperManager = methodGetInstance.invoke(classWallpaperManager, this);<br /> <br /> //discover the WallpaperManager Object's .getWallpaperInfo() Method<br /> Method methodGetWallpaperInfo = objWallpaperManager.getClass().getMethod("getWallpaperInfo", null);<br /> //invoke it<br /> Object objWallPaperInfo = methodGetWallpaperInfo.invoke(objWallpaperManager, null);<br /> if(objWallPaperInfo!=null)<br /> {<br /> Log.d("WidgetDroid","WallpaperInfo not null");<br /> blurBackground=false;<br /> }<br />}<br /></div><br />Also to ensure it is only run on Android 2.1+ devices I also wrap it in a quick Android Version check and a try/catch block for future safety:<br /><div style="font-size: 12px; font-style: italic">if(Double.parseDouble(android.os.Build.VERSION.RELEASE)>=2.1){...}</div><br />Job done, now if the device is using a Live Wallpaper the apps background isn't blurred and all is well again in our Widget World.Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com10tag:blogger.com,1999:blog-32005942.post-58587970298511915122010-01-25T10:23:00.012+00:002010-01-25T10:46:14.512+00:00The Android Market sweet spot & USW hits the 'final milestone'<img style="width: 410px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAw7jzMx2zlprN5o0fQnZVGkIMHCwTV9497b86GVc_GRIrkJ6WLOCxRK99HkgItwsJhpjaOF5xzpPSZu0pehAvmV6Qh0W8fvJzDxDmnL3X72gtN0y6T2AuRqJr8zPymCqqDWmqpA/s1600/USW_250k_3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5430621584647298402" /><br />The Ultimate Stopwatch & Timer for Android has just made it passed the 'final milestone' of 250,000 installs, great stuff. It's my second app to have reached the dizzy heights so far, the next is a couple of months away yet at around 150k. Seems like new device sales are keeping the install rates strong. Reaching 250k has a bizarre effect of dramatically increasing install rates. It is apparently a far more complelling proposition to install an app with >250k installs, almost as if the user starts believing they're missing out on something great. Battery Widget has rocketed from 250k to 450k installs in less than 2 months.<br /><br /><img align="left" style="width: 180px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUVi9i3GnQckTT8sQt9cNCF6Y5RiGyLOWLF_rvtxtARytUtFINufOqwpxLou0c0SrqNbAixRb7Ffyf34FBaZ-175aKs4gZAU_E8Tce9b5-X9sxaVC6Y3sr4jSPO1wcZYUnH8GRKg/s320/USW_250k.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5430621588563463458" /><img align="right" style="width: 180px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxk6GAYh9KBpL3Hli2f6TPN0MNiJWho8fnswuwUu9et8YobZ20ZOw4LP4eFsMeIfsQOTD-u11rS9O8_1qMaX1GpDO_Ouu7yh6GLDZ8I39CL_ZpMI0U1rTRlP4gTAyLRT8HfkfGWw/s320/USW_250k_2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5430621591503146130" /><br /><br /><div style="clear:both; display: block"><br />It seems, even though the Android Market is getting pretty busy these days, that if you focus on users desires it is still possible to get decent traction. Live Wallpapers are the sweet spot at the moment, they are being searched for by Nexus 1 users and a decent one will get thousands of downloads in the first week. I spent an hour creating 'Duck Paper' last week and it is now at 3,500 downloads. Content apps are a little trickier, especially if you don't have a recognised brand behind you, make them specific and easy to use, then update weekly.</div>Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com5tag:blogger.com,1999:blog-32005942.post-87884179655031469002010-01-12T15:54:00.010+00:002010-01-25T10:22:24.000+00:00Creating an Android 2.1 Live WallpaperQuick disclaimer: this isn't a tutorial, but a brief guide of what Live Wallpapers actually are and how I went about creating 'Duck Paper' - my first Android 2.1 Live Wallpaper. There are tutorials <a href="http://android.arnodenhond.com/tutorials/live-wallpaper">here, from Arno den Hond</a> and <a href="http://blog.androgames.net/58/android-live-wallpaper-tutorial/">here, from AndroGames.net</a><br /><br />The Android 2.1 SDK was released today and the only major update was Live Wallpapers, so I thought I'd better find out what they are all about. What I found was quite surprising, I'd imagined that they would be some sort of animation or video playing on the desktop, a bit like MS DreamScene, but actually they are more akin to a an Android application open as the desktop. Live Wallpapers extend the <a href="http://developer.android.com/reference/android/service/wallpaper/WallpaperService.html">WallpaperService</a> class and the animations and interactions are handled in code, just like in a game. Realising this it seemed reasonable to try and port the only game I've written for Android, Duck Hunt, into a Live Wallpaper.<br /><br />After less than an hour the first version of 'Duck Paper' was ready - as the ducks fly past in the background you can touch them to shoot them, then they fall off the screen.<br /><br /><img style="display:block; margin:0px auto 10px; width: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj81kDxjjg9KC0CO7TrF7lk8ef7Ens_L_a_SutXKWCa0DipP6gdj8Y6YtPXkL8QdxcLGZtqtWoS_35DIr_CEZFw2dfcz42Kkm3UkC_tvf-jF4F1jizlTBCI89bazeK-nIW46WppQ/s1600/duckpaper.png" border="0" /><br /><br />Fortunately there is an example Live Wallpaper in the 2.1 SDK called CubeLiveWallpaper. This is definitely the starting point for anyone looking to create their own Live Wallpaper. I opened up this sample project, played with CubeLiveWallpaper1 and merged its Engine with Duck Hunt's SurfaceView code, et voila we have a Live Wallpaper.<br /><br />Unfortunately I don't have an Android 2.1 device to try it on and it runs pretty slowly in the emulator. Once I've had it tested on a real device I'll put it in the Android Market.<br /><br />Update: I've had it tested by a friend with a Nexus One and all seems well, so it is now live in the Android MarketAnonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com15tag:blogger.com,1999:blog-32005942.post-86977895490562614682009-12-16T15:06:00.005+00:002009-12-16T15:19:05.985+00:00Activate Motorola Droid / Milestone Multimedia Dock Mode with a magnet, Save £30Some chap, not me, has figured out that the <a href="http://www.expansys.com/d.aspx?i=192224">Motorola Multimedia Dock</a> has a magnet in it which activates 'multimedia mode' on the Motorla Droid / Milestone Android devices, and guess what? it works!<br /><br />Just put a magnet to the back of the device in the top left corner, like in the image below and it instantly says 'Multimedia Dock Connected', queue lots of cheap cardboard homebrew docs. You can even use your $$$$ phone as a digital picture frame.<br /><br /><img src="http://farm3.static.flickr.com/2537/4190487228_27134057d9.jpg" /><br /><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/RtL4wr9Q4G4&hl=en_GB&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/RtL4wr9Q4G4&hl=en_GB&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br /><br />Alternatively download DockRunner from the Android Market.Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com4tag:blogger.com,1999:blog-32005942.post-12357340811525021012009-11-23T09:06:00.013+00:002009-11-23T15:16:48.283+00:00The Final Milestone?<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH0Tj5O-TRLEnVX7iOz6XZcbA5hHKa5tufFxMwioI3QlqHomAJMAXF9cG9yT-9P7lTaHaUo8vxRKm7cAThrBf4C7jKbsYvKuiZ177EjPTZr8m6beJs8o_eOVPWIxAKIyr2jdB-Fg/s1600/BatteryWidget_250k_3.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH0Tj5O-TRLEnVX7iOz6XZcbA5hHKa5tufFxMwioI3QlqHomAJMAXF9cG9yT-9P7lTaHaUo8vxRKm7cAThrBf4C7jKbsYvKuiZ177EjPTZr8m6beJs8o_eOVPWIxAKIyr2jdB-Fg/s1600/BatteryWidget_250k_3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5407305905601184514" /></a>From humble beginnings in a post on <a href="http://geekyouup.blogspot.com/2009/05/android-widget-crazyness.html">this blog in May</a> the Battery Widget for Android has become a little more popular. The post from May shows it had 3061 installs and today I'm really rather chuffed to say it has just broken 250,000!!! In Android speak that's 'the final milestone'. The Android Market now lists Battery Widget as having '>250k' installs! Yay.<br /><br />The install brackets are:<br /><50,<br />50 - 100<br />100 - 500<br />500 - 1,000<br />1,000 - 5,000<br />5,000 - 10,000<br />10,000 - 50,000<br />50,000 - 250,000<br />>250,000<br /><br />You can get through the first 4 bands pretty quickly, but the last one has taken a while. Battery Widget is now high up in the Productivity Category and is receiving around 1,000 - 2,000 installs a day. Also with just under a 60% retention rate, it is still installed on around 150k devices.<br /><br />The question that remains though, is whether or not 250k is actually the final milestone. Or is there a some secret next level, like >1,000,000 installs, accompanied by a letter from Andy Rubin maybe?Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com4tag:blogger.com,1999:blog-32005942.post-71080495519399232722009-10-09T11:00:00.004+00:002009-10-09T11:03:50.987+00:00Buzz Deck reviewed on App JudgmentBeing a fan of all things Revision 3, you can understand how shockingly happy I was when App Judgment reviewed Buzz Deck!<br /><br /><object width="400" ><param name="movie" value="http://www.youtube.com/v/s_sbjNaHjbM&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/s_sbjNaHjbM&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400"></embed></object><br /><br />Now to work on those Cons... a new version is due today with custom web cards, and a faster UI!Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com2tag:blogger.com,1999:blog-32005942.post-34336168440968580182009-09-21T09:52:00.017+00:002009-09-21T16:00:37.186+00:00Running rings around donut Part 2 - What does the end user get?I've been running Android 1.6 (donut) on my handset for a week now, so here is a quick guide of what to expect, tied to a little expectation management.<br /><div><br /><span style="font-weight: bold;">Android Market Updates</span><br />The most obvious update is the much needed revamp of the Android Market. The new UI provides a far more compelling end user experience, now including application screenshots.<br /></div><div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiYwTNNYgohJ-Q1tjCYGST78S2k-ZsB6UXLTAPRwzcxbWZD7EHvYj9pjCEYD18Ge9fkurIDX0UdJCK4J5yFn8NvRV9U-rr-YlRln_Sxu-_s5yGB_mb8pLXoKgWw4xyZp2ndpw1qA/s1600-h/market1.png"><img style="cursor: pointer; width: 214px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiYwTNNYgohJ-Q1tjCYGST78S2k-ZsB6UXLTAPRwzcxbWZD7EHvYj9pjCEYD18Ge9fkurIDX0UdJCK4J5yFn8NvRV9U-rr-YlRln_Sxu-_s5yGB_mb8pLXoKgWw4xyZp2ndpw1qA/s320/market1.png" alt="" id="BLOGGER_PHOTO_ID_5383895499920764370" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhc_oEK_N_EeXfJaHAvW7DqZGiKhdV7bBP908i8fULXpvx1osJwJrh4OWC7LxToFFUnO9BFLhxk8uaX5JD1s7oRhuvX_iJDB5bccFMXhJ5z1r_vPHY8pYU3xVJz1Iq4kuqrstucQ/s1600-h/market2.png"><img style="margin-left:10px; cursor: pointer; width: 214px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhc_oEK_N_EeXfJaHAvW7DqZGiKhdV7bBP908i8fULXpvx1osJwJrh4OWC7LxToFFUnO9BFLhxk8uaX5JD1s7oRhuvX_iJDB5bccFMXhJ5z1r_vPHY8pYU3xVJz1Iq4kuqrstucQ/s320/market2.png" alt="" id="BLOGGER_PHOTO_ID_5383896124858510818" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHSoJ1P_QPxPZDzxBC1tqUrHQv2kRMYLaD6_Xq-OjX7qoz3F4PLSemCQNbO_Xt7mZpgroEsD0DBxhLDoa7SETMeo3HO0KZ8JZpdRB39svBXe95tgZeGCFoxMMCZV5sZ6pV4OFU3g/s1600-h/market3.png"><img style="cursor: pointer; width: 214px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHSoJ1P_QPxPZDzxBC1tqUrHQv2kRMYLaD6_Xq-OjX7qoz3F4PLSemCQNbO_Xt7mZpgroEsD0DBxhLDoa7SETMeo3HO0KZ8JZpdRB39svBXe95tgZeGCFoxMMCZV5sZ6pV4OFU3g/s320/market3.png" alt="" id="BLOGGER_PHOTO_ID_5383895502791327202" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3J-rS2uoLrIbuuzf7zFD-d94VqQiCOQyralmPnTf6vk5TTIkNQPSzmjkEsVVJeEdzwP0cMb8OIVGH7Q6FF0lGvWl3YwRAGXZJgYMSXnQ03IxmToZUb-bUp5iLAhwlAt_rg0vrMw/s1600-h/market4.png"><img style="margin-left: 10px; cursor: pointer; width: 214px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3J-rS2uoLrIbuuzf7zFD-d94VqQiCOQyralmPnTf6vk5TTIkNQPSzmjkEsVVJeEdzwP0cMb8OIVGH7Q6FF0lGvWl3YwRAGXZJgYMSXnQ03IxmToZUb-bUp5iLAhwlAt_rg0vrMw/s320/market4.png" alt="" id="BLOGGER_PHOTO_ID_5383895511862040674" border="0" /></a><br /></div>Good job, well done. Although I'd still love to see a recommendation engine included so you get a 'you may like' section. It is still quite easy to miss decent apps/games in the 'Just In' section and the Featured apps list is quite limited.<div><br /><span style="font-weight:bold;">Quick Search Widget:</span><br />A great little addition to the default Android widgets. This little puppy lets you search contacts, applications, bookmarks and web information without actually launching the browser. It is location sensitive and I've used it a lot, +1 for productivity.<br /><br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBpOyGidXex9FjABgoDGjhTlSDkms8vyklabjuGRvQm-7QgbDDUlsjpksgjyP7virxmv1aXwJNxkwD8q3v_SL4PAOIu2B4YhmzUoTAY_nn1Co1agf2k6RHhsRxfTMBY774njONVw/s1600-h/searchwidget1-1.png"><img style="cursor: pointer; width: 320px; height: 54px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBpOyGidXex9FjABgoDGjhTlSDkms8vyklabjuGRvQm-7QgbDDUlsjpksgjyP7virxmv1aXwJNxkwD8q3v_SL4PAOIu2B4YhmzUoTAY_nn1Co1agf2k6RHhsRxfTMBY774njONVw/s320/searchwidget1-1.png" alt="" id="BLOGGER_PHOTO_ID_5383943353452712962" border="0" /></a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ8NOz_C_YVGAVaG_izeD9805u7oesu95J3Z6NxPV7PYiVYMB5EqLgijHUzCkwhd4qZ4_7QhxwChoHGr1SX2WFCMIT-ud7j45vH6JaxaB07xxw2wWOuBv_HglGHynZ2LTfTyavVg/s1600-h/searchwidget2.png"><img style="cursor: pointer; width: 214px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ8NOz_C_YVGAVaG_izeD9805u7oesu95J3Z6NxPV7PYiVYMB5EqLgijHUzCkwhd4qZ4_7QhxwChoHGr1SX2WFCMIT-ud7j45vH6JaxaB07xxw2wWOuBv_HglGHynZ2LTfTyavVg/s320/searchwidget2.png" alt="" id="BLOGGER_PHOTO_ID_5383943366514102674" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNaONkhXMG9XHEZTPSi4in2vW-oACBjKUExyFeJ71e1FDttsmWBjV-J9XuK9Kjd1H2-uDi8RFqYMynILcms_H0JMrfWXQ6GvHUhK8ycIkLY1RU1BifmFjzkZFFUQzWHtwy3r5qWQ/s1600-h/searchwidget5.png"><img style="margin-left:10px; cursor: pointer; width: 214px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNaONkhXMG9XHEZTPSi4in2vW-oACBjKUExyFeJ71e1FDttsmWBjV-J9XuK9Kjd1H2-uDi8RFqYMynILcms_H0JMrfWXQ6GvHUhK8ycIkLY1RU1BifmFjzkZFFUQzWHtwy3r5qWQ/s320/searchwidget5.png" alt="" id="BLOGGER_PHOTO_ID_5383943358992324194" border="0" /></a><br /></div><br /><br /><span style="font-weight:bold;">Battery Monitor:</span><br />So the bad news is that my battery life isn't any better, but on the plus side I can now tell where it is all going. The handy Battery Monitor is very quick to point out the Wireless LAN is a great big battery hog.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSxPdnl7jnLEY_R7iRPvN4u2IMwR582WMoNLkfJTuGXT1_9KBmxfMrgvWwHD2soDfUddg6N3fo7TROt5IIeDZ8ENVOw5RjCJxH0DYyqGQq7xoXpmwi4sWVcjto18oYNmrlEsHTkw/s1600-h/batteryuse1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSxPdnl7jnLEY_R7iRPvN4u2IMwR582WMoNLkfJTuGXT1_9KBmxfMrgvWwHD2soDfUddg6N3fo7TROt5IIeDZ8ENVOw5RjCJxH0DYyqGQq7xoXpmwi4sWVcjto18oYNmrlEsHTkw/s320/batteryuse1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5383945133391574994" /></a><br /><br /><span style="font-weight:bold;">VPN Connectivity:</span><br />If your home or office has a VPN then this will be a very pleasant little suprise, built in VPN connectivity.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBjntVf-Ep62BfhDrrQ4KyUJuUj2cYl8fCgrC6YLLWTu2KSIrNQv_MTXuqDojpkwYiol67ylq9eF2ov8to_jNndGQdPLHZfe7w-r1zK1oC0_Cm6ejwedxGSl1pV9u4ryRKaqACXw/s1600-h/vpn1.png"><img style="cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBjntVf-Ep62BfhDrrQ4KyUJuUj2cYl8fCgrC6YLLWTu2KSIrNQv_MTXuqDojpkwYiol67ylq9eF2ov8to_jNndGQdPLHZfe7w-r1zK1oC0_Cm6ejwedxGSl1pV9u4ryRKaqACXw/s320/vpn1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5383945504036844482" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZjPO_QTjOH3QMVpOTu-XKUnQqpIwkaE1dSo1FmK8knC0hoTpzs_opJawr_kipc_qZxJQ_yAMaKQj5VnSd8hKRg8EKhRv8ylnB4kBm6RnwiIkEGAKr4H67-F30BbXg4v2fckdMjQ/s1600-h/vpn2.png"><img style="margin-left:10px; cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZjPO_QTjOH3QMVpOTu-XKUnQqpIwkaE1dSo1FmK8knC0hoTpzs_opJawr_kipc_qZxJQ_yAMaKQj5VnSd8hKRg8EKhRv8ylnB4kBm6RnwiIkEGAKr4H67-F30BbXg4v2fckdMjQ/s320/vpn2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5383945514085099826" /></a><br /><br /><span style="font-weight:bold;">Toggle Switches Widget:</span><br />Another nice little add-on, makes simple tasks that little bit easier by giving you instant access to Wifi, Bluetooth, GPS, Sync and Brightness settings. Does a good job of making a lot of Market apps completely redundant.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi081sLZY8SPT_rkmNxZpl1tuYUaS_6kG3GbLGfkh8-UiP2fmqryVou0Pqu67g1UtGIwAJ8GcZ5iv0I_zTTvPwfFXlxekI6uRU9YR_xrnfOMJKfCPPD5kkHpbP7wX_e2looCCSwnA/s1600-h/togglewidget1-1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 93px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi081sLZY8SPT_rkmNxZpl1tuYUaS_6kG3GbLGfkh8-UiP2fmqryVou0Pqu67g1UtGIwAJ8GcZ5iv0I_zTTvPwfFXlxekI6uRU9YR_xrnfOMJKfCPPD5kkHpbP7wX_e2looCCSwnA/s320/togglewidget1-1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5383946371359847586" /></a><br /><br /><span style="font-weight:bold;">Speech Synthesis:</span><br />So far only slightly interesting as all it can do is say its test phrase in multiple languages. Hopefully we'll see some apps using this soon.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaGAhdyxpdiGitnYhyoJPRzGYhG0yvsqWLXwRaczCgYL7BzHOjdOE7TkUpsPV9POFkHC23nRZg5ehz-p8aK36k8njedxGGB5t9HrsBjW4lL6AKqpRPGnMWBPfkU7BBS_lSfy1jYA/s1600-h/speechsynth1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaGAhdyxpdiGitnYhyoJPRzGYhG0yvsqWLXwRaczCgYL7BzHOjdOE7TkUpsPV9POFkHC23nRZg5ehz-p8aK36k8njedxGGB5t9HrsBjW4lL6AKqpRPGnMWBPfkU7BBS_lSfy1jYA/s320/speechsynth1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5383946826172169538" /></a><br /><br /><span style="font-weight:bold;">General System Performance:</span><br />Always slightly subjective as every single machine on this rock we call Earth is faster after a wipe and clean operating system install. However I'd claim that it is still absolutely flying after a week of installing 50+ apps and using it more than a tortoise uses its shell.<br /></div>Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com4tag:blogger.com,1999:blog-32005942.post-18594890206974883922009-09-16T15:43:00.007+00:002009-09-21T05:57:17.350+00:00Running rings around donut - Android 1.6 SDK Screen SizesOver the past couple of weeks Motorola, SonyEricsson, INQ, LG, GeekPhone ONE, Samsung, Archos and HTC have all make Android related announcements. For an Android fan like myself that is big. Now to top it all off the announcement of the Android 1.6 SDK makes it a pretty good week.<br /><br />After a few hours hands on, here is what it means to us.<br /><br />There are new screen sizes supported. In addtion to the regular 320x480px HVGA screen resolution there are now QVGA (240x320), WVGA800 (800x480) and WVGA854 (854x480). But what does that mean for applications? will developers have to update their apps to support the new sizes? Well I've tested all of our Android applications out and the news is good, here are the results:<br /><br />News Buzz Widget Home Screen WVGA 480x856px:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEcfR55ePB8f9HWmGADSO2G7HoTkwYc5cUtZbYKOHM-M4cd-8WeOAc9b0iOKFS8AF0ACD3tGESN2yW1bSK3ny8rqxLxkLKwg-8IUJoB7-LGbVcKTRA5e54J49G2l4o1VE0PWAI/s1600-h/854_hsw.jpg"><img style="margin: 0pt 10px 10px 0pt; cursor: pointer; width: 182px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEcfR55ePB8f9HWmGADSO2G7HoTkwYc5cUtZbYKOHM-M4cd-8WeOAc9b0iOKFS8AF0ACD3tGESN2yW1bSK3ny8rqxLxkLKwg-8IUJoB7-LGbVcKTRA5e54J49G2l4o1VE0PWAI/s320/854_hsw.jpg" alt="" id="BLOGGER_PHOTO_ID_5382063456055762002" border="0" /></a><br />News Buzz Widget Home Screen QVGA 240x320:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcuXx1xb_01B1lTDhPnPZbfDWCHzJq8CkfQ01tyXdvNH4vsbAX6MHTt9nILEazeMQBoK3E4bEaeadQKrWg1k-5Mp4FyNNmkMUA6yAd8pDkfSfBul4M8RsKSpy_icIwhTifmZ-1/s1600-h/320_hsw.jpg"><img style="margin: 0pt 10px 10px 0pt; cursor: pointer; width: 239px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcuXx1xb_01B1lTDhPnPZbfDWCHzJq8CkfQ01tyXdvNH4vsbAX6MHTt9nILEazeMQBoK3E4bEaeadQKrWg1k-5Mp4FyNNmkMUA6yAd8pDkfSfBul4M8RsKSpy_icIwhTifmZ-1/s320/320_hsw.jpg" alt="" id="BLOGGER_PHOTO_ID_5382063440350175666" border="0" /></a><br /><br />News Buzz Widget WVGA 480x856px:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq6qERI1MuVGxFhC55GsNKoWSqotVSDLE_wg3Kk2TWe7cxWgGlHbacl2LCbomAHsnw_faTUxLnrTeK7EF2l18dHM-pAinuUKfABxlsujcjxokB8JYBgFtCoGrPTIlbLFlGqb2G/s1600-h/854_hsw2.jpg"><img style="margin: 0pt 10px 10px 0pt; cursor: pointer; width: 182px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq6qERI1MuVGxFhC55GsNKoWSqotVSDLE_wg3Kk2TWe7cxWgGlHbacl2LCbomAHsnw_faTUxLnrTeK7EF2l18dHM-pAinuUKfABxlsujcjxokB8JYBgFtCoGrPTIlbLFlGqb2G/s320/854_hsw2.jpg" alt="" id="BLOGGER_PHOTO_ID_5382063462152813394" border="0" /></a><br />News Buzz Widget QVGA 240x320<span style="text-decoration: underline;">px</span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizb3SxzKA8SBdP8rXyRocCKasfmKOgJYcpmHEPJ-jPgdwUbzPpGKV8GYvwHiSDGQBHEhr3SKGN_B-przP-Nxjsc4AjS6wCvLJZ4RD3-uz76OkWQjeO4t-ez8rGzpC2M7oCsMbd/s1600-h/320_hsw2.jpg"><img style="margin: 0pt 10px 10px 0pt; cursor: pointer; width: 239px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizb3SxzKA8SBdP8rXyRocCKasfmKOgJYcpmHEPJ-jPgdwUbzPpGKV8GYvwHiSDGQBHEhr3SKGN_B-przP-Nxjsc4AjS6wCvLJZ4RD3-uz76OkWQjeO4t-ez8rGzpC2M7oCsMbd/s320/320_hsw2.jpg" alt="" id="BLOGGER_PHOTO_ID_5382063445048465442" border="0" /></a><br /><br /><div style="float: left;">Somehow Google/Android have managed to get the scaling algorithms to work like magic, they maintain aspect ratios where necessary and scale to fill as much of the screen as they can whenever possible. This knocks a big worry on the head for me, I was concerned about the fragmentation problems of different screen sizes. Of course there are still issues, but they are minimal and most importantly the apps are still perfectly useable and 100% functional.<br /><br />Good job, well done.</div>Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com2tag:blogger.com,1999:blog-32005942.post-81776770276857802912009-06-24T14:06:00.003+00:002009-06-24T14:30:40.689+00:00How to Make an Android Home Screen WidgetHere's the presentation I gave on Android Home Screen Widgets at the last London Android User Group (Londroid) on 22nd June 2009.<div style="width:425px;text-align:left" id="__ss_1620477"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/geekyouup/londroid-android-home-screen-widgets?type=presentation" title="Londroid Android Home Screen Widgets">Londroid Android Home Screen Widgets</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=londroid-androidhomescreenwidgets-090622132129-phpapp02&stripped_title=londroid-android-home-screen-widgets" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=londroid-androidhomescreenwidgets-090622132129-phpapp02&stripped_title=londroid-android-home-screen-widgets" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">OpenOffice presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/geekyouup">Richard Hyndman</a>.</div></div>Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com16tag:blogger.com,1999:blog-32005942.post-62839333412337089372009-05-07T13:20:00.008+00:002009-05-07T14:31:22.284+00:00Android Widget CrazynessSince my last post I've been Widget'ing away like a good dev, check the <a href="http://blog.mippin.com/2009/05/mippin-goes-widget-crazy.html">Mippin Blog</a> for details of our 'Tech Buzz Widget'<br /><br />I also wanted to launch a personal widget project as well, so I took a long hard think about what Widgets people really really need and came up with.... wait for it... yes you guessed it... a Battery Widget, doh! Well there wasn't one, so I thought I'd be first at least.<br /><br /><img align="left" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRQesJwJxZTpqIl3EpMPHB-C7zS6G9LgYcwqlggUQAfUhDzCaOvXLJ8TKZay6SpCSpEqETuXHZFzL7L5g3vOA-UpeHhfk0bErRP2h_769cqKdv1sVWxpg1_aZPo8vME-h2eoj70w/s1600/batterywidget_ss3.jpg" border="5" alt=""id="BLOGGER_PHOTO_ID_5333082648568612898" /> The first incarnation wasn't quite so pretty, but I've got it looking quite nice now. A little 24bit alpha blended glow around the widget helps it blend into any wallpaper. There is also a little charging indicator for the sake of completeness.<br /><br /><img align="right" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHAdqIv3mP4rScC2T8MebkjRnC85dFXCitWMXQupFHbPahZz56gXThkw9Tn3IEoYQ7gLReO9YzZAe2yGPHmT7mp9dgISnoWCy7d7u5p9F8pvgVFW4VpgNRB6qlLq1yMldCIFaH-g/s1600/batterywidget_ss2.png" border="0" width="240" alt=""id="BLOGGER_PHOTO_ID_5333083305900605186" />If you touch the widget it shows quick links to the Display, Wifi and GPS settings pages. Really this should be replaced with embedded toggles switches to turn GPS/Wifi/Bluetooth/Radio on and off as well as a brightness slider, hopefully I'll get time for that later.<br /><br />Developing home screen widgets on Android is really enjoyable, so if you have any widget ideas, I may well take you up on them.<br /><br />By the way, if you are wondering how strong the demand for Widgets on Andorid is right now, the Battery Widget hit 3000 downloads in the first 5 days.<br /><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMogaWR1TVN2YYS5swxD1bTFxA_l8JFJX7XCKr6gaBan1lzwO8OyUAYhVXT9K-0PbhV5SpBrn_A4PwWp1Q0v080bmlyI_WOXXbPvo9bMVv18MGZTD0PWlH6Ea8DlT_z5HbHybQSQ/s1600/batterywidget_ss4.png" border="0" width="400" alt=""id="BLOGGER_PHOTO_ID_5333089284369028482" />Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com15tag:blogger.com,1999:blog-32005942.post-47639644087263637272009-04-21T16:51:00.006+00:002009-04-21T17:07:13.841+00:00Widgets on Android: Simple, powerful and beautifully formed<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw3Vtjdhd9V8UPLfIq9d5oPeFDlLOLDO_Ws_SsbdhossuY3sizZfOkVpLt_mokkBBeyTRLv_cUcEKSUysgdR7yuBj7BdGxXruIhfxFCMgEh7vId_E9kV2YTLXALDoXIp9kGyjt4A/s1600-h/my1stwidget.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw3Vtjdhd9V8UPLfIq9d5oPeFDlLOLDO_Ws_SsbdhossuY3sizZfOkVpLt_mokkBBeyTRLv_cUcEKSUysgdR7yuBj7BdGxXruIhfxFCMgEh7vId_E9kV2YTLXALDoXIp9kGyjt4A/s320/my1stwidget.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5327188402365163986" /></a> Today I have Google Joy and more specifically Android Joy. I was reading the <a href="http://android-developers.blogspot.com/">Android Developers Blog</a> and the <a href="http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html">latest article</a> was on the topic of Widgets. <br /><br />I reached the end of the article and set about creating my own Android home screen widget. It had to go off to Twitter, retrieve the latest status update for <a href="http://twitter.com/flashy1980">@flashy1980</a>, a colleague and good friend, then display it on my home screen. In a period of time less than or equal to 20 minutes I was wondering around the office with a slightly inane grin on my face, showing off my first Android widget.<br /><br />Some say I'm biased, and I am, I really am, but I love Android. I'm off to play some more with the Widgets API now. Source code for Google's example Widget that I based mine on is <a href="http://code.google.com/p/wiktionary-android/source/browse/#svn/trunk/SimpleWiktionary">here</a><br /><br />NB: you need version 1.5 of the Android SDK to create widgets and they only run on a device with a 1.5 firmware. I've installed the 5.0.2Hr3 firmware from the <a href="http://code.google.com/p/sapphire-port-dream/">Sapphire-Port-Dream project</a>. Many thanks to <a href="http://twitter.com/Haykuro">@Haykuro</a> for all his firmware efforts.Anonymoushttp://www.blogger.com/profile/13384953816247059077noreply@blogger.com5