Translate

Archive for May, 2010

Geek T-Shirt Collection #21 – Google

Friday, May 28th, 2010

I got this during my “Google fanboy period”. Now I’m a little more critical. I’m now going through an “Android fanboy period”.

There’s a funny story of this shirt. The first day I moved to Miami I was running an errand in downtown and some lady yelled at me from the other side of the street and told me “I use your page every day!”, I didn’t break her heart and just yelled back “Thanks!”

See the Previous T-Shirt
See the Next T-Shirt

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

[SOLVED] Eclipse can’t see my Android Device on Ubuntu

Friday, May 28th, 2010

Are you seeing this on eclipse when you plug your Android device to your Ubuntu box?

Serial Number: ??????????
AVD Name: N/A
Target: unknown
State: ??

Here’s the solution:

1. Create a script to fix this next time it happens, let’s call it “android_device_reset” and save it on a folder contained on your $PATH environment variable.

#!/bin/bash
# android_device_reset script
sudo adb kill-server
sudo service udev stop
sudo adb start-server
sudo adb devices

Save it and make it executable

chmod +x android_device_reset

2. Open this file /etc/udev/rules.d/51-android.rules

Make sure it looks something like this

SUBSYSTEMS=="usb", SYSFS{idVendor}=="0bb4", MODE=="0666"
SUBSYSTEMS=="usb", SYSFS{idVendor}=="22b8", MODE=="0666"

Each line represents a different android device. If you have just one, the file should be one line long.

On that example I’ve configured the rules for a Motorola Droid and a Nexus One.
If you need to know the idVendor numbers for your Android device go here
developer.android.com/guide/developing/device.html#VendorIds

3. Whenever the problem happens, just open a terminal and type

android_device_reset

It’ll ask you for your password, only administrative users will be able to execute the script.

Hope this helps.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

How many lines of code does it take to create the Android OS?

Sunday, May 23rd, 2010

This is a report done on all the projects that make up for the android project, my copy of it is synced as of May 23rd 2010, 6pm
(more…)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Testing Flash Video Playback on the Nokia N900 (Maemo)

Sunday, May 23rd, 2010

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Which phone records video better? N900 or Nexus One

Sunday, May 23rd, 2010

N900

Nexus One

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Who Boots Faster? N900 or Nexus One

Sunday, May 23rd, 2010


Nokia N900 boots Maemo faster than the Nexus One boots Android 2.1.

Let’s see what the story will be with Android 2.2 (Froyo)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Nokia N900 vs Nexus One vs Droid: HD Video Playback comparison

Sunday, May 23rd, 2010

Grabbed the demo video that comes with the N900 to delight you and put it on the 3 phones.

The screen on the Nexus One is the most impressive.

The Droid has a 1/2 sec. lag when you try to jump to another part of the video.

If you don’t care about the screen being so vibrant N900 is just as good doing video playback comparing it with the Nexus One.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Droid vs Nexus 1: Who can calculate MD5 faster?

Friday, May 21st, 2010

Nexus 1 indeed.


17 files get their MD5 calculated on the Droid


and 17 files get their MD5 hash calculated on the Nexus 1

Nexus 1 pwns.

Here’s the code in case you’re curious.

	public void onClick(View v) {
                                _logTextView.setText("MD5 Benchmark on " + Build.DEVICE + "\n\n");
				if (GlobalVariables.APP_CONTEXT == null)
					GlobalVariables.APP_CONTEXT = getApplicationContext();

				List<FileDescriptor> sharedAudioFiles = Engine.INSTANCE.LIBRARIAN.getSharedAudioFiles(0, 17);
				for (FileDescriptor fs: sharedAudioFiles) {
					long start = 0;
					String md5 = null;
					long length = 0;
					try {
						start = System.currentTimeMillis();
						File f = new File(fs.path);
						length = f.length();
						md5 = FrostWireUtils.getMD5(f);

					} catch (Exception e) { }
					long time = System.currentTimeMillis() - start;
					_logTextView.append(FrostWireUtils.getBytesInHuman(length) + " in " + time + " ms @ " + (length/(double) time)*1000 + " b/s\n");
				}
			}

And here’s how we do the MD5

	public final static String getMD5(File f) throws Exception {
		MessageDigest m = MessageDigest.getInstance("MD5");

		byte[] buf = new byte[65536];
		int num_read;

		InputStream in = new BufferedInputStream(new FileInputStream(f));

		while ((num_read = in.read(buf)) != -1) {
			m.update(buf, 0, num_read);
		}

		String result = new BigInteger(1, m.digest()).toString(16);

		// pad with zeros if until it's 32 chars long.
		if (result.length() < 32) {
			StringBuffer padding = new StringBuffer();
			int paddingSize = 32 - result.length();
			for (int i = 0; i < paddingSize; i++)
				padding.append("0");

			result = padding.toString() + result;
		}

		return result;
	}
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Think you’re in a big project?

Tuesday, May 18th, 2010

Recently I became curious on how many lines of code a huge open source project I contribute to has on what languages. I found a tool called “cloc” on sourceforge, check out the results and I dare you to think again if you think you’re in a big project.
(more…)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

[SCREENCAST] How to do Unit Testing on Android with Eclipse

Sunday, May 2nd, 2010

I was going to make a tutorial, but then I figured that making a video would be a much better way to show this.
As for the code that you could grab from a tutorial, there’s a link at the end of the post with all the code shown in the video demo.

The video demo covers how to create and run Unit Test classes for regular Java classes on Android, and also how to create and run Unit Test classes that test classes that depend on Android “Context” or “Activity” objects.

If your Android unit tests are not running because of frustrating error messages, the time spent watching this video will save you a lot of reading and headaches.

Check the screencast after the break

(more…)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)


  • Categories

  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • October 2009
  • September 2009
  • July 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • March 2005
  • February 2005
  • January 2005
  • December 2004
  • November 2004
  • October 2004