Laman

Monday, May 31, 2010

On Android Compatibility

[This post is by Dan Morrill, Open Source & Compatibility Program Manager. — Tim Bray]

At Google I/O 2010, we announced that there are over 60 Android models now, selling 100,000 units a day. When I wear my open-source hat, this is exciting: every day the equivalent of the entire population of my old home city starts using open-source software, possibly for the first time. When I put on my hat for Android Compatibility, this is humbling: that’s a whole lotta phones that can all share the same apps.

Another thing we launched at Google I/O was an upgraded and expanded source.android.com. The new version has refreshed info on the Android Open-Source Project, and some new tips and tools for device manufacturers — useful if you’re an OEM. However, it also has details on the Android compatibility program, now. This is also aimed mostly at OEMs, but Tim Bray suggested that developers might be interested in a peek at how we keep those 100,000 devices marching to the same beat, every day. So here I am, back on the blog.

The F-word, or, Remember remember the fifth of November

I remember sitting with my colleagues in a conference room in Building 44 on November 5, 2007, listening to Andy Rubin and Eric Schmidt announce Android to the world. I remember a lot of the press stories, too. For instance, Android was “just words on paper” which was especially entertaining since I knew we were getting ready to launch the first early-look SDK a mere week later.

Another meme I remember is... yes, “fragmentation”. Literally before the close of business on the same day we announced Android (4:46pm to be precise), I saw the first article about Android “fragmentation.” The first day wasn’t even over yet, and the press had already decided that Android would have a “fragmentation” problem.

The thing is, nobody ever defined “fragmentation” — or rather, everybody has a different definition. Some people use it to mean too many mobile operating systems; others to refer to optional APIs causing inconsistent platform implementations; still others use it to refer to “locked down” devices, or even to the existence of multiple versions of the software at the same time. I’ve even seen it used to refer to the existence of different UI skins. Most of these definitions don’t even have any impact on whether apps can run!

Because it means everything, it actually means nothing, so the term is useless. Stories on “fragmentation” are dramatic and they drive traffic to pundits’ blogs, but they have little to do with reality. “Fragmentation” is a bogeyman, a red herring, a story you tell to frighten junior developers. Yawn.

Compatibility

Now, that’s not to say that there aren’t real challenges in making sure that Android devices are compatible with each other, or that there aren’t very real concerns that keep app developers awake at night. There definitely are, and I spend a great deal of time indeed thinking about them and addressing them. The trick is to define them clearly.

We define “Android compatibility” to be the ability of a device to properly run apps written with the Android SDK. This is a deceptively simple way to frame it, because there are a number of things that can go wrong. Here are a few:

  • Bugs - devices might simply have bugs, such as a buggy Bluetooth driver or an incorrectly implemented GPS API.

  • Missing components - devices might omit hardware (such as a camera) that apps expect, and attempt to “fake” or stub out the corresponding API.

  • Added or altered APIs - devices might add or alter APIs that aren’t part of standard Android. Done correctly this is innovation; done poorly and it’s “embrace and extend”.

Each of these is an example of something that can make an app not run properly on a device. They might run, but they won’t run properly. These are the things that I spend my time preventing.

How It Works

As stewards of the platform we realize that it’s vital to allow only compatible devices to participate in the Android ecosystem. So, we make compatibility a strict prerequisite for access to Android Market and the right to use the Android name. This means that developers can rely on the fact that Android Market — the keystone of the Android ecosystem — will only allow their apps to run on compatible devices. It’s pretty self-evident that a single app ecosystem is better than many small ones, so OEMs are generally pretty motivated to ship compatible devices.

But motivation alone doesn’t get us very far without tools to actually ensure compatibility, which is where the Android compatibility program comes in. This program is like a stool with three legs: the Android source code, the Compatibility Definition Document, and the Compatibility Test Suite.

It all starts with the Android source code. Android is not a specification, or a distribution in the traditional Linux sense. It’s not a collection of replaceable components. Android is a chunk of software that you port to a device. For the most part, Android devices are running the same code. The fact that all Android devices run the same core Android code goes a long way toward making sure those devices all work the same way.

However, this doesn’t solve the problems of missing components or altered APIs, because the source code can always be tweaked. This is where the Compatibility Definition Document (or CDD) comes in. The CDD defines in gory detail exactly what is expected of Android devices. It clearly states, for example, that devices may not omit most components, and that the official Android APIs may not be altered. In a nutshell, the CDD exists to remove ambiguities around what’s required of an Android device.

Of course, none of that overcomes the simple reality of human error — bugs. This is where the Compatibility Test Suite comes in. The CTS is a collection of more than 20,000 test cases that check Android device implementations for known issues. Device makers run the CTS on their devices throughout the development process, and use it to identify and fix bugs early. This helps ensure that the builds they finally ship are as bug-free as possible.

Keeping Up with the Times

We’ve been operating this compatibility process with our OEM partners for over a year now, and it’s largely responsible for those 60+ device models being interoperable. However no process is ever perfect and no test suite is ever 100% comprehensive, and sometimes bugs get through. What happens then?

Well, we have great relationships with our OEMs, and like I said, they’re motivated to be compatible. Whenever we hear about a serious bug affecting apps, we report it to our partners, and they typically prepare a bugfix release and get it out to end users. We will also typically add a test case to the CTS to catch that problem for future devices. It’s an ongoing process, but generally our partners are as interested as we are in the user experience of the devices they sell.

The mobile industry today is “very exciting”, which is code for “changes painfully fast”. We believe that the only way Android will be a success is to keep up with that change, and ultimately drive that change. This means that over time, the CDD will also change. We’ll add new text to handle problem cases we encounter, and the actual requirements will change to accommodate the innovations happening in the field. For example, in the 2.1/Eclair CDD, we tweaked the CDD slightly to make telephony optional, which allows Android to ship compatibly on non-phone handheld devices. Whenever we do this, of course, we’ll make corresponding changes to the Android APIs and Android Market to make sure that your apps are protected from ill effects.

On a somewhat related note, a lot of ink has been spilled on the fact that there are multiple versions of Android out there in users’ hands at the same time. While it’s true that devices without the latest software can’t run some of the latest apps, Android is 100% forward compatible — apps written properly for older versions also run on the newest versions. The choice is in app developers’ hands as to whether they want to live on the bleeding edge for the flashiest features, or stay on older versions for the largest possible audience. And in the long term, as the mobile industry gets more accustomed to the idea of upgradeable phone software, more and more devices will be be upgraded.

What It Means for You

All that is great — but what does it mean for developers? Well, we put together a page in the SDK Documentation to explain this, so you should take a look there. But really it boils down to this:

  1. As a developer, you simply decide what features your app requires, and list them in your app’s AndroidManifest.xml.

  2. The Android compatibility program ensures that only compatible devices have access to Android Market.

  3. Android Market makes sure your app is only visible to those devices where it will run correctly, by filtering your app from devices which don’t have the features you listed.

That’s all!

There almost certainly will be devices that have access to Android Market that probably weren’t quite what you had in mind when you wrote your app. But this is a very good thing — it increases the size of the potential audience for your app. As long as you accurately list your app’s requirements, we’ll do the rest and make sure that your app won’t be accessible to a device where it won’t run properly. After all, we’re app developers ourselves, and we know how painful it is to deal with users upset about an app not working on a device it wasn’t designed for.

Now, that’s not to say that we think our current solution is perfect — no solution is. But we’re continuously working on improvements to the SDK tools and Android Market to make your life as an Android developer even easier. Keep an eye on this blog and on the Android Market itself for the latest info.

Thanks for reading, and happy coding!

READ MORE - On Android Compatibility

Sunday, May 30, 2010

Another exercise of SurfaceView, in a FrameLaout inside another LinearLayout

It's another exercise of using FurfaceView in Android.

In the previous exercises "Android SurfaceView" and "Android SurfaceView, run in Thread with sleep()", the layout was simple a FrameLayout composed of a SurfaceView only, setup using programming code setContentView(R.layout.main).

In this exercise, it's a FrameLayout inside a LinearLayout, together with two buttons. The FrameLayout is composed of a SurfaceView. And the layout is defined in main.xml. Both the MySurfaceView(extends SurfaceView) and the MySurfaceThread(extends Thread) are implemented as separated class. When the application is running, there are two buttons over the FrameLayout with SurfaceView, a dot bounce inside the SurfaceView. User can click the first button to make the another button invisible, to change the dimension of the FrameLayout in run-time, and the SurfaceView change also accordingly.



main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="@+id/showhide"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Toggle The Another Button Show/Hide" />
<Button
android:id="@+id/dummy"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="a Button" />
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.exercise.AndroidMergeSurfaceView.MySurfaceView
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</FrameLayout>
</LinearLayout>


MySurfaceView.java
package com.exercise.AndroidMergeSurfaceView;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class MySurfaceView extends SurfaceView implements SurfaceHolder.Callback{

private MySurfaceThread thread;
private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
int cx, cy, offx, offy;

public MySurfaceView(Context context) {
super(context);
// TODO Auto-generated constructor stub
init();
}

public MySurfaceView(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
init();
}

public MySurfaceView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
init();
}

private void init(){
getHolder().addCallback(this);
thread = new MySurfaceThread(getHolder(), this);

setFocusable(true); // make sure we get key events

paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(3);
paint.setColor(Color.WHITE);

cx = 0;
cy = 0;
offx = 10;
offy = 10;

}

@Override
public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) {
// TODO Auto-generated method stub

}

@Override
public void surfaceCreated(SurfaceHolder holder) {
// TODO Auto-generated method stub
thread.setRunning(true);
thread.start();

}

@Override
public void surfaceDestroyed(SurfaceHolder holder) {
// TODO Auto-generated method stub
boolean retry = true;
thread.setRunning(false);
while (retry) {
try {
thread.join();
retry = false;
}
catch (InterruptedException e) {
}
}
}

@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
canvas.drawRGB(0, 0, 0);
canvas.drawCircle(cx, cy, 3, paint);
cx += offx;
if (cx > getWidth() || (cx < 0)){
offx *= -1;
cx += offx;
}

cy += offy;
if (cy > getHeight() || (cy < 0)){
offy *= -1;
cy += offy;
}
}
}


MySurfaceThread.java
package com.exercise.AndroidMergeSurfaceView;

import android.graphics.Canvas;
import android.view.SurfaceHolder;

public class MySurfaceThread extends Thread {
private SurfaceHolder myThreadSurfaceHolder;
private MySurfaceView myThreadSurfaceView;
private boolean myThreadRun = false;

public MySurfaceThread(SurfaceHolder surfaceHolder, MySurfaceView surfaceView) {
myThreadSurfaceHolder = surfaceHolder;
myThreadSurfaceView = surfaceView;
}

public void setRunning(boolean b) {
myThreadRun = b;
}

@Override
public void run() {
// TODO Auto-generated method stub
while(myThreadRun){
Canvas c = null;

try{
c = myThreadSurfaceHolder.lockCanvas(null);
synchronized (myThreadSurfaceHolder){
myThreadSurfaceView.onDraw(c);
}
sleep(100);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally{
// do this in a finally so that if an exception is thrown
// during the above, we don't leave the Surface in an
// inconsistent state
if (c != null) {
myThreadSurfaceHolder.unlockCanvasAndPost(c);
}
}
}
}
}


AndroidMergeSurfaceView.java
package com.exercise.AndroidMergeSurfaceView;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class AndroidMergeSurfaceView extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Button buttonShowHide = (Button)findViewById(R.id.showhide);
final Button buttonDummy = (Button)findViewById(R.id.dummy);

buttonShowHide.setOnClickListener(
new Button.OnClickListener(){

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
if(buttonDummy.getVisibility()==View.VISIBLE){
buttonDummy.setVisibility(View.GONE);
}
else{
buttonDummy.setVisibility(View.VISIBLE);
}
}

}
);

}
}


Download the files.

Further exercise on SurfaceView: SurfaceView overlap with a LinearLayout









It's a bug here!


Pls. refer to the article
"IllegalThreadStateException in LunarLander"
for details.


I'm Sorry about that! ()



READ MORE - Another exercise of SurfaceView, in a FrameLaout inside another LinearLayout

Saturday, May 29, 2010

Different ways for Notifying Users in Android

The 3 main different ways to notify an user are,

Dialog
Toast
Notification

Dialog

For notifying users with dialog, We will create an object of dialog. In this, I am removing the title using requestWindowFeature(Window.FEATURE_NO_TITLE) and adding a layout to the dialog to it using addContentView().

Toast

Second one is toast, that will flash and will display for a predefined period either as, Toast.LENGTH_SHORT or Toast.LENGTH_LONG.

Notification

Third one is notification, to notify user, about any background activity is started.

The complete sample programs is,

 
public class NotifyUser extends Activity {

LayoutParams panelParams, compParams, tvParams;
LinearLayout popupGrid;
LinearLayout buttonLayout;
TextView tv;
Button b1, b2;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
displayDialog();
displayToast();
displayNotification();
}

public void displayDialog() {
Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().getAttributes().width = 250;
popupGrid = new LinearLayout(this);
buttonLayout = new LinearLayout(this);
tv = new TextView(this);
b1 = new Button(this);
b2 = new Button(this);
panelParams = new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT);
panelParams.width = 250;
compParams = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
tvParams = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);

buttonLayout.setOrientation(LinearLayout.HORIZONTAL);
popupGrid.setOrientation(LinearLayout.VERTICAL);
tv.setText("Are you sure?");
b1.setWidth(100);
b2.setWidth(100);
b1.setText("Yes");
b2.setText("No");
tvParams.setMargins(80, 0, 0, 0);
panelParams.setMargins(20, 0, 0, 0);
popupGrid.addView(tv, tvParams);
buttonLayout.addView(b1, compParams);
buttonLayout.addView(b2, compParams);
popupGrid.addView(buttonLayout, panelParams);
dialog.addContentView(popupGrid, panelParams);
dialog.show();
}

public void displayToast() {
Toast.makeText(this, "Sorry, please try again", Toast.LENGTH_SHORT)
.show();
}

public void displayNotification() {
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
CharSequence from = "Nithin";
CharSequence message = "Crazy About Android...";
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(), 0);
Notification notif = new Notification(R.drawable.icon,
"Crazy About Android...", System.currentTimeMillis());
notif.setLatestEventInfo(this, from, message, contentIntent);
nm.notify(1, notif);
}
}



In notification, itself different forms are there. - when we click on the notification, it will take us to a new activity. For this, in pendingIntent, for the intent object, specify the acitivity, that we want to go.


PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, SampleActivity.class), 0);


Another form is, we can customize the notification layout using custom expanded view. For this create a layout in XML and use remoteView to use the XML. Use remoteView methods to set ImageView and TextView. The XML is,


android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="3dp"
>
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dp"
/>
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textColor="#000"
/>




The complete method is,


public void displayNotificationWithExandedView() {
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notif = new Notification(R.drawable.icon,
"Crazy About Android...", System.currentTimeMillis());
RemoteViews contentView = new RemoteViews(getPackageName(),
R.layout.notify_layout);
contentView.setImageViewResource(R.id.image, R.drawable.icon);
contentView.setTextViewText(R.id.text,
"Hello, this message is in a custom expanded view");
notif.contentView = contentView;
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, SampleActivity.class), 0);
notif.contentIntent = contentIntent;
nm.notify(1, notif);
}



The screenshots are,







READ MORE - Different ways for Notifying Users in Android

Wallpaper Guides Athens

http://3.bp.blogspot.com/-GFhf23aezMk/TiAJLgG4b2I/AAAAAAAAGI4/PldNqKDHcLE/s1600/mykonos---greece_wallpapers_29495_1600x1200.jpg
Athens Greece Beach Wallpaper | PicsWallpaper.com




http://1.bp.blogspot.com/-P1stC8OXnKk/TjPgzBGbkYI/AAAAAAAAAng/lKwN-XKzHaA/s1600/Dubai-Jumeirah-Beach-Wallpaper.jpg
world Tour Center: Dubai City Wallpapers


http://3.bp.blogspot.com/_uwy98ZWgnzA/TQNYPR_ECII/AAAAAAAAAhY/3aRtigicCok/s1600/Moonrise_Over_Santorini_Greece.jpg
Athens+greece+beaches


unfuckingbeatable.xvideosmix.com


http://1.bp.blogspot.com/-dF3dTfAjJkg/TkPNp8Lc8YI/AAAAAAAAACI/4lhXSvxMBcw/s1600/Greece+Island.jpg
Greece Island Wallpaper | Wallpapers Stocks


http://1.bp.blogspot.com/-JBWZ2rp5dd8/TbKQ1Ws7KSI/AAAAAAAAAHU/l2F7GMnednA/s1600/ac%252Bmilan%252Bbackground.jpg
Pato: AC. MILAN 1992 - 1993


http://2.bp.blogspot.com/-hUurNYqX2YU/TcgirbXebiI/AAAAAAAAAAY/WqUPauwMFoc/s1600/Greece%20from%20satellite.jpg
Greece Page 11 Images


http://2.bp.blogspot.com/_XGnQrL8fEK4/TF4QnFvVoDI/AAAAAAAAADc/W8TlbIyPf40/s1600/ac-milan-fotball-club-wallpaper-3-1024x768.jpg
SOCCER INFINITY: Watch Live!!! Panathinaikos Athens vs AC Milan a Club ...


http://4.bp.blogspot.com/-J5dhk8W68yc/TVo6URciqhI/AAAAAAAACfo/3ML6P2qelyY/s1600/DSCF1647.JPG
Murrayfield West Stand


http://2.bp.blogspot.com/-1pHY3vUgcds/TXoaoaYMFCI/AAAAAAAANFA/lw5tL-JiGfM/s1600/Peugeot-206_2003_1280x960_wallpaper_05.jpg
Peugeot 206 rc (2) 2.0 rc 180 3p Essence 2003 occasion - Tarif : 7600 ...


http://2.bp.blogspot.com/-wcqDaPIyKcw/T0ihSwGNwcI/AAAAAAAAAxc/oxu1HnJPCYM/s1600/greece-wallpaper-2.jpg
Visit Greece this summer !


http://2.bp.blogspot.com/-Bz2auPeaXBk/T0ihdzDlnEI/AAAAAAAAAx8/SyNxLr03Ovg/s1600/greece-wallpaper-8.jpg
Visit Greece this summer !


http://3.bp.blogspot.com/-rQa0Ou8h9sg/T0ihKrxRpcI/AAAAAAAAAxE/nmQvYQCluGc/s1600/greece-wallpaper-10.jpg
Visit Greece this summer !


http://3.bp.blogspot.com/_4Y1gqCx6GD8/TFZ2AZsJAfI/AAAAAAAAByc/HceoKfpO7R8/s1600/jesus-nazareth-585.jpg
MyGreekSpirit: August 01, 2010


http://1.bp.blogspot.com/_8n9QottWCtY/TOeNUbMgkQI/AAAAAAAAAJ4/wMbhgIkc72c/s1600/spetses%2Bgreek%2Bisland%2Bpostcard.jpg
Modern Greek City


http://2.bp.blogspot.com/-sIwoxugFECU/Tavdvbe7GdI/AAAAAAAADVc/y9FZlSRX2vI/s1600/IMG_9696.JPG
Glamour Fashion: Bikini models ! Female Celebrity models ! free sexy ...


http://4.bp.blogspot.com/-Cx3w0jbXIHU/T-9SaAoNNwI/AAAAAAAAAWg/ysib2i5d1oI/s1600/HotWallpapers.Me%2B%2B%2B051.jpg
Space celebrities on zedge- most sexy wallpapers.


http://4.bp.blogspot.com/-oxT1FEy6k94/TYGRbMk0K7I/AAAAAAAABvo/qLYbCgxqzno/s1600/il_fullxfull.206226703.jpg
Glamour Fashion: Bikini models ! Female Celebrity models ! free sexy ...


http://1.bp.blogspot.com/_ghkg0_8bBKw/THwRUCpuJbI/AAAAAAAAAAM/MVkmlJvSXVo/s1600/Red-Islamic-Calligraphy-Wallpaper.jpg
Allah In Red


http://1.bp.blogspot.com/_nvQAgG-XMu0/TSAqW6ESegI/AAAAAAAAA9A/j_l33aKuvcA/s1600/DSCF2563.JPG
Glamour Fashion: Bikini models ! Female Celebrity models ! free sexy ...


http://3.bp.blogspot.com/-MqCPDDNYD-8/TlBsrYeR0kI/AAAAAAAAAOs/IbtS5qL6nVI/s1600/266854_203710986346565_145166332201031_646619_5767133_o.jpg
24/10 L'équipe de DEF du TFOC Volley-bal...


http://1.bp.blogspot.com/_I3wqw9MmWnQ/TVDOR49EvdI/AAAAAAAAAx4/6nwUjACm2II/s1600/IMG_0043.JPG
storing lily bulbs


http://3.bp.blogspot.com/_NT2qYHHyMZA/TLJkfDBJN2I/AAAAAAAABIs/wLLsreSHSMg/s1600/%2527Head_of_a_muse%2527_by_Raffaello_Sanzio.JPG
Raffaello Sanzio 1483-1520 | Renaissance Drawings | Tutt'Art ...


http://1.bp.blogspot.com/-dSZX1oBJKXQ/UJPRNbyAonI/AAAAAAAAAO4/eNK8m-l1U_s/s1600/mr%2Bmen.jpg
Orange Mr Men


http://2.bp.blogspot.com/-vfUaS1fxd6A/Tax-_M3_LnI/AAAAAAAABvA/mmiFqEVTIJ4/s1600/Zeus_Thumbnail.jpg
Zeus Throwing Lightning


http://24.media.tumblr.com/tumblr_mam1czrlov1rtn3ufo1_1280.jpg
Ancient Greek Images


READ MORE - Wallpaper Guides Athens

Data Storage in Android

The storage system in Android are mainly divided into 3 types.

Database(sqlite)
File
SharedPreference

Database is already explained in my older post and you can see here

Files

Android can save files directly to the device internal storage. These files are private to the application and will be removed if you uninstall the application.

We can create a file using openFileOutput() with parameters as file name and the operating mode. Similarly, we can open the file using openFileInput() passing the parameter as the fileName. One thing, that we need to remeber is, give the file name with extension. In this example I am creating a text(.txt) file.

The complete code is,

  
public class ReadNWriteFile extends Activity {

final String TEST_STRING = new String("Hello Android");
final String FILE_NAME = "SAMPLEFILE.txt";

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
fileCreate();
tv.setText(readFile());
setContentView(tv);
}

private void fileCreate() {
try {
OutputStream os = openFileOutput(FILE_NAME, MODE_WORLD_READABLE);
OutputStreamWriter osw = new OutputStreamWriter(os);
osw.write(TEST_STRING);
osw.close();
} catch (Exception e) {
Log.i("ReadNWrite, fileCreate()", "Exception e = " + e);
}
}

private String readFile() {
try {
FileInputStream fin = openFileInput(FILE_NAME);
InputStreamReader isReader = new InputStreamReader(fin);
char[] buffer = new char[TEST_STRING.length()];
// Fill the buffer with data from file
isReader.read(buffer);
return new String(buffer);
} catch (Exception e) {
Log.i("ReadNWrite, readFile()", "Exception e = " + e);
return null;
}
}
}


SharedPreferences

SharedPreference is another persistent storage mechanism in Android. In this, we can store the data in key-value pairs. One drawback is it allows only primitive data types and String. We can get an object of shared preference using getSharedPreferences(). One thing, we need to remember is after writing anything to sharedPreference, we need to do commit(). Then only new values will be reflected. We can write values into sharedPreference using put() methods like putInt(), putString() etc and can retrieve the values from sharedPreference using get() methods as getInt(), getString() etc.

A sample program is,


public class DataStorage extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences pref = getSharedPreferences("Preference",
MODE_WORLD_READABLE);
SharedPreferences.Editor editor = pref.edit();
editor.putBoolean("keyBoolean", true);
editor.putFloat("keyFloat", 1.0f);
editor.putInt("keyInt", 1);
editor.putLong("keyLong", 1000000L);
editor.putString("keyString", "Hello Android");
editor.commit();

boolean dataFromPrefBool = pref.getBoolean("keyBoolean", false);
float dataFromPrefflaot = pref.getFloat("keyFloat", 0.0f);
int dataFromPrefInt = pref.getInt("keyInt", 0);
long dataFromPrefLong = pref.getLong("keyLong", 0);
String dataFromPrefString = pref.getString("keyString", null);
}
}


In the put(), we are passing key and value and in get(), we are passing key and the default value if the key is not present in the sharedPreference.
READ MORE - Data Storage in Android

Thursday, May 27, 2010

Pixel Zombies Live Wallpaper FAQ

I added a FAQ to the Pixel Zombies Live Wallpaper page to address some of the questions I’ve been seeing, including how to drop nukes and the scores/stats being hidden on certain phones.  Thanks to everyone who has purchased it so far, I hope you are enjoying it and I look forward to putting out some sweet updates for you this summer :)

READ MORE - Pixel Zombies Live Wallpaper FAQ

Android Cloud To Device Messaging

[This post is by Wei Huang, who helped implement this feature. — Tim Bray]

In the just-launched Android 2.2, we’ve added a new service to help developers send data from servers to their applications on Android phones. Android Cloud to Device Messaging (C2DM) makes it easier for mobile applications to sync data with servers.

Most of the useful applications on your mobile phone use the Internet to keep users connected. Traditionally, many apps use polling to fetch data periodically. POP mail clients, for example, connect to the server every 15 minutes or so. Polling is fairly easy to implement, and works well in many situations. It’s tricky, though, to select the frequency: Poll too often, you may not see any new data, and create unnecessary stress on the server and network. Poll too rarely and the data on the device may become stale. Polling is especially problematic on mobile devices, because it consumes precious network bandwidth and battery life.

Having the server push messages to the client asynchronously may be a superior choice for getting the latest data to your applications, resulting in fresher data and more efficient use of the network and your battery. However, it’s also tricky to implement a good push solution, and it isn’t free as there is some overhead in maintaining the required connection. On a mobile device like an Android phone, implementing applications to receive these messages is tricky; you have to worry about patchy network coverage and zombie connections created when the wireless carrier’s routers time out connections that are idle for too long.

Many of the Google applications on Android already use push to keep their data fresh, for example Gmail, Contacts, and Calendar. Starting with Android 2.2, C2DM allows third-party developers to use the same service the Google apps do.

Here are a few basic things to know about C2DM:

  • It requires Android 2.2; C2DM uses Google services which are present on any device running the Android Market.

  • It uses existing connections for Google services. This requires the users to sign into their Google account on Android.

  • It allows 3rd party servers to send lightweight data messages to their apps. The C2DM service is not designed for pushing a lot of user content; rather it should be used like a “tickle”, to tell the app that there is new data on the server, so the app can fetch it.

  • An application doesn’t need to be running to receive data messages. The system will wake up the app via an Intent broadcast when the the data message arrives, so long as the app is set up with the proper Intent Receiver and permissions.

  • No user interface is required for receiving the data messages. The app can post a notification (or display other UI) if it desires.

It’s easy to use the C2DM API. Here is how it works:

  • To enable C2DM, an application on the device registers with Google and get a registration ID, and sends the ID to its server.

  • When the server needs to push a message to the app on the device, it posts the message via HTTP to Google’s C2DM servers.

  • The C2DM servers route the message to the device, and an Intent broadcast is sent to the app.

  • The app is woken up to process the message in its Intent Receiver.

  • The app can unregister with C2DM when the user no longer wants messages to be pushed to it.

That’s about it! All you need is a server that knows to talk HTTP, and an Android app that knows how to use the Intent APIs. Below are some code samples:

// Use the Intent API to get a registration ID
// Registration ID is compartmentalized per app/device
Intent regIntent = new Intent(
"com.google.android.c2dm.intent.REGISTER");
// Identify your app
regIntent.putExtra("app",
PendingIntent.getBroadcast(this /* your activity */,
0, new Intent(), 0);
// Identify role account server will use to send
regIntent.putExtra("sender", emailOfSender);
// Start the registration process
startService(regIntent);

The registration ID will be delivered back to your app via an intent broadcast with the Intent Action com.google.android.c2dm.intent.REGISTRATION. Here is a code sample to receive the registration ID.

// Registration ID received via an Intent
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (“com.google.android.c2dm.intent.REGISTRATION”.equals(action)) {
handleRegistration(context, intent);
}
}

public void handleRegistration(Context context, Intent intent) {
String id = intent.getExtra(“registration_id”);
if ((intent.getExtra(“error”) != null) {
// Registration failed. Try again later, with backoff.
} else if (id != null) {
// Send the registration ID to the app’s server.
// Be sure to do this in a separate thread.
}
}

On the server side, your server needs to get a ClientLogin Auth token in order to talk to the C2DM servers. When it wants to push a message to the device, it can send an authenticated http POST with:

  • Authorization: GoogleLogin auth=<auth token>

  • URL encoded parameters including the registration id, the data key/value pairs, a “collapse key” used for overriding old messages with the same key on the Google C2DM servers, and a few other optional params.

When you use the C2DM service, you no longer need to worry about dealing with flaky mobile data connections, or when the user isn’t connected to the internet (i.e. Airplane mode). C2DM keeps the messages in the server store, and delivers them when the device comes back online. Basically, you can leave all the hard work of designing a robust push service to Google. Your application can take advantage of push infrastructure we’ve already built and tested, and stay more connected to the internet. Best of all, you won’t ruin the users’ battery life.

Information about how to build C2DM enabled applications on Android is online at the code lab, and more will be coming as we approach general release.

READ MORE - Android Cloud To Device Messaging

Tuesday, May 25, 2010

Pixel Zombies Launch Day Roundup

Wow, what a day! I launched Pixel Zombies almost 24 hours ago, and I was definitely not expecting this level of excitement or coverage.  I hope that everyone who has purchased the app is enjoying it, and I look forward to making many improvements, tweaks, and new features in the future.

Thanks to all the sites that have covered the app!  Here are some links to the articles as well as some quotes:

“Zombies. Brains. Zombie hunters. Nuclear bombs. Statistics. You love all of these things, and now you can have them as the live wallpaper on your Android phone.”

- Gizmodo

“My heart has a huge soft spot for zombies — just the kind of moist and tender spot that would make it the perfect snack for the living dead — so when I heard about the Pixel Zombies Live Wallpaper I couldn’t help but immediately assume it was the coolest Live Wallpaper ever.”

- Phandroid

“…as soon as I'm done writing this I'm buying it from the Android Market so it's mine forever.”

- Android Central

“…this neat little $1 outbreak will have you staring at your wallpaper for hours trying out hundreds of different configurations to find out just how you might survive the next zombie apocalypse yourself.”

- Examiner

 

Have fun simulating the zombie apocalypse and nuking endless populations on your phones!

[Note: Droid 2.1 owners, I’m aware some of you are having issues seeing the app in the Android Market and am trying to figure out why.  Know that I’m on it and let me know if anyone has tips on what may be the problem!]

READ MORE - Pixel Zombies Launch Day Roundup

Two view in one FrameLayout

In my previous exercise "Draw a bitmap on View", "Draw something on a Canvas", "Android FaceDetector" and "Custom View with User Interaction", everything is drawn on ONE view. In this exercise, it will be separated in two views. The un-changed bitmap is drawn on View1, and user interaction is drawn on View2. Such that, everytime VIew2.onDraw() will redraw the interactive part only, no need to re-draw the bitmap.

Two view in one FrameLayout

The layout file, main.xml, is modified to use a FrameLayout with two View, cover whole of the screen.

- place a bitmap of 320x480 in /res/drawable/ folder, or using the bitmap in the downloaded files.

- Create two view class extends View

View1.java
package com.exercise.AndroidTwoView;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.View;

public class View1 extends View {

public View1(Context context) {
super(context);
// TODO Auto-generated constructor stub
}

public View1(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}

public View1(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// TODO Auto-generated method stub
setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec),
MeasureSpec.getSize(heightMeasureSpec));
}

@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
Bitmap myBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.googlelogo320x480);
canvas.drawBitmap(myBitmap, 0, 0, null);

}

}


View2.java
package com.exercise.AndroidTwoView;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;

public class View2 extends View {

private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
float cx = 0, cy =0;
boolean draw = false;

public View2(Context context) {
super(context);
init();
}

public View2(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}

public View2(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}

private void init(){
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(3);
paint.setColor(Color.BLUE);
setFocusable(true);
}

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// TODO Auto-generated method stub
setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec),
MeasureSpec.getSize(heightMeasureSpec));
}

@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
if (draw){
canvas.drawCircle(cx, cy, 3, paint);
}
}

@Override
public boolean onTouchEvent(MotionEvent event) {
// TODO Auto-generated method stub
int action = event.getAction();

if (action==MotionEvent.ACTION_DOWN){
cx = event.getX();
cy = event.getY();
draw = true;
invalidate();
}

return true;
}

}


- Modify main.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.exercise.AndroidTwoView.View1
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<com.exercise.AndroidTwoView.View2
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</FrameLayout>


- AndroidTwoView.java actually no change from the auto-generated.

Download the files.
READ MORE - Two view in one FrameLayout

Dalvik JIT

[This post is by Dan Bornstein, virtual-machine wrangler. — Tim Bray]

As the tech lead for the Dalvik team within the Android project, I spend my time working on the virtual machine (VM) and core class libraries that sit beneath the Android application framework. This layer is mostly invisible to end users, but done right, it helps make Android devices run smoothly and improves developer productivity.

The 2.2 release is particularly pleasing to me, as it is the first release since before 1.0 in which we have been able to deliver significantly new VM technology. And unlike much of what my team and I do, it is something that can be experienced directly by end users.

“Dalvik” isn’t exactly a household word (at least in my country), and most people wouldn’t know a virtual machine if it hit them in the face, but when you tell them you were able to make their existing device work better — run faster, use less battery — they will actually take notice!

What Makes This Possible?

We added a Just In Time (JIT) compiler to the Dalvik VM. The JIT is a software component which takes application code, analyzes it, and actively translates it into a form that runs faster, doing so while the application continues to run. If you want to learn more about the design of the Dalvik JIT, please watch the excellent talk from Google I/O 2010 given by my colleagues Bill Buzbee and Ben Cheng, which should be posted to YouTube very soon.

To be clear, the differences aren’t always dramatic, nor do they apply uniformly to all applications. Code that is written to run the CPU all-out can now do more in the same amount of time (running faster), and code that is written to be rate-limited can get its work done using less time and less of the CPU (using less battery). On the performance front in particular, we have seen realistic improvements of 2x to 5x for CPU-bound code, compared to the previous version of the Dalvik VM. This is equivalent to about 4x to 10x faster than a more traditional interpreter implementation.

The team is proud of our new JIT in general, but we are especially proud of two aspects of it:

Many previous JIT implementations react slowly, delivering performance improvements only after a long warm up period. In the extreme, it can be minutes or even hours before the code is fully up to speed. On the other hand, the Dalvik JIT reacts quickly, so that mere moments after you hit the “Start” button on your favorite game, you are already benefiting from the work of the JIT.

We are also very pleased with how little memory the JIT uses. The code for the JIT itself is well under 100k, and each process that the JIT runs in will typically only use another 100k or so of RAM. On the current generation of Android phones, device users won’t even notice this additional memory usage; on my own phone, I can still have literally dozens of applications warmed up in memory and ready to go.

The Dalvik team isn’t resting on its laurels, either. We are hoping to see the Dalvik JIT deployed on many devices in the coming months. Looking forward, the team has an endless list of ideas for making the VM and library code better, which we are diligently working on.

READ MORE - Dalvik JIT

Android SurfaceView, run in Thread with sleep()

Further works on the last exercise "Android SurfaceView", a call to sleep(500) is introduced in run() of the thread, such that the onDraw() will be called in half second.

In this exercise, there is a point on the screen. When user touch on screen, the point will run from the current position to the touched position, in speed of half the distance per second.

Android SurfaceView, run in Thread with sleep()

AndroidSurfaceViewUI.java
package com.exercise.AndroidSurfaceViewUI;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class AndroidSurfaceViewUI extends Activity {

private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);

private float initX, initY;
private float targetX, targetY;
private boolean drawing = true;

public class MySurfaceThread extends Thread {

private SurfaceHolder myThreadSurfaceHolder;
private MySurfaceView myThreadSurfaceView;
private boolean myThreadRun = false;

public MySurfaceThread(SurfaceHolder surfaceHolder, MySurfaceView surfaceView) {
myThreadSurfaceHolder = surfaceHolder;
myThreadSurfaceView = surfaceView;
}

public void setRunning(boolean b) {
myThreadRun = b;
}

@Override
public void run() {
// TODO Auto-generated method stub
//super.run();
while (myThreadRun) {
Canvas c = null;
try {
c = myThreadSurfaceHolder.lockCanvas(null);
synchronized (myThreadSurfaceHolder) {
myThreadSurfaceView.onDraw(c);
}

sleep(500);

} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
// do this in a finally so that if an exception is thrown
// during the above, we don't leave the Surface in an
// inconsistent state
if (c != null) {
myThreadSurfaceHolder.unlockCanvasAndPost(c);
}
}
}
}
}

public class MySurfaceView extends SurfaceView implements SurfaceHolder.Callback{

private MySurfaceThread thread;

@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
//super.onDraw(canvas);
if(drawing){
canvas.drawRGB(0, 0, 0);
canvas.drawCircle(initX, initY, 3, paint);
if ((initX==targetX) && (initY==targetY)){
drawing = false;
}
else{
initX = (initX + targetX)/2;
initY = (initY + targetY)/2;
}
}
}

@Override
public boolean onTouchEvent(MotionEvent event) {
// TODO Auto-generated method stub
//return super.onTouchEvent(event);
int action = event.getAction();

if (action==MotionEvent.ACTION_DOWN){
targetX = event.getX();
targetY = event.getY();
drawing = true;
}

return true;
}

public MySurfaceView(Context context) {
super(context);
// TODO Auto-generated constructor stub
init();
}

public MySurfaceView(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
init();
}

public MySurfaceView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
init();
}

private void init(){
getHolder().addCallback(this);
thread = new MySurfaceThread(getHolder(), this);

setFocusable(true); // make sure we get key events

paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(3);
paint.setColor(Color.WHITE);

initX = targetX = 0;
initY = targetY = 0;

}

@Override
public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2,
int arg3) {
// TODO Auto-generated method stub
}

@Override
public void surfaceCreated(SurfaceHolder holder) {
// TODO Auto-generated method stub
thread.setRunning(true);
thread.start();
}

@Override
public void surfaceDestroyed(SurfaceHolder holder) {
// TODO Auto-generated method stub
boolean retry = true;
thread.setRunning(false);
while (retry) {
try {
thread.join();
retry = false;
} catch (InterruptedException e) {
}
}
}
}

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.main);

MySurfaceView mySurfaceView = new MySurfaceView(this);
setContentView(mySurfaceView);
}
}



Download the file.
READ MORE - Android SurfaceView, run in Thread with sleep()

Monday, May 24, 2010

Pixel Zombies Live Wallpaper released!

My newest Android project, Pixel Zombies Live Wallpaper, has been released to the Android Market!  It is a live wallpaper with a living population that is under attack by a zombie infection.  Watch the horror of the zombie infection on your phone! It is available in the Android Market for all Android 2.1 devices and higher at a cost of $0.99. 

See this page for more information on Pixel Zombies, including screenshots, and click the icon below to buy the app from the Android Market!

pixel zombies

READ MORE - Pixel Zombies Live Wallpaper released!

Sunday, May 23, 2010

Mercedes Cls Wallpaper 2011

http://1.bp.blogspot.com/-y2SYXfYek4c/TZP5QMDXfuI/AAAAAAAAAN8/s5389kABMac/s1600/Brabus-Mercedes-Benz-CLS-Coupe-2011-widescreen-02.jpg
mercedes benz cls coupe 2011 world debut at the geneva motor show 2011 ...




http://3.bp.blogspot.com/_viCh1SFyGrA/TO1ujP1hXHI/AAAAAAAAAJQ/cysuXfmd6Oo/s1600/2011-Mercedes-Benz-CLS-63-AMG-Front-And-Side-Speed-2-1920x1440.jpg
Cars Hd Wallpapers: 2011 Mercedes-Benz CLS 63 AMG


http://3.bp.blogspot.com/_FoXyvaPSnVk/THL6OqZAKkI/AAAAAAADOIE/o_a9on-mpuU/s1600/2011-Mercedes-Benz-CLS-49.JPG
2011 Mercedes-Benz CLS || Car Specifications ; Car Prices ; Car ...


turnmyfuckingswagon.xobius.com


http://2.bp.blogspot.com/-QNypHxVMBmU/TZP5QfZf2rI/AAAAAAAAAOE/ioG_VESkqrY/s1600/Brabus-Mercedes-Benz-CLS-Coupe-2011-widescreen-09.jpg
Car Pictures and Car Wallpapers: Brabus Mercedes-Benz CLS Coupe 2011


http://1.bp.blogspot.com/_FoXyvaPSnVk/THL6NQv7dsI/AAAAAAADOHk/H7HYKITvZGM/s1600/2011-Mercedes-Benz-CLS-45.JPG
2011 mercedes benz cls 2011 mercedes benz cls the second generation ...


http://4.bp.blogspot.com/-cuXRC4Pi-ds/TjYZf7kkfDI/AAAAAAAADtM/6oAmSpEdrF8/s1600/mercedes+cls+wallpapers+1.jpg
mercedes+cls+wallpapers+1.jpg


http://2.bp.blogspot.com/_3V1YR3u6VBg/THQeb5ttfsI/AAAAAAAAFNs/RUxJZf0Sy9M/s1600/Mercedes-Benz-CLS-Class_2012_1280x960_wallpaper_01.jpg
poze noul mercedes cls poze mercedes cls 2011


http://2.bp.blogspot.com/-0G0FEsKYblw/TjYZjW2wLdI/AAAAAAAADtY/S5F7sj8YJcI/s1600/mercedes+cls+wallpapers+4.jpg
mercedes+cls+wallpapers+4.jpg


http://3.bp.blogspot.com/_viCh1SFyGrA/TO1up5ZZPrI/AAAAAAAAAJU/Ftjm90C4DBs/s1600/2011-Mercedes-Benz-CLS-63-AMG-Dashboard-5-1920x1440.jpg
Quantum leap: fuel consumption reduced by 32 percent


http://3.bp.blogspot.com/_3V1YR3u6VBg/THQedWKJNyI/AAAAAAAAFNw/S1ms1f1riTY/s1600/Mercedes-Benz-CLS-Class_2012_1280x960_wallpaper_0b.jpg
poze noul mercedes cls poze mercedes cls 2011


http://2.bp.blogspot.com/-MYrCytsJL84/TjYZksYj1II/AAAAAAAADtc/Fv2OEoQ1ZDU/s1600/mercedes+cls+wallpapers+5.jpg
mercedes+cls+wallpapers+5.jpg


http://3.bp.blogspot.com/_FoXyvaPSnVk/THL6LmVo7mI/AAAAAAADOG8/dsy1hBp66AE/s1600/2011-Mercedes-Benz-CLS-40.JPG
2011 Mercedes-Benz CLS CAR DESIGNS


http://1.bp.blogspot.com/-if5iufpKDfU/TbHbmvUf59I/AAAAAAAAOeQ/44MixfKv78Q/s1600/Mercedes-Benz-CLS550_2012_1280x960_wallpaper_04.jpg
Mercedes-Benz - Populaire français d'automobiles: 2012 Mercedes-Benz ...


http://2.bp.blogspot.com/_3V1YR3u6VBg/THQeeIiclyI/AAAAAAAAFN0/ZA1n61B2yqc/s1600/Mercedes-Benz-CLS-Class_2012_1280x960_wallpaper_02.jpg
Just my Desktop: Imagini Noul Mercedes CLS 2011


http://2.bp.blogspot.com/-qPz-jH3J-LI/TZP5QnCmPwI/AAAAAAAAAOM/lPyxUMqqh-s/s1600/Brabus-Mercedes-Benz-CLS-Coupe-2011-widescreen-12.jpg
brabus mercedes cls coupe 2011 will make a world debut at the geneva ...


http://2.bp.blogspot.com/_FoXyvaPSnVk/THL5yxMednI/AAAAAAADOB8/l6C-lYFBByA/s1600/2011-Mercedes-Benz-CLS-22.JPG
Amena's blog: dc monster energy wallpaper hd


http://3.bp.blogspot.com/-liPq0XKaCAE/Tb6mGm-2RuI/AAAAAAAAAcw/HIKnLJKh-SU/s1600/Mercedes-Benz-CLS-Class_2012_1600x1200_wallpaper_05.jpg
Wallpaper de coche Mercedes Benz CLS Class del 2012_1600x1200 ...


http://4.bp.blogspot.com/-GXZW0DksqJw/TWiZkujzJ1I/AAAAAAACLH8/gqEkHHzwrjE/s1600/Mercedes-Benz-CLS63_AMG_US_Version_2012_1280x960_wallpaper_03.jpg
2012 Mercedes-Benz CLS63 AMG US Version | Mercedes-Benz Autos Spain


http://4.bp.blogspot.com/_FoXyvaPSnVk/S8ztBw_emoI/AAAAAAACwLo/BsouNnxRwhk/s1600/Mercedes-Benz-CLS-Shooting-Break-20.jpg
AUTO CARS NEW 2011: Mercedes Benz CLS Shooting Brake Concept Wallpaper


http://1.bp.blogspot.com/_viCh1SFyGrA/TO1uxaB5rsI/AAAAAAAAAJY/h7J_mStN2e4/s1600/2011-Mercedes-Benz-CLS-63-AMG-Dashboard-2-1920x1440.jpg
AMG ceramic high-performance composite braking system available as an ...


http://2.bp.blogspot.com/-2O0h9UXBCqM/TsZv-w_zj1I/AAAAAAAABTw/g9LHHEj5yQU/s1600/mercedes-benz+cls+%25282%2529.jpg
Wallpapers and Pics: mercedes-benz cls


http://2.bp.blogspot.com/-nl1T6abjrIA/TduMN9-RsAI/AAAAAAAAApM/i5T24FLQjtc/s1600/2007+Brabus+Mercedes-Benz+CLS+B63+S.jpg
Car Photo Wallpaper: 2007 Brabus Mercedes-Benz CLS B63 S


http://2.bp.blogspot.com/-uPY6IVA5s3E/TsZv_wYn9gI/AAAAAAAABT0/MgrH5YrO2Jc/s1600/mercedes-benz+cls+%25283%2529.jpg
Wallpapers and Pics: mercedes-benz cls


http://4.bp.blogspot.com/_viCh1SFyGrA/TO1vQeSZE9I/AAAAAAAAAJs/b7oRJbkt5Ek/s1600/2011-Mercedes-Benz-CLS-63-AMG-Rear-And-Side-Speed-Top-1920x1440.jpg
Autonomously developed AMG RIDE CONTROL sports suspension


http://1.bp.blogspot.com/-KsvKGjRd3Qw/TVYmJ9eBQlI/AAAAAAAAACc/pe-MZPWrDLk/s1600/Mercedes-Benz-CLS63_AMG_2012_1280x960_wallpaper_04.jpg
Vegastar Magazine: New Mercedes CLS 63 AMG


http://4.bp.blogspot.com/_viCh1SFyGrA/TO1vCqwuGCI/AAAAAAAAAJk/WfKrffvG3tg/s1600/2011-Mercedes-Benz-CLS-63-AMG-Gauges-1920x1440.jpg
Intelligent lightweight construction: making a significant ...


http://1.bp.blogspot.com/-evfsC06xsNs/UCV6VJmhJlI/AAAAAAAAASE/s93k7J3D13w/s1600/mercedes-benz-cls-55amg.jpg
all-mercedes-cars.blog...The CLS marked Mercedes-Benz's


http://2.bp.blogspot.com/-Jer7rZXu75I/TsZwCIUlq7I/AAAAAAAABUI/X3dlSPaTvNU/s1600/mercedes-benz+cls+%25281%2529.jpg
Wallpaper mercedes, mercedes-benz cls-class, mercedes-benz cls 63 amg ...


http://1.bp.blogspot.com/-Nk02-gO5pvA/TWKESLcJXHI/AAAAAAAAGcY/EpuK6JCPU2I/s1600/CLS63_Wallpaper10_1024x768.jpg
Mercedes-Benz CLS 63 AMG | Stephanos Demetriou Stephanou Neto


http://1.bp.blogspot.com/-zqfI8CXftck/TbHVQowLu6I/AAAAAAACNcU/jk59M5iZAPc/s1600/Mercedes-Benz-CLS550_2012_1280x960_wallpaper_09.jpg
2012 Mercedes-Benz CLS550 | Mercedes-Benz Autos Spain


http://1.bp.blogspot.com/_FoXyvaPSnVk/THCF-uiUlUI/AAAAAAADNu8/yJ3HHJfhoO8/s1600/big_mercedes_cls_2011_scoop_02.JPG
New Mercedes Cls 2011 Price #2


http://3.bp.blogspot.com/-1CTWwPaR9-Y/Tp4Z9q38LFI/AAAAAAAACmk/Pu4Pk_I6AAE/s1600/2012-Mercedes-Benz-CLS350-CDI-car-desktop-wallpaper-4.jpg
2012 MERCEDES CLS350 CDI Car Desktop Wallpapers


http://2.bp.blogspot.com/-rXISF7OtiJU/TsiQ55dSjmI/AAAAAAAABYY/GVDEl0bCyn0/s1600/Mercedes-Benz-cls+63+Amg+US+Version3.jpg
Wallpapers and Pics: Mercedes-Benz-cls 63 Amg US Version


http://1.bp.blogspot.com/-qO9wi7sSYdc/TsiQ_eYG7OI/AAAAAAAABYg/YCrdmt8MBpQ/s1600/Mercedes-Benz-cls+63+Amg+US+Version1.jpg
... Version,mercedes,mercedes amg,mercrdes cls,mercedes benz,mercedes 2011


http://3.bp.blogspot.com/_viCh1SFyGrA/TO1u9HRuq5I/AAAAAAAAAJg/CbZY9sX5uzg/s1600/2011-Mercedes-Benz-CLS-63-AMG-Interior-1920x1440.jpg
AMG Performance package with enhanced performance ex works


http://4.bp.blogspot.com/_lsyt_wQ2awY/TDOFdexB13I/AAAAAAAB6rw/ptOrdN5Vf_g/s1600/Mercedes-Benz-CL-Class_2011_1280x960_wallpaper_08.jpg
HQ Mercedes-Benz Auto Car : 2011 Mercedes-Benz CL-Class


http://3.bp.blogspot.com/_viCh1SFyGrA/TO1x38_9pgI/AAAAAAAAAJw/TpsL5hg9xeg/s1600/2011-Mercedes-Benz-CLS-63-AMG-Studio-Front-1920x1440.jpg
Cars Hd Wallpapers: 2011 Mercedes-Benz CLS 63 AMG


http://3.bp.blogspot.com/_viCh1SFyGrA/TO1vKae4NiI/AAAAAAAAAJo/3GsQ2UOiWcU/s1600/2011-Mercedes-Benz-CLS-63-AMG-Front-Angle-Speed-3-1920x1440.jpg
an increase in the peak output of 24 kW (32 hp) and in the maximum ...


http://4.bp.blogspot.com/_0vQee8oZXq8/TNyrALu3zrI/AAAAAAAAWH8/yGUVadNWgUg/s1600/Mercedes+Benz+CLS+1.jpg
Mercedes Benz: Mercedes Benz CLS AMG para 2011


http://3.bp.blogspot.com/_vPMjJG-enrk/TE0bAidxg3I/AAAAAAAADZw/Wl3dfz6mIOM/s1600/Mercedes-Benz-CL63_AMG_2011_1280x960_wallpaper_07.jpg
Mercedes-Benz-Auto twenty-first century: 2011 Mercedes-Benz CL63 AMG


http://24.media.tumblr.com/620d51078148782e88bbe70a4e6edd2e/tumblr_mhis57cqfM1qbfaazo1_1280.jpg
Merlin Season 4 Episode 12 Spoilers


http://24.media.tumblr.com/tumblr_m9ucabTbYI1rovfcgo1_1280.jpg
Fotos de Ingmar Bergman / Imagenes de Ingmar Bergman - Galeria de ...


READ MORE - Mercedes Cls Wallpaper 2011
Related Posts Plugin for WordPress, Blogger...