Skip to content

Archive for September, 2010

Better android keyrings

Sep 25 10
by mat

Woo, got some more android keyrings! This time I went for some extra colors as well as the green ones. These ones are more vivid and slightly smaller than the previous batch which is an advantage because you can now easily thread them through their own hoop. They also look like they will be a little more durable.

multi-color android keyrings

multi-color android keyrings


multi-color android keyrings

multi-color android keyrings


lots of multi-color android keyrings

lots of multi-color android keyrings


Comparison of old and new android keyrings

Comparison of old and new android keyrings

Android market is expanding paid apps to more countries

Sep 25 10
by mat

Brilliant news from the android market.

Subject: A Message from Android Market
From: Android Market Support
To: android .at. stealthcopter.com
Date: 25/09/10 00:03:32

Hello,

We’re writing to inform you about some changes to Android Market that require your attention.

Over the next few weeks, we’ll be adding paid apps support for additional countries. If you have selected to publish your paid apps to all locations and intend to support all new locations as we expand the number of supported countries for paid apps, you don’t have to do anything. If you have selected to publish your paid apps to all locations but intend to only target the currently supported 14 countries, please update your location selections to target these specific countries.

Please look for follow-up emails when we introduce paid apps support for specific additional countries in the coming weeks. At that time, you’ll have the option to target these specific countries.

Thanks, and we look forward to continue working with you on Android
Market.

Sincerely,
The Android Market Team

Google, Inc.
1600 Amphitheatre Parkway
Mountain View, CA 94043

Email preferences: You are receiving this email to notify you of important changes to your Android Market account.

Quick Review of Amazon Kindle 3G (plus some images and microscope images)

Sep 22 10
by mat

I recently ordered an Amazon Kindle 3G as I wanted an ebook reader to read papers and some of CommonsWare’s great android books and the kindle seemed like excellent value for money. It arrived today so here is a quick review along with some pictures:

Advantages

  • Cost – Only ~£150
  • 3G – Free browsing web over 3G (worldwide!)
  • Wifi – For quicker browsing / downloading, works well no hitches.
  • MP3 Player – With speakers or headphone socket
  • Text to speech – So you don’t even have to read your ebooks any more, it even turns the page for you! The voice is quite good sounding only partially robotic; It manages pauses well with brackets, commas, etc. but sometimes doesn’t pause properly between paragraphs. Also some obscure words are mispronounced. I don’t know how good this would be for reading fiction as an audio book but this isn’t likely a feature I will be using much.
  • Viewing angle – due to the technology of the screen (E ink), you can still see the screen irrespective of angle (unless view is physically obscured obviously…)
  • – Screen is visible in direct sunlight unlike AMOLED phone screens
  • Supported formats – Supports MOBI (kindle), PDF, EPUB
  • Fits in my pocket – Just about fits in my pocket, with only a bit sticking out, this would obviously not be suited for long distance but as temporary holding place it is just fine.

Disadvantages

  • White is grey – Okay so the background is not completely white, more greyish, but I don’t really care it is still very book-like.
  • Scientific papers – Two column journal papers are a bit awkward to read or navigate using the current zoom settings

Neutral

  • You could fit about 26,000 into a olymic sized swimming pool

Photos

Amazon kindle 3G reading a nice android pdf with images

Amazon kindle 3G reading a nice android pdf with images


Amazon kindle 3G (Experimental settings; Web browsing, mp3 player, and text to speech)

Amazon kindle 3G (Experimental settings; Web browsing, mp3 player, and text to speech)

Newspapers
There is a choice of which country you’d like to view newspapers from and in the UK there is a choice of 5 (Telegraph, daily mail, independent, financial times, and London evening standard notably the Times is missing… what are they playing at?) all of which offer a 2 week free trial of the newspaper or the purchasing of single issues or a monthly subscription (prices vary).

Newspaper subscription on kindle (free 14 day trial on most subscriptions)

Newspaper subscription on kindle (free 14 day trial on most subscriptions)


Daily Mail viewed on the kindle, no crossword or puzzle page though :(

Daily Mail viewed on the kindle, no crossword or puzzle page though :(

Microscope images
And as usual when I buy something new and exciting I have to look at it under a microscope :)

Amazon Kindle 3G display (No mag)

Amazon Kindle 3G display (No mag)


Amazon Kindle 3G display under microscope (Low mag)

Amazon Kindle 3G display under microscope (Low mag)


Amazon Kindle 3G display under microscope (High mag)

Amazon Kindle 3G display under microscope (High mag)

Nexus Revamped Pro Live Wallpaper 1.1.16 update #android

Sep 14 10
by mat

Nexus Revamped Pro has just been updated to version 1.1.15 and with that come lots of exciting new features as well as many bug fixes!

1.1.16 Changelog

Minor update to fix a few bugs and add a few more things I did have time to include in the previous update. Should also increase performance and reduce FC/OOMs

  • Added: Particle glow saturation (Particle > Saturation) to control the saturation of the glow around the particles
  • Added: Added a preview of how the particle will look in the saturation dialog
  • Added: Some people prefered the old particle look so I have added two buttons on the saturation to reset these values to either original nexus like (original) or like my previous ones (revived)
  • Moved: More apps and Feedback are now under the Developer option
  • Improved: Parallax and scale are no longer marked as experimental
  • Bug Fix: Particles sometimes not properly aligned to grid on preview
  • Bug Fix: Improved bitmap loading performance loads this should also get rid of most the FC/OutOfMemory errors
  • Bug fix: Battery effects only started working once a battery update was given, now they work instantly!
  • Bug Fix: Particle glow circle was truncated, now fixed!
  • Bug fix: Touch location when using scale is fixed (still need to fix rotation)

New Saturation Options

This is in addition to the other particle options (tail length and custom colors) you can now completely customise how the particles look with the new saturation settings. Some users disliked the change I made to more closely resemble the original design wallpaper by romainguy so I had added an option to choose between one like his particles (original) and like my previous particles (revived).

New saturation options in nexus revamped pro

New saturation options in nexus revamped pro

Performance
I have improved the way in which bitmaps are used which should take up far less memory. This will likely prevent the OutOfMemory errors some people were getting and remove the change of a force close. I have tinkered with a few other things which should provide better performance.

Video
I have put off the video until this version was released so this should be along shortly (the first videovideo is very outdated now)

Android Market Links
Either click the following android market links (in android phone) or search the market for nexus revamped.
Pro Version
Nexus Revamped Pro Live Wallpaper (com.stealthcopter.nexusrevampedpro)

qr

Free Version

So the free version is a few versions behind the pro version and some of the fancier features are missing, I am constantly improving both so don’t worry if you don’t want to shell out £0.99 for an app.

Nexus Revamped Live Wallpaper (com.stealthcopter.nexusrevamped)

Download link

qr

Future
I have plans and ideas for the future of this application, please complete the poll below to indicate what you’d like to see in this app or leave feedback (comment) if you have any.

What would you like to be added next to nexus revamped pro?

View Results

Loading ... Loading ...

Fun with LED’s and liquid nitrogen

Sep 13 10
by mat

Working in a physics department has it’s perks. Below shows an orange LED changing colour as it is submerged into liquid nitrogen.

Many thanks to my house-mate for letting me play with liquid nitrogen and try this out.

What happens when you submerge an orange LED in liquid nitrogen

Sep 13 10
by mat

Android: Creating a custom Adapter for GridView (ButtonAdapter)

Sep 8 10
by mat

Background
Adapters are great, it’s a fact. After you get over the initial learning curve you will realise you love them (almost as much as a six sided companion). This is my attempt at a casual explanation of how to create your own custom adapter, in this example we will create a ButtonAdapter similar to something you might see in a soundboard (yawn).

Example of a grid adapter in use

Example of a grid adapter in use

Advantages of an adapter

  • Dynamic – Can expand to any number of elements rather than statically coding each individual view.
  • Elegant – Makes your code petite and quite clear to understand once you get over the initial difficulty
  • Beautiful – Now you don’t have to control how many items there are in rows or columns, android will automatically fill up the screen in the best way possible. This also means you don’t need to redesign your application for horizontal and vertical orientations.

Creating a ButtonAdapter

So we’re going to dive straight into the deep end and create our own ButtonAdapter class that extends the BaseAdapter class. If you are doing this in eclipse you can write the first line and then it will offer to autocreate (implement) the missing methods for you (if you highlight the error). This code goes inside your Activity in your java file but not inside your oncreate method.

public class ButtonAdapter extends BaseAdapter {
 private Context mContext;

 // Gets the context so it can be used later
 public ButtonAdapter(Context c) {
  mContext = c;
 }

 // Total number of things contained within the adapter
 public int getCount() {
  return filenames.length;
 }

  // Require for structure, not really used in my code.
 public Object getItem(int position) {
  return null;
 }

 // Require for structure, not really used in my code. Can
 // be used to get the id of an item in the adapter for 
 // manual control. 
 public long getItemId(int position) {
  return position;
 }

 public View getView(int position, 
                           View convertView, ViewGroup parent) {
  Button btn;
  if (convertView == null) {  
   // if it's not recycled, initialize some attributes
   btn = new Button(mContext);
   btn.setLayoutParams(new GridView.LayoutParams(100, 55));
   btn.setPadding(8, 8, 8, 8);
   } 
  else {
   btn = (Button) convertView;
  }
  exus
  btn.setText(filesnames[position]); 
  // filenames is an array of strings
  btn.setTextColor(Color.WHITE);
  btn.setBackgroundResource(R.drawable.button);
  btn.setId(position);

  return btn;
 }
}

So the important methods are getCount and getView. getCount returns the number of objects (in our case buttons) that will be needed in this adapter. getView returns an object (again a button in our case) so that it can be used.

Both these functions reference an array that I have referered to as filenames this is a string array (String[]) which looks something like the following:

public String[] filesnames = { 
			"File 1", 
			"File 2",
			"Roflcopters"
			};

Creating an OnClickListener

You can add the following to your getView method to setup a new onclick listener for your buttons so that they can react to button presses.

  // Set the onclicklistener so that pressing the button fires an event
  // We will need to implement this onclicklistner.
  btn.setOnClickListener(new MyOnClickListener(position));

For this to work we need to implement our own OnClickListner which I have named MyOnClickListener (for lack of a better name) this is the same as a normal onclick listner except we pass an integer so that we can tell which button called our onClick method (you could get the id from the view passed, but this method is useful when expanding your program later on).


class MyOnClickListener implements OnClickListener
{
 private final int position;

 public MyOnClickListener(int position)
 {
  this.position = position;
 }

 public void onClick(View v)
 {
  // Preform a function based on the position
  someFunction(this.position)
 }
}

Implementing this adapter

Now implementing the adapater is very simple, add a few imports and load a grid view from an xml file. Then we simply set the gridview’s adapter to be a new ButtonAdapter and it will automatically do the rest for us.

// You will need the following imports

import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.GridView;

// In your oncreate (or where ever you want to create your gridview)
GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ButtonAdapter(this));

And hopefully your all done, you could then go on to add a context menu(menu on long press) to your buttons. If you have any questions or want something explaining a bit better, just ask!

Nexus Revamped Pro Live Wallpaper 1.1.15 update (Exciting features update)

Sep 8 10
by mat

Nexus Revamped Pro has just been updated to version 1.1.15 and with that come lots of exciting new features as well as many bug fixes!

So Whats new?

This is a massive update and I have added many features, I have tonnes more ideas for things to include next. Please send me an email if there is anything you’d like or if you spot any problems! Enjoy!

  • Added: EXPERIMENTAL Parallax option to have background scrolling effect and modify its magnitude
  • Added: EXPERIMENTAL Rotation option to rotate the entire foreground (Physics > Rotation)
  • Added: Darkness slider to all color dialogs, you now use the darkness slide.
  • Added: Choice between 1, 2 and 4 custom particle colors, so you don’t have to bother filling them in if you only want 1 or 2 colors
  • Added: EXPERIMENTAL to scale the size of the live wallpaper (Physics > scaling)
  • Removed: Tint colors on non-image backgrounds, they are pointless now you can select all possible colors and are hence disabled for performance benefits
  • Removed: Alpha slider from some color dialogs, you should now use particle saturation to change the alpha
  • Moved: Touch interaction is now in the Reactions menu.
  • Improved: Particle saturation can now be set for the head and the tail individually
  • Improved: Changed the look of the particles should be more similar to the original wallpaper
  • Improved: Changed some default values (Speed deviation, Particle saturation)
  • Improved: Background color now uses a color dialog
  • Improved: Made changelog text smaller
  • Improved: How particle saturation works, it now affects the particle and trail properly
  • Improved: Custom background images are now resampled to use less memory, should cause less force closes and lower memory usage. Also added a protection in to alter user when there was a memory error rather than force closing
  • Improved: Custom particle colors selection now shows the color next to each option. Makes it a bit nicer I think :)
  • Bug fix: Background tints now work properly on backgrounds / custom backgrounds, and are also more efficient
  • Bug fix: Density is more consistent now, not reliant on particle speed
  • Bug fix: Tails didn’t always decay to completely transparent
  • Known bug: Disabling static foreground will cause particles to “fall” off the grid :(
  • Known bug: Large rotation values can cause particles to spawn on screen
  • Known bug: Licencing server issues when data connection not avaliable

Some are marked as experimental as I’ve tested them, and my beta testers have had a play but still need to be tried and tested, go wild! and let me know of any problems.

Walkthrough of some of the new and the more interesting settings

Custom Particle Colors

Follow this like a story board, left to right top to bottom. Shows the process of selecting custom colors

Follow this like a story board, left to right top to bottom. Shows the process of selecting custom colors

Custom Backgrounds

Setting a custom background image

Setting a custom background image

Battery Reactions
The live wallpaper has the ability to react to the battery status either changing the particle colors or the speed of the particles.

Option to change colors based on battery level. (Right to left, top to bottom: 100%, 75%, 50%, 25%, 0% battery capacity)

Option to change colors based on battery level. (Right to left, top to bottom: 100%, 75%, 50%, 25%, 0% battery capacity)

Scale (Experimental)
A few users asked if they could have an option to scale the wallpaper to larger sizes, so here you go!

Nexus Revamped Pro 1.1.15 scaling settings and examples

Nexus Revamped Pro 1.1.15 scaling settings and examples

Saturation

Change the saturation of the particles heads and tails

Change the saturation of the particles heads and tails

Parallax (Experimental)
Parallax or the scrolling of the background at a different rate to the foreground is a difficult effect to demonstrate well in a photo so please wait for the video to see a preview of this.

Rotation (Experimental)
Rotate the grid of the foreground, particles will no longer be aligned to the grid but I think it looks kinda funky.

Nexus Revamped Pro 1.1.15 rotation setting

Nexus Revamped Pro 1.1.15 rotation setting


Nexus Revamped Pro 1.1.15 rotation

Nexus Revamped Pro 1.1.15 rotation

Changelog
Now you can know what’s up.

Changelog, no more wondering what I've been doing!

Changelog, no more wondering what I've been doing!

Restore default settings
Safety button to lose all settings.

Don't worry about experimenting with settings you can always reset

Don't worry about experimenting with settings you can always reset

Video
I am still planning on posting a video soon (when I get some free time) to demonstrate the app as it has improved significantly since the first video.

Android Market Links
Either click the following android market links (in android phone) or search the market for nexus revamped.
Pro Version
Nexus Revamped Pro Live Wallpaper (com.stealthcopter.nexusrevampedpro)

qr

Free Version

So the free version is a few versions behind the pro version and some of the fancier features are missing, I am constantly improving both so don’t worry if you don’t want to shell out £0.99 for an app.

Nexus Revamped Live Wallpaper (com.stealthcopter.nexusrevamped)

Download link

qr

Future
I have plans and ideas for the future of this application, please complete the poll below to indicate what you’d like to see in this app or leave feedback (comment) if you have any.

What would you like to be added next to nexus revamped pro?

View Results

Loading ... Loading ...

Photos with my new usb microscope (20X-400X 1.3MP Digital Microscope)

Sep 3 10
by mat

I have been quite pleased with my previous microscope but I decided to buy a slightly better one from dealextreme as double the magnification was available for only a slightly higher cost.

product link) It only cost $48.20 USD (about £31.27 GBP) only $8 than my previous microscope that could only achieve 200x!

20X-400X 1.3MP Digital Microscope

20X-400X 1.3MP Digital Microscope


20X-400X 1.3MP Digital Microscope with nice markings of the magnification

20X-400X 1.3MP Digital Microscope with nice markings of the magnification

Quick Review
Advantages

  • Large dynamic zoom range (labelled 20x – 400x)
  • Easy to setup (plug and play)
  • Can take some awesome photos, see below
  • Variable illumination settings (using a wheel at top)
  • Rubberised casing gives better grip and good overall feel
  • Much improved build quality over the digimicro
  • Stand is sturdy and can hold camera still in place

Comparison to the digimicro

Digimicro vs New Microscope

Digimicro vs New Microscope


Comparison of microscopes at minimum zoom level

Comparison of microscopes at minimum zoom level


Comparison of microscopes at maximum zoom level

Comparison of microscopes at maximum zoom level

Magnification measurement
The images are taken with the edge of the camera case pressed right up against the ruler. You could probably remove casing to increase zoom slightly, or create a slot to slide a microscope slide into it. The camera has two focuses the first:

First focal point of microscope

First focal point of microscope

And the second (maximum zoom):

Second focal point of microscope (0.5mm spacing between lines)

Second focal point of microscope (0.5mm spacing between lines)

6mm displayed over 170mm: zoom ~ 30x
0.5mm displayed over 180mm: zoom ~ 360x

This isn’t far off the specified 20x – 400x so I am happy! (Note: Measuring magnification level is rubbish as it depends on screen the image is viewed on, so viewing it on a projector would make the statistics seem more impressive.)

The minimum zoom is less than this as we can move the camera further from the object

Setup in Linux

The beauty of this webcam is that it requires no installation with ubuntu 10.04 you simply need to run the software and the camera works! woo! The output of `lsusb` shows the device as:

Bus 001 Device 004: ID 0ac8:3610 Z-Star Microelectronics Corp.

Software
Most video programs will pick up the device, I am opting to use a program called cheese which is awesome not only because of the name but also because of its simplicity.

sudo apt-get install cheese

Bonus Picture

This is a photo of the pixels on a nexus one phone to show the pentile pixel layout

Nexus One Screen Under the Microscope

Nexus One Screen Under the Microscope

As before any requests for microscope images (within reason) will be considered :)

Find words with the most anagrams efficiently using python

Sep 2 10
by mat

Following my previous post about 9 letter anagrams I am posting the final code I have created taking into account suggestions/snippets from Michael, Toby and Martin. Added two variables to make it nice and easy to modify what to look for.

Code

# -*- coding: utf-8 -*-
from time import time
from collections import defaultdict  

ag_len = 10 # Anagram word length
ag_min = 2  # Min # of anagrams
dictionary_path = '/usr/share/dict/british-english'
tic = time()

wd = defaultdict(set)  
for l in open (dictionary_path, 'r'):
	l=l.strip()
	if ag_len==len(l):
		wd["".join(sorted(l))].add (l)
	
for ws, wl in wd.iteritems():
	if len ( wl ) >= ag_min:
		print " ".join ( wl )


toc = time()
print toc-tic,'s' 

Explanation
The dictionary file is filtered by length into a dictionary. The key for the dictionary is the letter of the word sorted in order, IE:

"".join(sorted('arranging')) = 'aagginnrr'

With the value as the unsorted word. Because words that are an anagram of each other will be identical when sorted this means that using the add method with a dictionary will cause any anagram to share the same key. Eg:

When the dictionary gets to megatons it will create a new key in the dicitonary like so:
{'aegmnost': set(['megatons'])}

Then to magnetos
{'aegmnost': set(['magnetos', 'megatons'])}

Then to montages:
{'aegmnost': set(['magnetos', 'megatons', 'montages'])}

Then we loop over all the items in the dictionary we created and see if the length of the values is greater than the minimum value we are looking for.

All done, a very elegant and simple method to find words with several anagrams for a given word length.

Results

I was going to post the interesting 10 letter anagrams I found however I couldn’t find any with more than 2 anagrams with the dictionary I was using.

There is a 11 letter tripple anagram:

anthologies anthologise theologians

and some 8 letter with 4 or more anagrams:

painters pertains pantries repaints
resident nerdiest inserted trendies
salesmen lameness nameless maleness
strainer restrain terrains retrains trainers
altering triangle relating integral alerting
rangiest ingrates angriest gantries
parroted predator teardrop prorated
iterates teariest treatise treaties
trounces counters recounts construe