Archive for the ‘Uncategorized’ Category

The collection of different types of multimedia files

January 27, 2010

I’m developing MMS on Android platform, so need test different formats of images/audios/videos. Here I found a site which includes many types of multimedia files, so great.

http://samples.mplayerhq.hu/

This is the MPlayer/FFmpeg samples collection.
You can find samples of various common and uncommon
multimedia formats here. The size of the collection
currently is 38GB and growing.

The site has no search functionality, so it is hard to search one format of file. You may using Google, input “<the_keyword> site:samples.mplayerhq.hu”

Hope it is helpful for everyone.

Advertisements

AndroidGuys Podcast #35

January 14, 2010

Google or Goodbye

January 14, 2010

Google will leave China?
Really happens?
Goodbye Google?
Let’s wait for the result in the few weeks.

DroidEx: Projecting Android on the Big(ger) Screen

January 11, 2010

DroidEx: Projecting Android on the Big(ger) Screen

DroidEx displays a copy of your attached Android device’s screen on your own development machine’s screen. Mostly, this is useful for presentations, as you can attach an Android device to a notebook attached to a projector, and your audience can see what is on the device. In particular, this is good for demonstrations of things that cannot readily be demonstrated via the emulator, such as GPS access or the accelerometer.

This version of DroidEx works with the Android 2.0 SDK.

Usage

This version of droidex takes an optional -s switch, with a floating-point value representing by how much to scale the image (e.g., -s 1.25 on an HVGA device will give you a 600×400 projected image). By default, the scale is 1.0, meaning the project image will be as many pixels as is the physical screen size.

Linux & OS X

Set your ANDROID_HOME environment variable to point to the base directory where your Android SDK is installed. Then, just run the droidex shell script from the droidex/ directory.

Windows

It is probably easiest to just copy the droidex shell script to a droidex.cmd batch file, change the classpath separator, replace $ANDROID_HOME with the proper value for your PC, and use the batch file. Also, you will need to replace $1 with %1, etc.

Dependencies

The Android 2.0 SDK, or at least ddmlib.jar. DroidEx also uses args4j, a compatible copy of which is included in the repo.

Compatibility

DroidEx is known to work with: 1. T-Mobile G1 2. Google Ion 3. HTC Tattoo 4. Motorola DROID

DroidEx is known not to work with: 1. HTC Hero (at least early versions distributed by Sprint in the US) 2. ARCHOS 5 Android tablet

Version

Version 1.0, meaning DroidEx has been used a fair bit. The head is what is documented here and is somewhat more leading-edge.

License

The code in this project is licensed under the Apache Software License 2.0, per the terms of the included LICENSE file.

Open Source Development

Those interested in contributing to DroidEx may be interested in the project’s Lighthouse issue tracker and the project’s development Google Group.

Questions

If you have questions regarding the use of this code, please join and ask them on the cw-android Google Group. Be sure to indicate which application you have questions about.

[Via]

http://github.com/commonsguy/droidex

androidscreencast

January 11, 2010

Desktop app to control an android device remotely using mouse and keyboard. Should work on Windows/Linux/MacOS with any android device.

Install

  1. Install the android sdk (download here)
  2. Connect your device through USB cable and ensure it’s detected with “adb devices”
  3. Make sure you have Java Runtime Environnement 5 or later installed
  4. Click HERE. You can launch it by typing “javaws ” from a command line.

Features

  • Mouse and keyboard control FOR ROOTED DEVICES ONLY
  • Landscape mode (right click)
  • Video recording
  • Basic file browser

Current limitations

  • Slow refresh rate (about 4-5 fps)
  • Not all keycode are mapped. SeeKeyMapping

Todo

  • Automatic screen rotation based on the device current state.
  • Improve speed
  • Audio redirection

How can i help ?

  • Donate using this button : (Thank Daniel and Tyler !)
  • Report issues, submit patch, …

[Via]

http://code.google.com/p/androidscreencast/

The Google Maps on Android

January 11, 2010

I collected some links about the Google Maps on Android.


1.
http://android-developers.blogspot.com/2008/09/using-webviews.html

2.
http://code.google.com/p/mapme/
http://developer.db4o.com/ProjectSpaces/view.aspx/MapMe

3.
http://www.anddev.org/google_driving_directions_-_mapview_overlayed-t826.html
http://www.anddev.org/route_-_improved_google_driving_directions-t1892.html
http://csie-tw.blogspot.com/2009/06/android-driving-direction-route-path.html
http://csie-tw.blogspot.com/2009/09/android-update-current-location-by.html

http://mapki.com/wiki/Google_Map_Parameters

This tool will help you retrieve a latitude and longitude value for any point on the map.
http://mapki.com/getLonLat.php

http://code.google.com/intl/zh-CN/apis/maps/

http://jsharkey.org/blog/2008/08/22/driving-directions-in-android-09-sdk/

http://code.google.com/intl/zh-CN/apis/kml/

http://code.google.com/p/wherearemyfriends/

http://www.williamhua.com/2009/04/23/android-touchscreen-gesture-recogniton/
http://www.androidres.com/index.php/2009/06/08/gesturedetector/
http://www.eoeandroid.com/thread-4407-1-1.html

Using Google Maps in Android
http://mobiforge.com/developing/story/using-google-maps-android

ItemizedOverlay & ArrayIndexOutOfBoundsException > explanation AND solution !!
http://groups.google.com/group/android-developers/browse_thread/thread/38b11314e34714c3

Android Tutorial 2: “Hit” testing on a View (MapView)
http://blog.pocketjourney.com/2008/03/19/tutorial-2-mapview-google-map-hit-testing-for-display-of-popup-windows/

Hello, MapView
http://developer.android.com/guide/tutorials/views/hello-mapview.html

Map Tutorials on anddev.org
http://www.anddev.org/viewforum.php?f=18

Tutorial 1: Transparent Panel (Linear Layout) On MapView (Google Map)
http://blog.pocketjourney.com/2008/03/15/tutorial-1-transparent-panel-linear-layout-on-mapview-google-map/#respond

Set HTTP Proxy:
cd /data/data/com.android.providers.settings/databases/
sqlite3 settings.db
select * from system;
insert into system values(99,’http_proxy’,’wwwgate0-ch.mot.com:1080′);

Set DNS:
setprop net.dns1 144.189.5.250
setprop dhcp.tiwlan0.dns1 144.189.5.250

Local search example URL:
http://ajax.googleapis.com/ajax/services/search/local?hl=en&v=1.0&rsz=large&q=supermarket&sll=32.04093120421442,118.78413677215576&start=3

Android LocationManager 使用
http://blog.csdn.net/saint_bxg/archive/2009/07/07/4329008.aspx

Android应用开发实战:GPS与加速度传感器
http://tech.it168.com/a2009/1016/761/000000761365_2.shtml

http://wghjay.javaeye.com/blog/421275

How to get webview’s content into a bitmap?
http://groups.google.com/group/android-developers/browse_thread/thread/5bab2668cd5ab44f/b74b2dbf57bc01c7?lnk=raot

How to capture any screen? [Like screen shot does in DDMS]
http://groups.google.com/group/android-discuss/browse_thread/thread/0c7891cac8225505/8bde5eab18ef05c0#8bde5eab18ef05c0

http://www.google.com/glm/mmap

Google to offer SDK for Android live wallpapers

January 10, 2010

Google to offer SDK for Android live wallpapers

Random people ask to hold my Nexus One every time I pull it out, as I have walked around the show floor of CES. Most of these people know little about Android, but the first thing they always ask about is the live wallpapers. It might seem like a battery draining gimmick to some, but this new feature of Android 2.1 is getting the most buzz from people who are new to Android.

There are currently 10 live wallpapers to choose from and that number will be greatly expanding soon. Google will be releasing a SDK that will allow developers to code their own wallpapers, according to Android Engineer Romain Guy.

What kinds of interactive wallpapers would you like to see developers create?

[Via]

http://androidandme.com/2010/01/news/google-to-offer-sdk-for-android-live-wallpapers/

Post source code on WordPress.com

January 9, 2010

[Via]

http://en.support.wordpress.com/code/posting-source-code/

While WordPress.com doesn’t allow you to use potentially dangerous code on your blog, there is a way to post source code for viewing. We have created a shortcode you can wrap around source code that preserves its formatting and even provides syntax highlighting for certain languages, like so:

1 #button {
2 font-weight: bold;
3 border: 2px solid #fff;
4 }

To accomplish the above, just wrap your code in these tags:

 your code here
 

The language parameter controls how the code is syntax highlighted. The following languages are supported:

  • actionscript3
  • bash
  • coldfusion
  • cpp
  • csharp
  • css
  • delphi
  • erlang
  • fsharp NEW!
  • diff
  • groovy
  • javascript
  • java
  • javafx
  • matlab (keywords only) NEW!
  • objc
  • perl
  • php
  • text
  • powershell
  • python
  • ruby
  • scala
  • sql
  • vb
  • xml

If the language parameter is not set, it will default to “text” (no syntax highlighting).

Code in between the source code tags will automatically be encoded for display, you don’t need to worry about HTML entities or anything.

Configuration Parameters

The shortcodes also accept a variety of configuration parameters that you may use to customize the output. All are completely optional.

  • autolinks (true/false) — Makes all URLs in your posted code clickable. Defaults to true.
  • collapse (true/false) — If true, the code box will be collapsed when the page loads, requiring the visitor to click to expand it. Good for large code posts. Defaults to false.
  • firstline (number) — Use this to change what number the line numbering starts at. It defaults to 1.
  • gutter (true/false) — If false, the line numbering on the left side will be hidden. Defaults to true.
  • highlight (comma-seperated list of numbers) — You can list the line numbers you want to be highlighted. For example “4,7,19″.
  • htmlscript (true/false) — If true, any HTML/XML in your code will be highlighted. This is useful when you are mixing code into HTML, such as PHP inside of HTML. Defaults to false and will only work with certain code languages.
  • light (true/false) — If true, the gutter (line numbering) and toolbar (see below) will be hidden. This is helpful when posting only one or two lines of code. Defaults to false.
  • padlinenumbers (true/false/integer) — Allows you to control the line number padding. true will result in automatic padding, false will result in no padding, and entering a number will force a specific amount of padding.
  • toolbar (true/false) — If false, the toolbar containing the helpful buttons that appears when you hover over the code will not be shown. Defaults to true.
  • wraplines (true/false) — If true, line line wrapping will be disabled. This will cause a horizontal scrollbar to appear for long lines of code.

Here’s some examples of the above parameters in action:

8
</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>This line is not highlighted.</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>This line is highlighted.</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>This line is highlighted.</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>This line is not highlighted.</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>
0001
</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>0002</code></td>
<td><code><</code><code>strong</code><code>>This</</code><code>strong</code><code>> is a short snippit of <</code><code>code</code><code>>code</</code><code>code</code><code>> with padlinenumbers set to 4.</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>0003</code></td>
<td><code>
</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>// Line wrapping has been disabled for this example. You will need to scroll to read all of this text. In addition, this example features no line numbering (gutter) and the toolbar hidden by using the "light" parameter.</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>

And here’s a larger code block to see it all in action. It is set to the PHP language with “htmlscript” enabled and line number 12 highlighted.

01 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
02 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
03 <head>
04 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
05 <title>WordPress.com Code Example</title>
06 </head>
07 <body>
08 <h1>WordPress.com Code Example</h1>
09
10 <p><?php echo 'Hello World!'; ?></p>
11
12 <p>This line is highlighted.</p>
13
14 <p>This line is very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long.</p>
15
16 <div class="foobar">
17 This    is  an
18 example of  smart
19 tabs.
20 </div>
21
22 <p><a href="http://wordpress.com/">WordPress.com</a></p>
23 </body>
24 </html>

↑ Table of Contents ↑

Credits

Alex Gorbatchev’s SyntaxHighlighter project was used in the implemention of this feature. If you are a WordPress.org user and would like to use this feature on your self-hosted blog, it is available as a plugin.

Figure out Google URL shortener – goo.gl

January 9, 2010

You may access the below site to try the URL shortener service of Google:

http://gaigalas.net/lab/googl

Some posts about what is the API:

http://www.kix.in/blog/2009/12/goo-gl/

http://www.labnol.org/internet/create-google-short-url/11748/

The code is:

<html>
	<head>
		<style>
			body 
			{
				height: 50px;
			}
			td
			{
				font-family: arial; 
				font-size: 12;
			}
		</style>
		<script>
			var getUrlShorteningRequestParams = function (b) 
			{
				function c() {
					for (var l = 0, m = 0; m < arguments.length; m++) l = l + arguments[m] & 4294967295;
					return l
				}
				
				function d(l) {
					l = l = String(l > 0 ? l : l + 4294967296);
					var m;
					m = l;
					for (var o = 0, n = false, p = m.length - 1; p >= 0; --p) {
						var q = Number(m.charAt(p));
						if (n) {
							q *= 2;
							o += Math.floor(q / 10) + q % 10
						} else o += q;
						n = !n
					}
					m = m = o % 10;
					o = 0;
					if (m != 0) {
						o = 10 - m;
						if (l.length % 2 == 1) {
							if (o % 2 == 1) o += 9;
							o /= 2
						}
					}
					m = String(o);
					m += l;
					return l = m
				}
				
				function e(l) {
					for (var m = 5381, o = 0; o < l.length; o++) m = c(m << 5, m, l.charCodeAt(o));
					return m
				}
				
				function f(l) {
					for (var m = 0, o = 0; o < l.length; o++) m = c(l.charCodeAt(o), m << 6, m << 16, -m);
					return m
				}
				
				var h = {
					byteArray_: b,
					charCodeAt: function (l) {
						return this.byteArray_[l]
					}
				};
				
				h.length = h.byteArray_.length;
				var i = e(h.byteArray_);
				i = i >> 2 & 1073741823;
				i = i >> 4 & 67108800 | i & 63;
				i = i >> 4 & 4193280 | i & 1023;
				i = i >> 4 & 245760 | i & 16383;
				var j = "7";
				h = f(h.byteArray_);
				var k = (i >> 2 & 15) << 4 | h & 15;
				k |= (i >> 6 & 15) << 12 | (h >> 8 & 15) << 8;
				k |= (i >> 10 & 15) << 20 | (h >> 16 & 15) << 16;
				k |= (i >> 14 & 15) << 28 | (h >> 24 & 15) << 24;
				j += d(k);
				return j;
				return i
			};
			
			var	xmlhttp = new XMLHttpRequest();
			
			function shortify(url)
			{
				var auth_token = getUrlShorteningRequestParams(url);
				var urlEscaped = escape(url).replace(/\+/g,"%2B");
				
				xmlhttp.open("POST", "http://goo.gl/api/url?user=toolbar@google.com&url=" + urlEscaped + "&auth_token=" + auth_token, false);
				xmlhttp.onload = xmlhttpLoad;
				xmlhttp.send(null);
			}
			
			function xmlhttpLoad()
			{
				var object = JSON.parse(xmlhttp.responseText);
				
					if(object.short_url == undefined){
						document.getElementById('shortURL').value += object.error_message;
					}else{
						document.getElementById('shortURL').value += object.short_url;
					}
			}
			
			function copy() 
			{
				var input = document.getElementById('shortURL');
				input.focus();
				input.select();
				document.execCommand('Copy');
				input.blur();
				window.close();
			}
			
			chrome.tabs.getSelected(null,function(tab){ shortify(tab.url);});
		</script> 
	</head>
	<body>
		<table cellpadding="0" cellspacing="0" style="padding-top:3px;">
			<tr>
				<td colspan="2">
					<input type="text" id="shortURL" style="width:150;" readonly="true">
				</td>
			</tr>
			<tr>
				<td>
					powered by goo.gl
				</td>		
				<td style="text-align: right;">
					<a href="javascript:copy()">Copy</a>
				</td>
			</tr>
		</table>
	</body>
</html>

Shared Icons

January 9, 2010

http://www.openshareicons.com/

http://shareicons.com/