Tuesday, June 29, 2010

Germany thrash England 4-1 in controversy-filled World Cup

Germany thrash England 4-1 in controversy-filled World Cup




Media_http2bpblogspot_rkkis

LIVE COMMENTARY

















































































































































































































































































































































90'
The second half is over. The match ends 4 - 1.
90'
Germany's Bastian Schweinsteiger is whistled for offside at Free State Stadium.
90'
Jorge Luis Larrionda will wait an extra 2 minutes before blowing the whistle to end the second half.
89'
In Bloemfontein, Gareth Barry in England is presented with a shooting opportunity. But the strike is blocked by the covering defence.
89'
At Free State Stadium Steven Gerrard (England) takes a corner from the right.
89'
England's Wayne Rooney is on target but unsuccessful.
89'
Frank Lampard in England fires in a shot on goal in Bloemfontein. Without success, however.
88'
At Free State Stadium Wayne Rooney (England) lifts in a corner from the right.
87'
Germany's Sami Khedira has run offside.
87'
Fabio Capello is making the team's third substitution at Free State Stadium with Shaun Wright-Phillips replacing Glen Johnson.
83'
Stefan Kiessling is replacing Mesut Özil in Germany at Free State Stadium.
82'

Media_httpwwwlivegoal_mhftb

Glen Johnson in England has been booked for unsporting behavior and is shown a yellow card by Jorge Luis Larrionda.
81'
Steven Gerrard in England smashes in a shot on target. The keeper saves, though.
80'
Germany are coming forward and Mario Gomez gets in a strike. Which is off target, however.
79'
Lukas Podolski (Germany) goes for goal but the shot is blocked by an alert defence.
72'
Joachim Low is making the team's second substitution at Free State Stadium with Mario Gomez replacing Miroslav Klose.
72'
Piotr Trochowski is on as sub for Thomas Muller in Germany.
71'
Fabio Capello (England) is making a second substitution, with Emile Heskey replacing Jermain Defoe.
70'
At Free State Stadium Steven Gerrard (England) takes a corner from the left. But the chance is unproductive.
70'

Media_httpwwwlivegoal_mxgls

Goal! Thomas Muller extends Germany's lead to 4 - 1 at Free State Stadium.
70'

Media_httpwwwlivegoal_mxgls

Mesut Özil assisted.
69'
Steven Gerrard in England gets in a strike at Free State Stadium but the shot is cleared by Germany
69'
Germany are pushing forward but Thomas Muller's finish is wide of the post.
67'
Frank Lampard (England) is given an opening but the shot is blocked by a defender.
67'
Germany move up to a comfortable 3 - 1 lead thanks to Thomas Muller.
67'

Media_httpwwwlivegoal_mxgls

Bastian Schweinsteiger assisted the goal.
64'
England make their first substitution with Joe Cole replacing James Milner.
64'
Jerome Boateng of Germany gets in a strike, but is off target.
63'
Germany's Bastian Schweinsteiger breaks free at Free State Stadium. But the strike goes wide of the post.
62'
James Milner in England fires in a strike at Free State Stadium but the ball is blocked by an alert defence.
60'
Germany's Thomas Muller misses with an attempt on goal.
58'
Steven Gerrard (England) with an attempt in Bloemfontein. The shot goes wide, though.
56'
Steven Gerrard in England drives towards goal at Free State Stadium. But the finish is unsuccessful.
55'
Jorge Luis Larrionda has awarded Germany a corner. Mesut Özil takes the kick from the right corner flag.
53'
In Bloemfontein Germany's Miroslav Klose is caught offside.
52'
Frank Lampard (England) gets in a shot at Free State Stadium – but hits the bar! Ohhhh so close.
49'
England's Steven Gerrard breaks free at Free State Stadium. But the strike goes wide of the post.
48'
James Milner of England gets in a strike, but is off target.
47'

Media_httpwwwlivegoal_mhftb

Arne Friedrich (Germany) has been given a first yellow card.
46'
Jorge Luis Larrionda has blown to start the second half.
45'
The 1st half has ended.
40'
England are coming forward and Steven Gerrard gets in a strike. Which is off target, however.
39'
In Bloemfontein Germany attack through Lukas Podolski. The finish is off target, however.
38'
England apply pressure and a brilliant scoring opportunity is created for Frank Lampard. But the ball crashes against the crossbar!
37'
Jorge Luis Larrionda has awarded Germany a corner. Mesut Özil takes the kick from the right corner flag.
37'

Media_httpwwwlivegoal_mxgls

Matthew Upson (England) strikes with a header to reduce the score to 1 - 2 at Free State Stadium.
37'

Media_httpwwwlivegoal_mxgls

Steven Gerrard assisted.
36'
Germany's Miroslav Klose gets in a shot on goal at Free State Stadium. But the effort is unsuccessful.
35'
England push forward through Frank Lampard, whose finish on goal is saved.
32'

Media_httpwwwlivegoal_mxgls

Thomas Muller fed the ball.
32'
Goal! Germany extend their lead to 2 - 0 through Lukas Podolski.
32'
Jermain Defoe in England is pulled up for offside.
31'
Germany drive forward and Miroslav Klose gets in a shot. Without netting, however.
26'
England's Gareth Barry is on target but unsuccessful.
24'
England are pushing forward but Wayne Rooney's finish is wide of the post.
20'

Media_httpwwwlivegoal_mxgls

Manuel Neuer set up the goal.
20'

Media_httpwwwlivegoal_mxgls

Germany take a 1 - 0 lead at Free State Stadium. The scorer: Miroslav Klose!
19'
Frank Lampard (England) gets in a strike but the shot is blocked by a defender.
17'
Sami Khedira in Germany gets in a strike at Free State Stadium but fails to hit the target.
11'
Germany push forward at Free State Stadium and Lukas Podolski gets in a strike. This is blocked, however, by a determined England defence.
6'
Germany drive forward but Mesut Özil is judged offside.
5'
In Bloemfontein Bastian Schweinsteiger in Germany takes a corner from the left-hand flag.
5'
In Bloemfontein Germany drive forward through Mesut Özil. His shot is on target but it's no goal.
4'
Jorge Luis Larrionda blows England's Wayne Rooney for offside.
1'
The first half is just kicking off.
0'
Joachim Low and Fabio Capello have now revealed their starting line-ups.


40510 spectators are following this match.

Thursday, June 24, 2010

Exercising Our Remote Application Removal Feature

[This post is by Rich Cannings, Android Security Lead. — Tim Bray]

Every now and then, we remove applications from Android Market due to violations of our Android Market Developer Distribution Agreement or Content Policy. In cases where users may have installed a malicious application that poses a threat, we’ve also developed technologies and processes to remotely remove an installed application from devices. If an application is removed in this way, users will receive a notification on their phone.

Recently, we became aware of two free applications built by a security researcher for research purposes. These applications intentionally misrepresented their purpose in order to encourage user downloads, but they were not designed to be used maliciously, and did not have permission to access private data — or system resources beyond permission.INTERNET. As the applications were practically useless, most users uninstalled the applications shortly after downloading them.

After the researcher voluntarily removed these applications from Android Market, we decided, per the Android Market Terms of Service, to exercise our remote application removal feature on the remaining installed copies to complete the cleanup.

The remote application removal feature is one of many security controls Android possesses to help protect users from malicious applications. In case of an emergency, a dangerous application could be removed from active circulation in a rapid and scalable manner to prevent further exposure to users. While we hope to not have to use it, we know that we have the capability to take swift action on behalf of users’ safety when needed.

This remote removal functionality — along with Android’s unique Application Sandbox and Permissions model, Over-The-Air update system, centralized Market, developer registrations, user-submitted ratings, and application flagging — provides a powerful security advantage to help protect Android users in our open environment.

Wednesday, June 23, 2010

Android Market Problem

Earlier today we had a brief outage in Android Market. For a period of about thirty minutes, some users were unable to find any apps. The problem was detected and corrected, and we believe the user experience is now back to normal. We apologize for the outage.

Lawan Australia, Serbia Buru Sejarah

Tim nasional Serbia menargetkan kemenangan besar melawan Australia guna mengukir sejarah lolos ke babak 16 besar Piala Dunia untuk pertama kalinya. Pelatih Serbia Radomir Antic yakin, timnya dapat merealisasikan target tersebut.

Sejak memisahkan diri dari Yugoslavia, Serbia belum pernah lolos ke babak perdelapan final. Pada Piala Dunia 2006, Dejan Stankovic dan kawan-kawan gugur di babak penyisihan grup.

Kini, Serbia memiliki peluang untuk lolos. "Beli Orlovi" sementara ini berada di posisi tiga dengan perolehan tiga poin. Hasil seri sebenarnya sudah cukup untuk lolos, jika dalam partai lain Ghana sukses menekuk Jerman. Namun, alangkah lebih baiknya jika Serbia menang telak guna mengalahkan selisih gol Jerman, sekaligus memastikan tiket ke perdelapan final.

"Kami tahu, kami memiliki kesempatan untuk mengukir sejarah saat melawan Australia dan kami akan berusaha sebaik mungkin. Saya tidak akan menaruh tekanan kepada para pemain untuk mengatakan bahwa mereka harus menang. Tapi ketika saya bilang bahwa saya percaya kepada tim saya, saya berkata jujur. Saya tak hanya asal bicara," kata Antic.

"Saya optimisitis karena saya tahu bagaimana performa pemain saya saat latihan. Ini adalah sesi latihan terbaik kami dari sebelum-sebelumnya. Ini menunjukkan semangat mereka dan sekarang kami memiliki kesempatan untuk menunjukkan semangat ini," lanjut mantan pelatih Barcelona tersebut.

The Froyo Code Drop


Media_http4bpblogspot_gddkd

[This post is by Jean-Baptiste Queru, who moves truck-loads of source code in and out of the Googleplex. — Tim Bray]

Today is one of those days that has my heart racing; we’ve just released the source code for Android 2.2. This is a big step forward for the entire Android ecosystem. Please don’t melt the servers down again while trying to download that latest source code.

This blog typically talks about developing Android applications using the SDK and NDK. However, the skills of a platform contributor aren’t fundamentally different from those of an application developer. Those are simply different roles using the same skill set. I’m providing an update here to the experienced Android programmers all around the world on some of the recent developments in the Android Open-Source Project.

For Google engineers working on Android, releases are mostly known by their code names which are chosen alphabetically after tasty treats. I’ll call Android 2.2 “Froyo” throughout this post, since that was its code name. Raw version numbers don’t make me salivate as much as the thought of a cold dessert in the California summer.

Let’s have a look at some cool aspects of the new Froyo source, and let’s then take a few steps back to look at other noteworthy aspects of the Android Open-Source Project.

I had been increasingly involved in all previous open-source releases of Android, from testing the initial code drop to doing all the open-source-related git-level work in Eclair. Following that path, Froyo is the first release where my primary focus has been the Android Open-Source Project from start to finish. I thank the entire Android team for helping me all along with much of that work. Here are some aspects of Froyo that I am proud of, and that kept me busy for the last few months:


  • Hundreds of platform changes that people everywhere uploaded to the Android Open-Source Project were accepted and merged into Froyo. That process is now a well-oiled machine and will translate well to future contributions.


  • The open-source release happened in a single step. The whole source tree for the entire Android 2.2 platform is now available, with its full change history. That will accelerate everyone’s migration to Froyo from older releases. It is also already fully merged into the open-source master tree. Consequently, we can immediately review and accept platform contributions based on Froyo. That will therefore reduce the risk of merge conflicts between contributions to the open-source tree and changes in Google’s internal master tree where those contributions are meant to end up.


  • In order to make it easier for device manufacturers and custom system builders to use Froyo, we’ve restructured our source tree to better separate closed-source modules from open-source ones. We’ve made many changes to the open-source code itself to remove unintentional dependencies on closed-source software. We’ve also incorporated into the core platform all the configuration files necessary to build the source code of Android Open-Source Project on its own. You can now build and boot a fully open-source system image out of the box, for the emulator, as well as for Dream (ADP1), Sapphire (ADP2), and Passion (Nexus One).


  • Speaking of device support, we also open-sourced several additional hardware-related libraries that had been closed-source in previous releases, which will open the door to more contributions. Some examples are the recovery UI code for Dream, Sapphire and Passion, and the interface between the media framework and Qualcomm chipsets.


Besides the Froyo source code release, I wanted to mention several other improvements in the Android Open-Source Project:


  • We’ve been receiving contributions from more than twenty different companies, and many individuals. We have close to 4,000 registered users on the Gerrit code review server, with an average of 2 contributions per user. Those contributions have been in all areas of the system, from the depth of the C library all the way to the UI of the lock screen. They’ve covered the full range of complexities, from fixing typos in the documentation or reformatting code to adding developer-visible APIs or user-visible features. I want to thank everyone who got involved for their work and patience.


  • We’re now responding to platform contributions faster, with most changes currently getting looked at within a few business days of being uploaded, and few changes staying inactive for more than a few weeks at a time. We’re trying to review early and review often. As I’m typing this, only about a dozen platform contributions haven’t been looked at yet, with the oldest of those being 3 days old. More than 90% of contributions to the platform code itself have been actively looked at during the last 2 weeks. I hope that the speedy process will lead to more interactivity during the code reviews. I realize nevertheless that time differences around the world can make real-time communication a challenge.


  • Over the last 2 months, we’ve reached a final decision on more than 1,000 changes that were uploaded to our public Gerrit server. That means that those changes were either accepted or rejected after being reviewed. The high quality of the contributions we’ve been receiving throughout the history of the Android Open-Source Project has allowed us to steadily merge about 80% of them into the main repository, from where they migrate to official releases. That means that an average of 20 changes have been accepted through the Android Open-Source Project into the public git repositories every business day over those last 2 months.


  • We recently created two new official Google Groups related to the Android Open-Source Project. Android-building is meant to specifically discuss build issues (be sure to search the archives thoroughly before posting). Android-contrib is used to discuss actual contributions (don’t post if you don’t really intend to contribute and follow through on the review process, and if you haven’t already spent an hour or two researching things on your own).


  • We’re developing the developer tools directly in the open-source project, with no work in those areas happening behind closed doors. This covers the Eclipse plug-in and the emulator, and more than a dozen other SDK-related tools.


  • Once a platform version is open-sourced, all improvements to the Compatibility Test Suite related to that version are made directly to the open-source tree. In fact, release 2 of the 2.1 CTS was done 100% that way, with the development, testing and release process all happening straight in the open-source tree. This is now true for Froyo as well, and we are now accepting contributions into the Froyo branch of the CTS project.


I believe that those last two aspects are important to application developers. If you’re an application developer and you’d like to improve the tools that you and your fellow developers use, the process to make changes in that area is now a lot more transparent. Similarly, if during application development you find incompatibilities between devices and believe that those incompatibilities aren’t within the letter or the spirit of Android compatibility, you can help improve the situation by contributing a CTS test for that area.

With Android 2.2 now being available to the open-source world, and with the review process working smoothly, I’m looking forward to seeing a lot more high-quality contributions that will be used to build future versions of Android. My sweetest dream, which is also my worst nightmare, is to have so many contributions that I can’t keep up with them. Please don’t wake me up.

Tuesday, June 22, 2010

Hands-on at OSCON

This year at OSCON we and O’Reilly are co-presenting Android Hands-on. The event is on the evening of Wednesday, July 21 after the Expo-hall reception. Led by Google Android experts, the Hands-on will run from 7:00 pm-10:00 pm, and will be intense, technical, and structured. The goal is that you leave the room with foundation skills for writing interesting code for an open-source stack that runs on a pocket-sized Internet-connected device.

Some specific topics we’ll cover:


  • Porting existing C codebases to Android


  • Integrating Android apps with RESTful web interfaces


  • UI patterns and best practices


Sign-up in advance is required, and is restricted to registered full conference attendees and speakers. Spaces are limited and will be given out on a first-come-first-served basis.

If you’re considering participating, you might want to keep these things in mind:


  • Android apps are written in the Java programming language, with the exception of some performance-critical code (typically for games) written in C and C++. If you aren’t familiar with at least one of these languages, you won’t benefit much from the session.


  • To prepare, you might want to go to developer.android.com and download the SDK (available for Linux, Mac, and even Windows). Try building the HelloAndroid app and running it on the emulator.


  • You might also benefit from attending the Android for Java developers tutorial on Monday and/or Dan Morrill’s Android: The Whats and Wherefores session on Wednesday morning.


Monday, June 21, 2010

Tim Tango Pantau Sepak Terjang Meksiko

Prediksi Meksiko vs Uruguay Pelatih Afrika Selatan Carlos Alberto Parreira menjagokan Brasil akan menjadi juara. Ia menilai, Kaka dan kawan-kawan belum sepenuhnya menginjak pedal gas dengan penuh.

"Perjalanan Brasil sangat menjanjikan. Harus diingat Brasil belum sepenuhnya menggunakan pengalaman yang mereka miliki. Mereka belum meletakan kaki sepenuhnya di pedal," jelasnya, Senin (21/6).

Meksiko vs Uruguay Brasil saat ini memang menjadi tim yang paling difavoritkan. Tim asuhan Carlos Dunga ini sudah merebut tiket ke babak 16 besar setelah memainkan dua laga di Grup G.

"Ini merupakan tim Brasil yang memiliki banyak kualitas. Mereka juga begitu nyaman dengan permainan yang mereka tampilkan," ungkap pelatih asal Brasil berusia 67 tahun tersebut.

Lebih jauh, Parreira menyatakan dukungannya kepada pelatih Inggris Fabio Capello yang terancam dipecat. Ancaman ini muncul setelah Inggris tampil buruk di dua laga yang sudah dimainkan dan hanya mampu meraih hasil imbang.

"Banyak pemain yang berkiprah di Eropa mengatakan pelatih mengumumkan siapa yang akan bermain kadang di kamar ganti," jelasnya setelah taktik Capello yang mengumumkan susunan pemainnya satu jam sebelum pertandingan dimulai dinilai media massa di Inggri sebagai penyebab buruknya penampilan Wayne Rooney dan kawan-kawan ketika melawan Amerika Serikat dan Aljazir.

"Tidak ada yang membicarakan soal itu saat Inggris memenangi seluruh pertandingan babak kualifikasi, kami tidak pernah mendengar itu. Hal ini dimasalahkan karena hasil imbang di dua laga yang sudah dimainkan," imbuhnya. (Rtr/OL-04)

Future-Proofing Your App


Media_http1bpblogspot_giyjg

[This post is by Reto Meier AKA @retomeier, who wrote the book on Android App development. — Tim Bray]

As a developer, I’m excited by Android’s potential as a single development platform that can make my apps available on a wide range of devices. From smartphones to televisions, Android is now being used on an increasingly diverse collection of hardware.

Last year’s Android SDK 1.6 release was the first to introduce support for variations in device hardware, paving the way for devices like the HTC Tattoo — a small screen device with a non-autofocus camera. Future devices, like Google TV, may not include some of the hardware features that we now expect, such a accelerometers and telephony.

We all want our apps available on as many devices as possible, but on some hardware they might just not make sense, so it’s important that apps are available only on the devices where they do.

Android Market Rule #1: Don't let existing applications break on new devices

As curators of the Android Market, one of our most important responsibilities is ensuring consumers and developers can trust the Market to only deliver applications to devices capable of running them.

The Android SDK includes built-in support for specifying which hardware features your application needs, ensuring that when we see more hardware variations, the Market will make sure your apps are available everywhere (and only where) they make sense.

Specify the hardware your app needs using the application Manifest

That includes the target and minimum SDK versions, supported screen sizes, and the required hardware features without which your app will “break”. You can specify the hardware features your app requires by adding a uses-feature node to your manifest.


<uses-feature android:name="android.hardware.microphone" />


By updating your manifest now to include all the hardware features you require, you effectively opt out of future hardware that won’t be capable of properly supporting your app.

Android Market Rule #2: Don't let existing applications break on new devices

In extreme cases — such as the introduction of small screen sizes in Android 1.6 — developers will be required to explicitly opt in their apps before they will be made visible in the Market on these new devices.

In other cases the Android Market will analyze the permissions requested by an app to determine if it implies a dependence on any particular hardware. For example, requiring the CALL_PHONE permission strongly implies the need for telephony hardware.

Until we provide a more convenient tool, you can use AAPT in the SDK to analyze your apps (2.2 SDK required) and see which device requirements are being implicitly added to your application:


aapt dump badging myApp.apk


Where your app uses a particular hardware feature, but you know (and have tested) that it will still work without it, you can specify it as optional by setting the required attribute to false.


<uses-feature android:name="android.hardware.telephony" android:required="false" />


Ensure your application manifest correctly identifies what hardware your app needs, and what is optional

With the uses-feature name strings now available, you can ensure right now that your app appears in the Market, where appropriate, on current and future hardware devices rather than waiting for the devices to be released.

It's in your interest as a developer to ensure your apps work well, and are available, on as many devices as possible and appropriate. Now is the time to test your applications and update your Manifest to opt in to all hardware configurations which you support, and opt out of those that don’t make sense.

Sunday, June 20, 2010

Brasil Berjaya "Tanpa Kaka"

Prediksi Brazil vs Pantai Gading Tawa riang dan tangisan berurai air mata mewarnai partai ”grup neraka” di Stadion Ellis Park, Johannesburg, Selasa (15/6) atau Rabu dini hari WIB, yang dimenangi Brasil 2-1 (0-0) atas Korea Utara. Korea Utara, dengan striker Jong Tae Se berurai air mata saat berkumandang lagu kebangsaan negaranya sebelum laga, tidak memberikan kemenangan itu dengan mudah.

Brazil vs Pantai Gading Brasil baru mampu menjebol gawang Korea Utara (Korut) pada menit ke-55 lewat tendangan dari sudut sempit bek kanan Maicon saat suhu udara Johannesburg mendekati titik nol derajat. Gelandang kanan Elano, pengumpan gol pertama timnya, mencetak gol penentu kemenangan pada menit ke-72 setelah mendapat bola terobosan dari Robinho.

Menghadapi tim peringkat pertama dunia dan juara lima kali itu, Korut lebih banyak bertahan dan sesekali menggalang serangan berbahaya. Dua menit menjelang bubaran, gelandang kiri Ji Yun Nam mempertipis kekalahan Korut. ”Tidak mudah bermain lawan tim yang menutup tokonya seperti itu,” kata Dunga, Pelatih Brasil, yang terlihat lega dan beberapa kali tertawa lepas saat jumpa pers.

Tidak biasanya mantan kapten timnas Brasil tampak seceria itu. Biasanya, ia sering membawakan diri dengan muka serius, terlebih pada saat hubungan dengan wartawan Brasil kurang harmonis. Namun, kali itu ia terlihat seperti baru terlepas dari beban mengimpit. Senyumnya lebar saat mengawali keterangan persnya, setelah itu ia beberapa kali tertawa lepas.

”Saya puas, tetapi saya menginginkan lebih. Saya ingin kami bisa mencetak gol yang lebih banyak,” ujar Dunga. Ia puas bisa memetik kemenangan pada laga pertama. Namun, ia gagal mengikuti jejak pendahulunya, Luiz Felipe Scolari, yang bisa menang besar atas wakil Asia, Korea Selatan, 4-0 pada Piala Dunia 2002, dan Carlos Alberto Parreira yang bisa menyikat wakil Asia lainnya, Jepang, 4-1, pada Piala Dunia 2006.

Meski begitu, itu tetap kemenangan penting bagi tim ”Samba”. Mereka menempati pucuk klasemen Grup G dengan tiga poin, mengungguli Portugal dan Pantai Gading yang bermain imbang 0-0 di Port Elizabeth. Jika melihat penampilan di lapangan, laga itu peringatan bagi Dunga agar mengasah kreativitas serangan timnya.

Saturday, June 19, 2010

Cesar Bandingkan Ronaldo dan Drogba

Prediksi Belanda vs Jepang Julio Cesar akan menghadapi Cristiano Ronaldo dan Didier Drogba. Ia memasang kewaspadaan khusus pada dua penyerang top itu, juga memberi perbandingan di antara keduanya.

Belanda vs Jepang "Mereka pemain yang punya gaya sangat berbeda. Tak diragukan lagi, saya harus memberi perhatian khusus pada mereka berdua," demikian Cesar dilansir AP, Sabtu (19/6/2010).

Cesar dan Brasil-nya akan bertemu Drogba dan Pantai Gading-nya pada hari Minggu, dan lima hari kemudian berduel melawan Ronaldo dan pasukan Portugal. Mereka memang pesaing di Grup G, bersama Korea Utara.

"Ronaldo superior secara teknik, punya skil lebih banyak. Tendangan dia bagus, sundulannya juga," kiper Inter Milan itu menilai Ronaldo.

Adapun Drogba, kata Cesar, sangat berbahaya dalam posisi mencetak gol, dan dari situ jarang gagal. "Dia lebih sering beredar di kotak penalti dan tahu cara menyelesaikan setiap peluang."

Belum diketahui apakah Drogba akan menjadi starter saat melawan Brasil. Namun ia turun ke lapangan di menit 66 saat menghadapi Portugal, dengan pembalut khusus di tangannya. Itu berarti, starter atau tidak, ia bakal turun.

Cesar juga menyebut modal lain untuk meredam Drogba, yaitu pada sosok Lucio dan Maicon. Kedua rekannya itu pernah berhasil menjaga dan mengalahkan penyerang top itu bersama Inter Milan, saat mengalahkan Chelsea di liga Champions.

Thursday, June 17, 2010

Hasil Pertandingan Piala Dunia

Hasil Pertandingan Piala Dunia Kemarin malam jam 22 waktu Beijing, pertandingan penyisihan terakhir putaran pertama Piala Dunia digelar antara tim Spanyol, juara Eropa tahun 2008 dan tim Swiss. Di luar dugaan, tim Swis berhasil mengalahkan tim Spanyol dengan score 1:0 dan membuat kejutan terbesar sejak dimulainya Pertandingan Piala Dunia kali ini.

Hasil Pertandingan Piala Dunia 2010 Selain pertandingan antara Spanyol dan Swiss, pertandingan grup H diadakan antara tim Chile, tim favorit Amerika Selatan dan Tim Honduras dari Amerika Tengah dan Utara. Sebagai hasilnya, tim Chile menaklukkan Tim Honduras dengan score 1:0 dan ini merupakan kemenangan pertama kesebelasan Chili di luar negeri selama 60 tahun ini dalam Pertandingan Piala Dunia.

This is Why I'll Never be an Adult

I have repeatedly discovered that it is important for me not to surpass my capacity for responsibility.  Over the years, this capacity has grown, but the results of exceeding it have not changed.

Normally, my capacity is exceeded gradually, through the accumulation of simple, daily tasks.


Media_http1bpblogspot_jlvhh


But a few times a year, I spontaneously decide that I'm ready to be a real adult.  I don't know why I decide this; it always ends terribly for me.  But I do it anyway.  I sit myself down and tell myself how I'm going to start cleaning the house every day and paying my bills on time and replying to emails before my inbox reaches quadruple digits.  Schedules are drafted.  Day-planners are purchased.  I stock up on fancy food because I'm also planning on morphing into a master chef and actually cooking instead of just eating nachos for dinner every night.   I prepare for  my new life as an adult like some people prepare for the apocalypse.

The first day or two of my plans usually goes okay.


Media_http2bpblogspot_xavec


Media_http4bpblogspot_hrjcu


Media_http2bpblogspot_fedcn


Media_http1bpblogspot_lacfg


For a little while, I actually feel grown-up and responsible.  I strut around with my head held high, looking the other responsible people in the eye with that knowing glance that says "I understand.  I'm responsible now too.  Just look at my groceries."

At some point, I start feeling self-congratulatory.


Media_http4bpblogspot_gwkfr

This is a mistake.  

I begin to feel like I've accomplished my goals.  It's like I think that adulthood is something that can be earned like a trophy in one monumental burst of effort and then admired and coveted for the rest of one's life.  


Media_http3bpblogspot_rljuj


Media_http1bpblogspot_sbfbv

What usually ends up happening is that I completely wear myself out. Thinking that I've earned it, I give myself permission to slack off for a while and recover. Since I've exceeded my capacity for responsibility in such a dramatic fashion, I end up needing to take more recovery time than usual. This is when the guilt-spiral starts.  

The longer I procrastinate on returning phone calls and emails, the more guilty I feel about it.  The guilt I feel causes me to avoid the issue further, which only leads to more guilt and more procrastination.  It gets to the point where I don't email someone for fear of reminding them that they emailed me and thus giving them a reason to be disappointed in me.  

Then the guilt from my ignored responsibilities grows so large that merely carrying it around with me feels like a huge responsibility.  It takes up a sizable portion of my capacity, leaving me almost completely useless for anything other than consuming nachos and surfing the internet like an attention-deficient squirrel on PCP. 


Media_http2bpblogspot_cwfih

At some point in this endlessly spiraling disaster, I am forced to throw all of my energy into trying to be an adult again, just to dig myself out of the pit I've fallen into. The problem is that I enter this round of attempted adulthood already burnt out from the last round. I can't not fail.  


Media_http4bpblogspot_egysy


Media_http3bpblogspot_pzdfb


Media_http3bpblogspot_uhhoy


Media_http4bpblogspot_ppkjf

It always ends the same way.  Slumped and haggard, I contemplate the seemingly endless tasks ahead of me. 


Media_http2bpblogspot_nbalb

And then I rebel.  


Media_http1bpblogspot_qkazj


Media_http2bpblogspot_egbxj


Media_http1bpblogspot_ovyie


Media_http4bpblogspot_tenkv

Wednesday, June 16, 2010

Parreira: Afsel Belum Habis!

Klasemen Piala Dunia 2010 Kekalahan atas Uruguay memang mengikis kans Afrika Selatan lolos dari fase grup. Tapi jangan keliru, Afsel belum mau melepas harapan itu dan akan berusaha menang di laga terakhir.

Klasemen Piala Dunia Afsel menyerah 0-3 saat melawan Uruguay, Kamis (17/6/2010) dinihari WIB. Tertinggal 0-1 di babak pertama, gawang Afsel kembali bobol dua kali usai turun minum kendati secara umum permainan kedua tim relatif berimbang --Afsel bahkan unggul penguasaan bola 58%:42%.

"Hasil itu tak merefleksikan apa yang terjadi dalam pertandingan," sergah Pelatih Afsel Carlos Alberto Parreira di AFP.

"Tapi Uruguay adalah tim yang bagus dengan pemain bagus pula, seperti (Diego) Forlan. Pengalaman mereka muncul di saat menentukan," lanjut dia.

Sebagai akibat dari kekalahan itu Uruguay kini memuncaki klasemen Grup A dengan empat angka, di atas Prancis dan Meksiko. La Celeste adalah satu-satunya penghuni Grup ini yang sudah meraih kemenangan.

Sebaliknya Afsel terpuruk di posisi terbawah klasemen dengan satu poin hasil dari dua pertandingan. Bafana-bafana tinggal menyisakan satu laga lagi menghadapi favorit grup, Prancis.

"Harapan kami belum menguap. Kami harus mengalahkan Prancis, tapi kami mesti lebih agresif lagi," lugas Parreira.

Spanyol Kalah

Spanyol Kalah saat ini ketinggalan 0-1 melawan Swiss. Gol Swiss tercipta pada menit ke-52. Gol dibuat Galson Fernandes.

Gol tersebut tercipta di tengah dominansi Spanyol atas pertandingan ini. Gol bermula dari serangan Eren Derdiyok. Bola liar yang berasal dari adangan Iker Casillas tergadap Derdiyok mampu dimanfaatkan Gelson Fernandes menjadi gol.

Tuesday, June 15, 2010

Game Development for Android: A Quick Primer


Media_http1bpblogspot_mihcf

[This post is by Chris Pruett, an outward-facing Androider who focuses on the world of games. — Tim Bray]

If you attended Google I/O this year, you might have noticed the large number of game developers showing off their stuff in the Android part of the Developer Sandbox. Unity, EA, Com2Us, Polarbit, Laminar Research, and several others demonstrated high-end games running on Android devices. Part of my role as a Game Developer Advocate for Android is to field requests for information about Android from game developers, and in the last six months the number of requests has gone through the roof. Since there’s clearly a huge amount of interest in Android game development, here’s an overview of how Android games work and what you as a developer should know.

Step One: Decide on a Target Device Class

There are basically two types of devices running Android that you should consider: lower-end devices like the G1 (which I’ll call “first generation” devices), and high-end devices like the Nexus One (”second generation” devices). Though there are a lot of different Android phones on the market, they fall rather neatly into these two classes when it comes to CPU and graphics performance, which are the variables that game developers usually care the most about.


Media_http3bpblogspot_didgo

First generation devices are generally phones with HVGA screens, running Android 1.5 or 1.6 (though a few are starting to make their way to 2.1), typically with an 500mhz CPU and hardware accelerated OpenGL ES 1.0 backend. A large number of devices sport internals similar to the G1 (Qualcomm MSM7K CPU/GPU at ~500mhz), so the G1 is representative of this class (and can be safely considered the low end of the spectrum). Based on my tests, these devices can push about 5000 textured, colored, unlit vertices per frame and still maintain 30 frames per second. Using OpenGL ES to draw, I can get just over 250 animating sprites on the screen at 30 frames per second (at 60 fps I can draw just over 100 sprites per frame). These aren’t hard numbers; my benchmarks are fairly primitive, and I’m sure that they can be improved (for example, I haven’t done tests using the GL_OES_point_sprite extension, which the G1 supports). But they should give you an idea of what the first generation class of devices can do.

Second generation devices generally have WVGA screens, much faster CPUs and GPUs, and support for OpenGL ES 2.0. The Nexus One and Verizon Droid by Motorola are both good examples of this class. These devices seem to be about 5x faster than the first generation devices when it comes to raw OpenGL 1.0 performance (I can get at least 27,000 textured unlit colored vertices per frame at 30 frames per second on all of the second generation devices I’ve tested). Using OpenGL ES 2.0 can be even faster, as these devices typically incur some overhead translating OpenGL ES 1.0 commands to their 2.0-native graphics hardware. However, the large screens on these devices often mean that they are fill-bound: the cost of filling the screen with pixels is high enough that it’s often not possible to draw faster than 30 frames per second, regardless of scene complexity.

Since there is a pretty wide performance delta between the first generation class of devices and the second, you should be careful when selecting a target. Based on our metrics about Android versions, first generation devices represent over half of all of the Android phones on the market (as of this writing, anyway; 2.0 devices are growing very quickly). Those games that are able to scale between the first and second generation devices have the largest audience.

Step Two: Pick a Language

If you’re an Android app programmer who’s thinking about getting into game development, chances are you are planning on writing code in Java. If you’re a game development veteran who’s thinking of bringing games to Android, it’s likely that you prefer to do everything in C++.

The side-scrolling action game that I wrote, Replica Island, is entirely Java. It uses OpenGL ES 1.0 to draw and is backwards compatible to Android 1.5. It runs at a good frame rate (close to 60 fps on the G1) across almost all Android devices. In fact, many of the popular games on Android Market were written in Java, so if you’re the type of person who finds coding in C++ like speaking in tongues, you can rest easy in the knowledge that Java on Android is perfectly viable for games.

That said, native code is the way to go if your game needs to run as fast as possible. We’ve just released the fourth revision of our Native Development Kit for Android, and it includes a number of improvements that are particularly useful to game developers. Using the NDK, you can compile your code into a shared library, wrap it in a thin Java shell to manage input and lifecycle events, and do all of the heavy lifting in C++ with regular OpenGL ES APIs. As of Revision 4, you can also draw directly into Java Bitmap pixel buffers from native code, which should be faster than loading bitmaps as GL textures every frame for 2D games that want to do their own scene compositing. Revision 4 also (finally!) includes gdb support for debugging your native code on the device.

You should know that when using the NDK, you don’t have access to Android Framework APIs. There’s no way, for example, to play audio from C++ (though we announced at Google I/O our intention to support OpenSL ES in the future). Some developers use the AudioTrack API to share a direct buffer with native code that mixes and generates a PCM stream on the fly, and many call from C++ into the Java SoundPool interface. Just be aware that for this type of work, a jump through JNI back into Java code is required.

Step Three: Carefully Design the Best Game Ever

Once you have a target system spec and have decided on a development environment, you’re off and running. But before you get too deep into your epic ragdoll physics-based space marine action online RPG with branching endings and a morality system, take a minute to think about your end users. Specifically, there are two areas that require consideration for Android games that you might not be used to: texture compression and input systems.

Texture compression is a way to (surprise!) compress your texture data. It can improve draw performance and let you pack more texture into vram. The problem with texture compression is that different graphics card vendors support different texture formats. The G1 and other MSM7k devices support ATI’s ATITC compression format. The Droid supports PowerVR’s PVRTC format. Nvidia’s Tegra2 platform supports the DXT format. The bad news is, these formats are not compatible. The good news is, all OpenGL ES 2.0 devices (including the Snapdragon-based Nexus One, the OMAP3-based Droid, and Tegra2 devices) support a common format called ETC1. ETC1 isn’t the best texture format (it lacks support for alpha channels), and it isn’t supported on the first generation devices, but it’s the most common format supported (the Android SDK provides a compressor utility (see sdk/tools/etc1tool) and runtime tools for this format).

The bottom line is that if you compress your textures, you’ll need to somehow provide different versions of those textures compressed with different formats. You could do this all in a single apk, or you could download textures from a web site over HTTP, or you could use ETC1 and restrict yourself to only OpenGL ES 2.0 devices. For Replica Island, I just chose not to compress my textures at all and had no problems. You can query the GL_EXTENSIONS string to see what the device you are currently running on supports.


String extensions = " " + gl.glGetString(GL10.GL_EXTENSIONS) + " ";
String version = gl.glGetString(GL10.GL_VERSION);
String renderer = gl.glGetString(GL10.GL_RENDERER);

boolean isSoftwareRenderer = renderer.contains("PixelFlinger");

// On 1.6 and newer, we could use ActivityManager.getDeviceConfigurationInfo() to get the GL version.
// To include 1.5, I'll use the GL version string.
boolean isOpenGL10 = version.contains(" 1.0");
boolean supportsDrawTexture =
extensions.contains(" GL_OES_draw_texture "); // draw_texture extension
boolean supportsETC1 =
extensions.contains(" GL_OES_compressed_ETC1_RGB8_texture "); // standard ETC1 support extension

// VBOs are guaranteed in GLES1.1, but they were an extension under 1.0.
// There's no point in using VBOs when using the software renderer (though they are supported).

boolean supportsVBOs =
!isSoftwareRenderer && (!isOpenGL10 || extensions.contains("vertex_buffer_object "));


You should also think carefully about how your game will be played. Some phones have a trackball, some have a directional pad, some have a hardware keyboard, some support multitouch screens. Others have none of those things. Per the Compatibility Definition Document, all Android devices that have Android Market are required to have a touch screen and three-axis accelerometer, so if you can get away with just tilt and single touch, you don’t need to worry about input much. If you want to take advantage of the various input devices that these phones support (which, based on several thousand comments on Android Market about Replica Island, I wholeheartedly recommend), the Android API will package the events up for you in a standard way.


Media_http4bpblogspot_juplt

That said, one of the most dramatic lessons I learned after shipping Replica Island is that users want customizable controls. Even if you have added perfect support for every phone, many users will want to go in and tweak it. Or they prefer the hardware keyboard over their phone’s dpad. Or they prefer tilt controls over trackball controls. My advice: plan on providing customizable controls, both so that you can support phones that have input configurations that you didn’t consider, and also so that you can allow users to tweak the experience to match their preferences.

Step Four: Profit!

The rest is up to you. But before you go, here are a few resources that might come in handy:


  • HeightMapProfiler. This is a simple 3D benchmarking tool that I wrote. It is the source of the performance numbers in this post. You can also use it to test how various GL state affects performance on your device (texture size, texture filtering, mip-mapping, etc).


  • SpriteMethodTest. Another simple benchmarking tool, this one for sprite drawing. This code is also useful as a 2D game skeleton application.


  • GLSurfaceView. This is a Java class that makes it trivial to set up an OpenGL ES application. You can use this code in combination with the NDK or with Java alone.


  • Quake Port. The complete source for an Android port of Quake has been made available by Jack Palevich, an Android team engineer. It’s a great sample of how to mix Java and native code, how to download textures to the sdcard over HTTP, and all kinds of other cool stuff (check out his memory-mapped-to-sdcard texture manager).


  • Replica Island. Here’s the complete source to my game, released under Apache2. Use it as a reference, or to make your own games.


Monday, June 14, 2010

Prediksi Selandia Baru Vs Slovakia.


Prediksi Selandia Baru Vs Slovakia., Tim Selandia Baru akan berusaha keras untuk tidak mengalami nasib yang sama seperti Australia di Piala Dunia, setelah tim Kangguru kalah telak 0-4 dari Jerman.

Prediksi Selandia Baru Vs Slovakia, Meskipun Selandia Baru termasuk salah satu negara yang memiliki peringkat rendah di Piala Dunia ini dan lebih dikenal sebagai negara yang kuat di cabang rugby, namun tim Selandia Baru sudah tidak sabar lagi turun bertanding.

"Ini pengalaman yang membanggakan," kata kapten Ryan Nelsen kepada para wartawan menjelang pertandingan di grup F melawan Slovakia hari Selasa.

Ini merupakan penampilan kedua Selandia Baru di Piala Dunia setelah sebelumnya tampil di tahun 1982, dimana mereka kalah dalam tiga pertandingan di babak penyisihan.

Selandia Baru sekarang berada di peringkat 78 dunia, peringkat kedua terendah di atas tuan rumah Afrika Selatan yang berada di peringkat 95.

"Kami ingin menang. Kami sudah membuktikan dalam empat atau lima pertandingan terakhir, bahwa kami bisa bersaing." kata Nelsen ketika ditanya apakah Selandia Baru akan mampu bersaing, setelah absen selama 28 tahun.
Bukan pelengkap penderita

Pelatih Ricki Herbert mengatakan kemenangan 1-0 atas Serbia dalam pertandingan pemanasan menjelang Piala Dunia menunjukkan bahwa Selandia Baru bukan tim yang lemah.

"Anda menonton pertandingan tersebut? Jelas sekali, tidak bukan?." katanya kepada seorang wartawan. "Kami senang bisa mengalahkan Serbia, negara dengan peringkat 15 dunia.. Saya kira persiapan kami sangat baik."

Australia mengalahkan Selandia Baru 2-1 dalam pertandingan pemanasan, sementara Selandia Baru juga kalah 1-3 dari Slovenia, dan 0-2 dari Cile dalam pertandingan lainnya.

Namun Herbert mengatakan timnya bermain baik untuk bisa lolos ke Piala Dunia dan tidak akan sekedar menjadi "pelengkap penderita" di Afrika Selatan.

"Para pemain yang ada sekarang ini bermain bagus untuk membawa Selandia ke Piala Dunia," katanya.

Nelsen yang menjadi kapten klub Liga Utama Inggris Blackburn Rovers mengatakan dia tidak gentar menghadapi tim Slovakia yang memiliki disiplin pertahanan tinggi.

"Kami tahu setelah melawan Serbia, dan Slovenia bahwa Slovakia akan memiliki permainan sama. Mereka kuat, sangat disiplin, dan sangat terorganisir."

Sunday, June 13, 2010

Belanda vs Denmark


Belanda vs Denmark, Belanda tak pernah bertemu Denmark di ajang Piala Dunia. Duel di Stadion Soccer City, Johannesburg di Grup E Piala Dunia 2010, Senin (14/6), akan menjadi pertemuan pertama kedua tim.

Prediksi Belanda vs Denmark Belanda dan Denmark lebih sering bertemu dalam pertandingan persahabatan. Mereka sesekali bertemu di Piala Eropa. Dari 29 rekor pertemuan, kedua tim hanya empat kali bertarung di Piala Eropa. Selebihnya mereka bertanding dalam ujicoba dan sekali bertemu di Olimpiade.

Ajang Olimpiade 1912 menjadi laga pertama Belanda dan Denmark. Dalam pertandingan di semi-final yang dilaksanakan pada 2 Juli 1912, Denmark sukses menghancurkan Belanda 4-1.

Ini sekaligus menjadi kemenangan terbesar Denmark. Sebaliknya, kemenangan terbesar Belanda tercipta pada 14 Maret 1984. Dalan ujicoba itu, Belanda membantai Denmark 6-0.

Meski demikian, kedua tim saling mengalahkan. Tercatat Belanda menang 11 kali dan Denmark mampu memetik kemenangan sebanyak delapan kali. Kedua tim bermain imbang sepuluh kali.

Saturday, June 12, 2010

Hasil Lengkap Kualifikasi Piala Dunia 2010

Hasil Piala Dunia 2010, Berikut hasil pertandingan babak Kualifikasi Piala Dunia Zona Eropa dari Grup 1 sampai 9 pada Minggu (7/9/2008).

Hasil Piala Dunia Kualifikasi Piala Dunia Zona Eropa
Jangan ketinggalan berita tentang Piala Dunia 2010, hanya di Okezone.com

Grup 1:
FT Albania 0 - 0 Sweden
FT Hungary 0 - 0 Denmark
FT Malta 0 - 4 Portugal

Grup 2
FT Moldova 1 - 2 Latvia
FT Israel 2 - 2 Switzerland
FT Luxembourg 0 - 3 Greece

Grup 3
FT Poland 1 - 1 Slovenia
FT Slovakia 2 - 1 Northern Ireland

Grup 4
FT Wales 1 - 0 Azerbaijan
FT Liechtenstein 0 - 6 Germany

Grup 5
FT Armenia 0 - 2 Turkey
FT Belgium 3 - 2 Estonia
FT Spain 1 - 0 Bosnia-Herzegovina

Grup 6
FT Ukraine 1 - 0 Belarus
FT Andorra 0 - 2 England
FT Croatia 3 - 0 Kazakhstan

Grup 7
FT Romania 0 - 3 Lithuania
FT Serbia 2 - 0 Faroe Islands
FT Austria 3 - 1 France

Grup 8
FT Georgia 1 - 2 Ireland
FT Montenegro 2 - 2 Bulgaria
FT Cyprus 1 - 2 Italy

Grup 9
FT Rep. of Macedonia 1 - 0 Scotland
FT Norway 2 - 2 Iceland

Download Count Problems

Something is apparently wrong in the Android Market. We are getting multiple reports of erroneous download counts. The right people are aware of the situation and are working on it.

[Update, Monday morning: The fix was rolled in early Sunday and it seems as though app developers have their missing downloads back.]

Friday, June 11, 2010

Blogging Round the World

It seems that once or twice a week, I run across an Android-developer-oriented site that I hadn’t previously noticed. There are already a few aggregators and directories, and I think we’re going to need more. But for the moment, here are three pieces of bloggy Android goodness, from Florida, Odessa (Ukraine!), and Sydney. What they have in common is that I previously hadn't encountered any of them.

Font Magic

This is from Florida-based Jeff Vera’s Musings of the Bare Bones Coder, which, although it advertises itself as being about “Coding and managing in the .NET space”, recently ran the excellent Android Development – Using Custom Fonts. You’ve always been able to use your own fonts in your own apps, but the how-to coverage has been light.

How Hot Is It?

Ivan Memruk from Odessa, Ukraine, brings us Mind The Robot, which has a refreshing concern for visual elegance. Speaking of which, soak up the analog steampunk tastiness of Android Custom UI: Making a Vintage Thermometer.

Aussie Rules

In this case, I mean rules for getting your Android project set up for use both via Eclipse and command-line Ant. Daniel Ostermeier and Jason Sankey from Sydney run the Android-dense a little madness, and lay the rules out in Setting Up An Android Project Build. Lots of steps; but very handy for a command-line guy like me.

Thursday, June 10, 2010

Making Sense of Multitouch


Media_http3bpblogspot_gjjmq

[This post is by Adam Powell, one of our more touchy-feely Android engineers. — Tim Bray]

The word “multitouch” gets thrown around quite a bit and it’s not always clear what people are referring to. For some it’s about hardware capability, for others it refers to specific gesture support in software. Whatever you decide to call it, today we’re going to look at how to make your apps and views behave nicely with multiple fingers on the screen.

This post is going to be heavy on code examples. It will cover creating a custom View that responds to touch events and allows the user to manipulate an object drawn within it. To get the most out of the examples you should be familiar with setting up an Activity and the basics of the Android UI system. Full project source will be linked at the end.

We’ll begin with a new View class that draws an object (our application icon) at a given position:


public class TouchExampleView extends View {
private Drawable mIcon;
private float mPosX;
private float mPosY;

private float mLastTouchX;
private float mLastTouchY;

public TouchExampleView(Context context) {
this(context, null, 0);
}

public TouchExampleView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}

public TouchExampleView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mIcon = context.getResources().getDrawable(R.drawable.icon);
mIcon.setBounds(0, 0, mIcon.getIntrinsicWidth(), mIcon.getIntrinsicHeight());
}

@Override
public void onDraw(Canvas canvas) {
super.onDraw(canvas);

canvas.save();
canvas.translate(mPosX, mPosY);
mIcon.draw(canvas);
canvas.restore();
}

@Override
public boolean onTouchEvent(MotionEvent ev) {
// More to come here later...
return true;
}
}


MotionEvent

The Android framework’s primary point of access for touch data is the android.view.MotionEvent class. Passed to your views through the onTouchEvent and onInterceptTouchEvent methods, MotionEvent contains data about “pointers,” or active touch points on the device’s screen. Through a MotionEvent you can obtain X/Y coordinates as well as size and pressure for each pointer. MotionEvent.getAction() returns a value describing what kind of motion event occurred.

One of the more common uses of touch input is letting the user drag an object around the screen. We can accomplish this in our View class from above by implementing onTouchEvent as follows:


@Override
public boolean onTouchEvent(MotionEvent ev) {
final int action = ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN: {
final float x = ev.getX();
final float y = ev.getY();

// Remember where we started
mLastTouchX = x;
mLastTouchY = y;
break;
}

case MotionEvent.ACTION_MOVE: {
final float x = ev.getX();
final float y = ev.getY();

// Calculate the distance moved
final float dx = x - mLastTouchX;
final float dy = y - mLastTouchY;

// Move the object
mPosX += dx;
mPosY += dy;

// Remember this touch position for the next move event
mLastTouchX = x;
mLastTouchY = y;

// Invalidate to request a redraw
invalidate();
break;
}
}

return true;
}


The code above has a bug on devices that support multiple pointers. While dragging the image around the screen, place a second finger on the touchscreen then lift the first finger. The image jumps! What’s happening? We’re calculating the distance to move the object based on the last known position of the default pointer. When the first finger is lifted, the second finger becomes the default pointer and we have a large delta between pointer positions which our code dutifully applies to the object’s location.

If all you want is info about a single pointer’s location, the methods MotionEvent.getX() and MotionEvent.getY() are all you need. MotionEvent was extended in Android 2.0 (Eclair) to report data about multiple pointers and new actions were added to describe multitouch events. MotionEvent.getPointerCount() returns the number of active pointers. getX and getY now accept an index to specify which pointer’s data to retrieve.

Index vs. ID

At a higher level, touchscreen data from a snapshot in time may not be immediately useful since touch gestures involve motion over time spanning many motion events. A pointer index does not necessarily match up across complex events, it only indicates the data’s position within the MotionEvent. However this is not work that your app has to do itself. Each pointer also has an ID mapping that stays persistent across touch events. You can retrieve this ID for each pointer using MotionEvent.getPointerId(index) and find an index for a pointer ID using MotionEvent.findPointerIndex(id).

Feeling Better?

Let’s fix the example above by taking pointer IDs into account.


private static final int INVALID_POINTER_ID = -1;

// The ‘active pointer’ is the one currently moving our object.
private int mActivePointerId = INVALID_POINTER_ID;

// Existing code ...

@Override
public boolean onTouchEvent(MotionEvent ev) {
final int action = ev.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN: {
final float x = ev.getX();
final float y = ev.getY();

mLastTouchX = x;
mLastTouchY = y;

// Save the ID of this pointer
mActivePointerId = ev.getPointerId(0);
break;
}

case MotionEvent.ACTION_MOVE: {
// Find the index of the active pointer and fetch its position
final int pointerIndex = ev.findPointerIndex(mActivePointerId);
final float x = ev.getX(pointerIndex);
final float y = ev.getY(pointerIndex);

final float dx = x - mLastTouchX;
final float dy = y - mLastTouchY;

mPosX += dx;
mPosY += dy;

mLastTouchX = x;
mLastTouchY = y;

invalidate();
break;
}

case MotionEvent.ACTION_UP: {
mActivePointerId = INVALID_POINTER_ID;
break;
}

case MotionEvent.ACTION_CANCEL: {
mActivePointerId = INVALID_POINTER_ID;
break;
}

case MotionEvent.ACTION_POINTER_UP: {
// Extract the index of the pointer that left the touch sensor
final int pointerIndex = (action & MotionEvent.ACTION_POINTER_INDEX_MASK)
>> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
final int pointerId = ev.getPointerId(pointerIndex);
if (pointerId == mActivePointerId) {
// This was our active pointer going up. Choose a new
// active pointer and adjust accordingly.
final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
mLastTouchX = ev.getX(newPointerIndex);
mLastTouchY = ev.getY(newPointerIndex);
mActivePointerId = ev.getPointerId(newPointerIndex);
}
break;
}
}

return true;
}


There are a few new elements at work here. We’re switching on action & MotionEvent.ACTION_MASK now rather than just action itself, and we’re using a new MotionEvent action constant, MotionEvent.ACTION_POINTER_UP. ACTION_POINTER_DOWN and ACTION_POINTER_UP are fired whenever a secondary pointer goes down or up. If there is already a pointer on the screen and a new one goes down, you will receive ACTION_POINTER_DOWN instead of ACTION_DOWN. If a pointer goes up but there is still at least one touching the screen, you will receive ACTION_POINTER_UP instead of ACTION_UP.

The ACTION_POINTER_DOWN and ACTION_POINTER_UP events encode extra information in the action value. ANDing it with MotionEvent.ACTION_MASK gives us the action constant while ANDing it with ACTION_POINTER_INDEX_MASK gives us the index of the pointer that went up or down. In the ACTION_POINTER_UP case our example extracts this index and ensures that our active pointer ID is not referring to a pointer that is no longer touching the screen. If it was, we select a different pointer to be active and save its current X and Y position. Since this saved position is used in the ACTION_MOVE case to calculate the distance to move the onscreen object, we will always calculate the distance to move using data from the correct pointer.

This is all the data that you need to process any sort of gesture your app may require. However dealing with this low-level data can be cumbersome when working with more complex gestures. Enter GestureDetectors.

GestureDetectors

Since apps can have vastly different needs, Android does not spend time cooking touch data into higher level events unless you specifically request it. GestureDetectors are small filter objects that consume MotionEvents and dispatch higher level gesture events to listeners specified during their construction. The Android framework provides two GestureDetectors out of the box, but you should also feel free to use them as examples for implementing your own if needed. GestureDetectors are a pattern, not a prepacked solution. They’re not just for complex gestures such as drawing a star while standing on your head, they can even make simple gestures like fling or double tap easier to work with.

android.view.GestureDetector generates gesture events for several common single-pointer gestures used by Android including scrolling, flinging, and long press. For Android 2.2 (Froyo) we’ve also added android.view.ScaleGestureDetector for processing the most commonly requested two-finger gesture: pinch zooming.

Gesture detectors follow the pattern of providing a method public boolean onTouchEvent(MotionEvent). This method, like its namesake in android.view.View, returns true if it handles the event and false if it does not. In the context of a gesture detector, a return value of true implies that there is an appropriate gesture currently in progress. GestureDetector and ScaleGestureDetector can be used together when you want a view to recognize multiple gestures.

To report detected gesture events, gesture detectors use listener objects passed to their constructors. ScaleGestureDetector uses ScaleGestureDetector.OnScaleGestureListener. ScaleGestureDetector.SimpleOnScaleGestureListener is offered as a helper class that you can extend if you don’t care about all of the reported events.

Since we are already supporting dragging in our example, let’s add support for scaling. The updated example code is shown below:


private ScaleGestureDetector mScaleDetector;
private float mScaleFactor = 1.f;

// Existing code ...

public TouchExampleView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mIcon = context.getResources().getDrawable(R.drawable.icon);
mIcon.setBounds(0, 0, mIcon.getIntrinsicWidth(), mIcon.getIntrinsicHeight());

// Create our ScaleGestureDetector
mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
}

@Override
public boolean onTouchEvent(MotionEvent ev) {
// Let the ScaleGestureDetector inspect all events.
mScaleDetector.onTouchEvent(ev);

final int action = ev.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN: {
final float x = ev.getX();
final float y = ev.getY();

mLastTouchX = x;
mLastTouchY = y;
mActivePointerId = ev.getPointerId(0);
break;
}

case MotionEvent.ACTION_MOVE: {
final int pointerIndex = ev.findPointerIndex(mActivePointerId);
final float x = ev.getX(pointerIndex);
final float y = ev.getY(pointerIndex);

// Only move if the ScaleGestureDetector isn't processing a gesture.
if (!mScaleDetector.isInProgress()) {
final float dx = x - mLastTouchX;
final float dy = y - mLastTouchY;

mPosX += dx;
mPosY += dy;

invalidate();
}

mLastTouchX = x;
mLastTouchY = y;

break;
}

case MotionEvent.ACTION_UP: {
mActivePointerId = INVALID_POINTER_ID;
break;
}

case MotionEvent.ACTION_CANCEL: {
mActivePointerId = INVALID_POINTER_ID;
break;
}

case MotionEvent.ACTION_POINTER_UP: {
final int pointerIndex = (ev.getAction() & MotionEvent.ACTION_POINTER_INDEX_MASK)
>> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
final int pointerId = ev.getPointerId(pointerIndex);
if (pointerId == mActivePointerId) {
// This was our active pointer going up. Choose a new
// active pointer and adjust accordingly.
final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
mLastTouchX = ev.getX(newPointerIndex);
mLastTouchY = ev.getY(newPointerIndex);
mActivePointerId = ev.getPointerId(newPointerIndex);
}
break;
}
}

return true;
}

@Override
public void onDraw(Canvas canvas) {
super.onDraw(canvas);

canvas.save();
canvas.translate(mPosX, mPosY);
canvas.scale(mScaleFactor, mScaleFactor);
mIcon.draw(canvas);
canvas.restore();
}

private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {
@Override
public boolean onScale(ScaleGestureDetector detector) {
mScaleFactor *= detector.getScaleFactor();

// Don't let the object get too small or too large.
mScaleFactor = Math.max(0.1f, Math.min(mScaleFactor, 5.0f));

invalidate();
return true;
}
}


This example merely scratches the surface of what ScaleGestureDetector offers. The listener methods receive a reference to the detector itself as a parameter that can be queried for extended information about the gesture in progress. See the ScaleGestureDetector API documentation for more details.

Now our example app allows a user to drag with one finger, scale with two, and it correctly handles passing active pointer focus between fingers as they contact and leave the screen. You can download the final sample project at http://code.google.com/p/android-touchexample/. It requires the Android 2.2 SDK (API level 8) to build and a 2.2 (Froyo) powered device to run.

From Example to Application

In a real app you would want to tweak the details about how zooming behaves. When zooming, users will expect content to zoom about the focal point of the gesture as reported by ScaleGestureDetector.getFocusX() and getFocusY(). The specifics of this will vary depending on how your app represents and draws its content.

Different touchscreen hardware may have different capabilities; some panels may only support a single pointer, others may support two pointers but with position data unsuitable for complex gestures, and others may support precise positioning data for two pointers and beyond. You can query what type of touchscreen a device has at runtime using PackageManager.hasSystemFeature().

As you design your user interface keep in mind that people use their mobile devices in many different ways and not all Android devices are created equal. Some apps might be used one-handed, making multiple-finger gestures awkward. Some users prefer using directional pads or trackballs to navigate. Well-designed gesture support can put complex functionality at your users’ fingertips, but also consider designing alternate means of accessing application functionality that can coexist with gestures.

Tuesday, June 8, 2010

Suami Cut Tari: Fisik Mereka Berbeda

Video esek-esek dengan dua pelakon mirip penyanyi Nazriel Irham alias Ariel dan Cut Tari membuat heboh masyarakat. Suami Cut Tari, Johannes Subrata atau Joesoef, mengakui bahwa perempuan yang ada dalam video Cut Tari Ariel berdurasi delapan menit itu memang mirip istrinya.

"Kalau video, saya memang sudah melihat. Dibilang mirip, memang rada mirip," katanya ketika ditemui di kediamannya, di Jalan Pondok Kelapa, Jakarta Timur, Selasa (8/6/2010).

Joesoef mengaku, ia mendengar kabar peredaran video itu dari salah seorang temannya. Lanjutnya, saat itu juga ia langsung menonton sendiri video tersebut.

Meski mengakui bahwa wanita dalam video tersebut agak mirip, Joesoef melihat tetap ada perbedaan antara wanita yang ada dalam video tersebut dan istrinya. Perbedaannya, lanjutnya, terletak pada fisik kedua wanita itu. Namun, ia tak mau membeberkan soal perbedaan yang dimaksudnya.

"Kayaknya tidak dibicarakan untuk umum. Itu kan sifatnya pribadi, tapi ada perbedaan," cetusnya.

Sejauh ini, masih aku Joesoef, rumah tangganya dengan presenter acara gosip Insert itu terbilang harmonis. Apalagi, setelah dirinya dan Cut Tari dikaruniai seorang putri.

"Hubungan saya dengan Tari baik-baik saja, terlebih setelah adanya anak ini. Sampai sekarang saya tidak merasa ada masalah dengan Tari. Mudah-mudahan seterusnya," ucapnya.