2010/05/30

Debugging web pages in Android

Finally I've found a nicer way to debug errors with web pages in the Nexus One!

The Android documentation states that console.log calls can be used to send messages to "logcat", and then you need another app or keep the phone connected to the computer with the SDK and whatever in order to read those messages. Too complex.

On the other hand, if you type "about:debug" in the url bar and press go, you won't notice anything special, but if you press the menu button and then "More", you'll notice that there are two extra items at the end, also there are additional settings at the end of the panel (allowing to change the User-Agent for example). And one of them (enabled by default) is to show the javascript console, so now when a page outputs something to the Javascript console you get a little notification bar at the top and clicking it shows the messages without the need to switch to another application.

I don't know where this feature is described and other about: pages that have special meaning in Android.

2010/05/29

Little Firefox extension for people with Android 2.2

One of the new features that it's coming in Android 2.2 or FroYo is the ability to use the Google "Cloud to Device" servers. Basically it is the possibility of an Android App to get a notification from an external server, but without the need to open a connection by yourself and drain the battery and data plan of the user. It's nicely explained in the Android Developers blog: Android Cloud to Device Messaging

Besides the API they have published also a little project "Chrome to Phone" that adds a little button in your chrome browser to send whatever page you are currently viewing to your phone. But despite all the nice features of Chrome I still prefer to use Firefox, the Chrome interface still looks too weird to me and in general I know that I Firefox works mostly the way that I want.

So the next step was quite obvious: it was a Sunday with some free time so I created the Send to Phone extension. It was funny but quickly after publishing it I realized that another guy had the same idea and he beat me by 3 minutes, fortunately it seems that none of us have a big ego so we have agreed to merge both extensions, I picked some of his code, added a few extra things and we got now a nicer version for you to enjoy.

If you did install the leaked 2.2 preview you can test the extension right now, I hope that you enjoy it and find it useful at least for some situations: for example this morning I started watching a YouTube video on the PC, but had to go to the kitchen, so I just clicked the button and then I had the same video on the phone without the need to search anything.

New releases at CKSource

Yesterday CKSource released the new versions of CKEditor and CKFinder. You can read the updates on each one in their blog posts, but I'm gonna give you my point of view about them.

CKEditor 3.3 is a progressive enhancement over the previous version, lots of bug fixes, some little new features, everything focused on trying to make your experience using CKEditor better than ever before. Of course we have tried to test and verify that everything is working correctly and no regressions have been introduced, but it's just impossible to test all the possible setups and ways that people use CKEditor, so if you find something that used to work in 3.2 or 3.2.1 and now fails, then go ahead to the CKEditor dev site, check for other reports and if you don't find anything create a new ticket explaining the problems and please, provide a test case so that we can reproduce the problem. If you just say "it fails", then we won't be able to fix it, if instead you provide a simple html file then it will be easier to find out what went wrong.

CKFinder on the other side is a complete rewrite of the client part, you'll find now that it follows the behavior of CKEditor, it includes lots of changes and this is just the beginning. With CKFinder 2 it's possible to write both client-side and server-side plugins to enhance your integration and provide new features. Check the provided samples and be sure that we will keep improving it, we just need time and good feedback about what you need. In order to report issues you can use the CKFinder forum

Trying to explain all the features available right now with just a few words isn't easy so I'm gonna stop talking and urge you to test the demos (CKEditor and CKFinder), I hope that you really like them.

2010/05/23

Browser updates in FroYo

As FroYo (Android 2.2) has been "released" for the Nexus One I opted to not wait for the OTA update and yesterday I installed it. The process was very easy and quite fast.

In the Google I/O conference they talked a bit about the new features, and those have been posted over and over again, so I just wanted to talk about the details in the browser.

Previously the User-Agent was

Mozilla/5.0 (Linux; U; Android 2.1-update1; es-es; Nexus One Build/ERE27) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17

Now it's

Mozilla/5.0 (Linux; U; Android 2.2; es-es; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

The scores at Acid3 and Html5Test remain the same (more about this later)

Animated gifs now work, and also <input type="file">, although its behavior it's a little strange: When you click it it prompts you to select the application to use: Gallery, Sound recorder, Ringdroid and Music track.

Gallery and Music track works as you expect: it shows their listings and you can pick up the file that you want. Sound recorder is also quite what you can expect: you get a simple sound recorder allowing to record, play and confirm the sound, but it doesn't allow to change any setting and the file is saved as .3gpp (AMR 8000Hz 12kbps)  in the root of the SD card. I didn't test for the moment to upload it, but refreshing the page leaves the file there, maybe it would have been better placed at the /tmp ? The other strange issue with this Sound recorder is that such app isn't available as a stand alone, why?

Finally Ringdroid, this means that other apps should be able to somehow appear in the list. When you pick Ringdroid it shows a file listing and when you select one, instead of going back to the browser it opens that file in Ringdroid, so you edit it and it becomes the selected one, but you can't pick an existing file without modification.

So now I hope that whatever API is required to use correctly this feature is properly documented so file managers like Astro are able to hook into it and we can use whatever file that we have on the SD card.

Lastly Flash. Yes, Flash 10.1 (beta) available in a mobile device: You go to the market, search for Adobe and install it. Then you can go to browse the web without any worry about if some feature was using it or no, you just use that page. And if you don't want to use it by default you just have to adjust the settings in the browser so add-ons aren't enabled by default so you see a green arrow and can click it to load that flash. Hey Apple-fans, how does that causes crashes or eat my battery?

As I was testing the html file upload I decided to give the flash part a go and it works partly: if the file mask is *.* then you can't pick any file (a "No file was found" message is shown), but if you restrict it to images ("*.jpg; *.jpeg; *.png") then it will show you a list of images and you can select the one that you want (yes, one one at a time). Isn't that weird? if you say that you only want images you get the file listing, but if you allow any file then you can't pick anyone.