Blog
console.log on Android WebView
Fri, Feb 26, 2010
by
Joe B

I recently bought a new phone, the Motorola Milestone from Telus. The Milestone currently features Android 2.0.1, and is the first Canadian phone that actually features Android 2. So, while confirming fixes on the device, I noticed in LogCat that my WebCore wasn’t logging error messages. For those of you who don’t know, on Android 1.x, you could debug your javascript by using adb logcat and grepping for the WebCore errors. This frustrated me, since this wasn’t listed in the API changes. I then decided to sift through the WebView source code, and I found addMessageToConsole.

The method addMessageToConsole is a method that currently exists on the WebChromeClient that can be overriden with your own custom error message. Now, according to the Google Documentation, this is not a public method to be used until Android 2.1. However, I just tested it on my Motorola Milestone, and the method actually works. I’ve included this fix to PhoneGap and you should now be able to go back to debugging your Javascript directly on the device, as opposed to the other methods of using a different browser.

BTW: The code to add it is as follows:


public final class EclairClient extends WebChromeClient
{
private String TAG = "WebErrorLog";
// This is a test of console.log, because we don't have this in Android 2.01
public void addMessageToConsole(String message, int lineNumber, String sourceID)
{
Log.d(TAG, sourceID + ": Line " + Integer.toString(lineNumber) + " : " + message);
}
}

For backwards compatibility with Android 1.6, it’s a good idea to have this class extend a pre-existing WebChromeClient, and to dynamically chose the client you instantiate so you can actually get your application working.


› Visit the original post

Phonegap contributor agreement
Mon, Feb 1, 2010
by
Jesse
Over the weekend, I submitted the Nitobi Contributor Agreement to the PhoneGap mailing list and created a minor sh!t-storm.  I did a few things wrong and as a result it became obvious that our intent was left unclear. This post is my attempt at reaching clarity.
Many of the things we at Nitobi were accused of attempting with this agreement are precisely the things we are attempting to prevent.
The document was mis-titled and very misleading, it reads “Nitobi Creative Commons Contributor Agreement”, when it should have been titled, “PhoneGap Contributor Agreement”.  The actual document itself is licensed Creative Commons Attribution-Share Alike 3.0 Unported, not PhoneGap!
I was not clear enough in informing everyone that the license for PhoneGap is NOT changing,  and it will continue to be MIT licensed.  The agreement is being put in place to protect that.
Contributors are NOT giving up their rights, or blindly assigning their rights to Nitobi, they are agreeing to SHARE their rights with Nitobi.  Contributors give up nothing and are free to do what they want with their own submissions, short of revoking the rights they have granted to Nitobi. There is NO danger that contributions can be made exclusively proprietary.
The agreement implies that mailing list conversations are covered, or this is how some readers interpreted it.  This is absolutely NOT true: the mailing list, wiki and likewise PhoneGap documentation are not covered by this (or any) agreement, and we will be updating the agreement to make this obvious.
So to repeat, as clearly as possible: PhoneGap is and will remain under the MIT license and be freely available for use in your applications ( for fun OR profit ).  You do not need to sign anything to use PhoneGap in your applications, you just need to agree to the MIT license.  Only those wishing to contribute back to the project ( via checkin to the repository ) will need to sign the agreement.
As always, we remain committed to Open Source and the community surrounding it, and will work with the community to do the right thing.
If you wish to comment on the agreement, or PhoneGap please feel free to do so in the group mailing list. http://groups.google.com/group/phonegap/

Over the weekend, I submitted the Nitobi Contributor Agreement to the PhoneGap mailing list and created a minor sh!t-storm.  I did a few things wrong and as a result it became obvious that our intent was left unclear. This post is my attempt at reaching clarity.

Many of the things we at Nitobi were accused of attempting with this agreement are precisely the things we are attempting to prevent.

  • The document was mis-titled and very misleading, it reads “Nitobi Creative Commons Contributor Agreement”, when it should have been titled, “PhoneGap Contributor Agreement”.  The actual document itself is licensed Creative Commons Attribution-Share Alike 3.0 Unported, not PhoneGap!
  • I was not clear enough in informing everyone that the license for PhoneGap is NOT changing,  and it will continue to be MIT licensed.  The agreement is being put in place to protect that.
  • Contributors are NOT giving up their rights, or blindly assigning their rights to Nitobi, they are agreeing to SHARE their rights with Nitobi.  Contributors give up nothing and are free to do what they want with their own submissions, short of revoking the rights they have granted to Nitobi. There is NO danger that contributions can be made exclusively proprietary.
  • The agreement implies that mailing list conversations are covered, or this is how some readers interpreted it.  This is absolutely NOT true: the mailing list, wiki and likewise PhoneGap documentation are not covered by this (or any) agreement, and we will be updating the agreement to make this obvious.

So to repeat, as clearly as possible: PhoneGap is and will remain under the MIT license and be freely available for use in your applications ( for fun OR profit ).  You do not need to sign anything to use PhoneGap in your applications, you just need to agree to the MIT license.  Only those wishing to contribute back to the project ( via checkin to the repository ) will need to sign the agreement.

As always, we remain committed to Open Source and the community surrounding it, and will work with the community to do the right thing.

If you wish to comment on the agreement, or PhoneGap please feel free to do so in the group mailing list. http://groups.google.com/group/phonegap/


› Visit the original post