Skip to Navigation | Skip to Content



Archive for the 'Uncategorized' Category

Ada Lovelace Day Post | March 24th, 2010

Last year at this time, I did a post about Ada Lovelace Day, and once again I’m back at it, doing another post, this one is going to be pretty short. This year, I wasn’t sure why I was going to write a blog post about, so I figure that this time, I’ll just write about my 2nd Year Computer Architecture Professor, Desa.

Desanka Polajnar was probably the first CS professor that actually made people worry about failing a Computer Science course when I was up at UNBC ten years ago. People for some reason couldn’t quite understand how boolean logic worked, and why K-Maps were a good idea. In fact, many people didn’t even realize why it was relevant to learn Assembly Programming at all, and many people consider knowing the internals of a processor a waste of time. I remember hating the first CPSC 230 class, because it was hard, and because it seemed to have absolutely no bearing, or connection to what I’d be doing now. I also remember thinking that MIPS and ARM assembly was useless because you know, everything runs on an x86.

Also, it was in her class that I got introduced to Hardware, which has turned into a pretty awesome hobby. It’s strange, since to this day, I haven’t met too many people that even know what a PDP-8 even is, let alone actually implement it with microcontrollers and TTL logic. Thanks to Desa, I can say that I actually have done that, and I think that’s pretty awesome. I definitely appreciate the time I spent in her classes, even if I didn’t seem like it back in the 90s, when I was actually in them.

Thanks

Posted in Uncategorized | No Comments » | Add to Delicious | Digg It

LOLWUT? Canvas Benchmarking on C5Bench and Xperia X10 | February 26th, 2010

Recently, I started looking at Canvas on Android, and I came across the C5 Canvas Benchmarking test. I tested it on both the Motorola Milestone that I recently bought, and the Sony Ericsson Xperia X10, and it was pretty surprising. Now, it should be noted that the Motorola Milestone has a TI OMAP3430 processor, and is capable of speeds up to 600 MHz. However, the Xperia X10 has a Qualcomm Snapdragon processor, and has a clockspeed of 1.02 GHz. Now, people have been speculating whether this clock speed will make a difference, and I think that when you look at the results, it clearly does.

Now, I don’t think that performance is quite there yet, but you may see more advanced uses of Canvas on mobile web applications in the future.

Posted in Android, Uncategorized, phonegap | No Comments » | Add to Delicious | Digg It

console.log on Android WebView | February 26th, 2010

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.

Posted in Android, Uncategorized, phonegap | No Comments » | Add to Delicious | Digg It

Android 1.5 to 2.0 Support in EDGE | November 26th, 2009

After spending a day with Java reflection, I believe that we are now at the point where PhoneGap Android can now be supported on 1.5, 1.6 and 2.0 versions of Android. This wasn’t incredibly hard, except for the fact that I was unfamiliar with reflection, and the example on the Android site is less than helpful, since it deals with the Debug static methods, and not a real world object that can have things like instances. Also, reading Sun’s documentation made me realize how useless examples that use the word Class is as a classname.

The result of this is that we may have a JAR that can be used on Android 1.5, 1.6 and 2.0, which solves the divergence issue. However, this doesn’t mean that we have SQLite database storage that doesn’t exist on Android 1.5 or 1.6. It means that if you are using Android 2.0, you have access to the SQLite Database if you are running the Edge version.

After pairing down PhoneGap to a jar, it appears to be weighing in at under 200k. I’m thinking about distributing it as an installable library on Android so that if you have it installed, you can download PhoneGap compatible APKs. This would be similar to the Text-To-Speech API functionality. This may encourage Google to close the browser gap, or it may just get ignored if people just use their own stand-alone PhoneGap + app apps.

More info on this will come shortly.

Posted in Uncategorized | 1 Comment » | Add to Delicious | Digg It

It’s the end of the Nokia Symbian world as we know it, and I feel fine | November 19th, 2009

So, after hearing the news that Nokia will be dropping Symbian from their High-End N-Series phones by 2012, and adopting Maemo, I decided that I would do a bit more research into the platform. I heard good things about it being open and it having an actual mature Linux stack (as opposed to what is running on Android and Palm), and I wanted to see how much effort it would take to get a PhoneGap prototype to run on it. At around 4 PM, I have this to show for it:

PhoneGap Maemo

I used QtWebView to implement this, and it took more time to get the SDK started and working than it took to actually write the app and run it. I think getting the SDK for Maemo was the biggest hurdle for developing for the device so far. Of course, this is ONLY for Nokia phones, and not for many other phones, but the fact that the N900 was a device that I was considering until I found out it couldn’t support Canadian HSPA frequencies, I figure it was worth messing with. Also, QtWebKit is a part of Qt, and in theory can run on Windows Mobile with mostly the same codebase. With the uncertainty of whether Maemo would get Symbian WRT running on the device in some way, this may be an option.

At the end of the day, I’ll probably stick with my Android Phone, but this was rather interesting.

Posted in Uncategorized | 3 Comments » | Add to Delicious | Digg It

Android 2.0 and WebKit | October 29th, 2009

Google just released the latest version of the Android SDK, Android 2.0, which does most of what I need it to do. I noticed that so far the changes that Google has made to WebKit have not found their way back to the Android Open Source Project, which is disappointing, but overall it looks interesting.

Google has recently ripped out Gears and replaced it with proper HTML 5 support. This means that the Android 2.0 browser now supports HTML5 Video, Canvas, Geolocation and Database Storage. This is pretty huge for Android and for PhoneGap on this platform, since this allows for the write once run anywhere behaviour that we expect, without any weird gotchas.

Now, I’m going to talk about what is in WebView. For those of you who don’t know, WebView is the WebKit Java Component that PhoneGap, and all other WebKit-based Browsers use on the Android device to display web content. So far, I’ve tested Canvas, Geolocation, and HTML5 Database Support, and I’ve gotten some mixed results.

Canvas works right out of the box, while Geolocation seems to not work at all in the Emulator. Of course, I have to send it mock locations to get it to work, so I have no idea what this would be like on an actual phone. I can say the same thing with the video tag. There are issues with it not actually playing the video, BUT I think it’s the fact that the video is a higher resolution than what the Emulator can handle. We’ll know more once someone tries this on a Motorola Droid or other next-gen Android device.

The BIGGEST issue is with the Android Database Support. It’s there, but only on the Browser Application, where the settings can be properly setup. However, it’s not present on the WebView itself, where you have to set the Database Path and the the location for where the Database Files will be stored. Of course, we end up with this sort of awesomeness.

alert_fail

This is caused by the fact that for some reason we don’t have a way to set the size of the database locally, or the fact that we don’t have a way to handle when we do go over quota, or both, or neither. We don’t know because there’s no examples on the Internet at this point on how to fix this issue for Android. If you take the same code in WebKit Nightly, Safari or Midori or any other WebKit that supports HTML5 storage, it should work.

I’m hoping once the code drops for Eclair, I can look at the browser activity and find the place where it’s enabled. This should be rather trivial, but given the fact that this is bleeding edge stuff, I’m not suprised that WebView, something only used by developers, would be overlooked/not documented.

I hope to have more info on Android 2.0 soon, and we will be looking at dramatically changing PhoneGap for Android based on these change. In the meantime, feel free to download the Android 2.0 SDK and try it out for yourself.

Posted in Uncategorized | 1 Comment » | Add to Delicious | Digg It

About Giving Back | August 27th, 2009

So, in my last post, I wrote about trying to figure out the WebKit source. Now, unlike other open source projects that I played with or contributed to, WebKit isn’t exactly the most obvious one to hack on. The main things that make it difficult to grep and figure out was the the fact that there’s no obvious point of entry for new hackers.

Now, when it comes to other pieces of software with similar complexity, they approach this problem in numerous ways. For example, the Linux Kernel, (which I occasionally try to test and write modules for, none of which are any good to make it past my desktop) has a really good site called kernelnewbies.org, that I would recommend anyone who is new to Operating Systems read. It goes through how the Linux Kernel actually executes, the coding conventions, and how to code, test and patch a kernel. Sites like this are very important to overcome the whole “Einstein” complex that comes with Open Source software.

Now, with WebKit, there’s not as much for new developers to grab onto, so I went back to something that I was more familiar with, which was Mozilla. Now, I admit that in the past I’ve attended some MozCamps, and I’m friends with a few people there, but I’ve never touched the actual Firefox Source.

Until now.

Admittedly, this was a VERY easy bug to fix, of minor importance, and it was flagged as “Good First Bug”. I was looking for something that I could write quickly while working on other projects during the day. I’ve never used Mercurial until I fixed this bug, and I’m nowhere near being a XUL ninja, but I managed to get a bug fixed, which is awesome.

I feel that these social hooks are what’s needed in making a successful open source project, and that the people who put the time into flagging the bugs as [good first bug] in Bugzilla, or maintain things like Kernel Newbies are awesome. I hope that more people make sites that give people who have a passing interest in Open Source development the ability to contribute back, and it’s something that we try to keep in mind here when we make our stuff. For example, If you think that there’s something in PhoneGap that needs to be clarified from a contributor standpoint, please let us know and we’ll try to figure out how we can make it easier, (within reason, we’re sticking with git, because git and hg are awesome).

Posted in Uncategorized | No Comments » | Add to Delicious | Digg It

WebKit and a call for Sanity | August 21st, 2009

Recently, someone was talking to me about Apple, and was telling me about how it’s next to impossible to make sure that WebKit was secure and that it was a lost cause. Now, given that WebKit is basically the web experience of most mobile devices, this claim seemed like it required more looking into, and that it’d be a good idea to once again attempt to take a look into the WebKit Internals.

The thing is that there’s literally no documentation for the WebKit project beyond some mentions of events in the iPhone SDK docs. WebKit in general is a very ambiguous piece of software, and each version of webkit is different depending on what platform it’s compiled for and which features were built. The downside of this is that this is all based on conversations over beer, and a broken Bugzilla.

Given that I’m generally new to browser internals, I would have to say that looking at the WebKit source without any idea of how WebKit works is next to impossible. I’ve played with builds of Mozilla in the past, and I think that I’ll probably keep looking at Mozilla code simply because:

  • The edge version compiles under Ubuntu
  • Mozilla’s Bugzilla isn’t some secret thing where you have to be working for Apple, Google or some other company to read the bugs
  • Mozilla seems to want people to look at the code

Open Source is great, but there seriously needs to be a “Hitchhikers Guide” to WebKit, and unfortunately WebKit is just not there. I admit that WebKit is a better browser when it comes to embedding it into various devices, but the clear lack of transparency when it comes to WebKit seems to make me think that the person who told me that it was a lost cause might actually be right. Developers need documentation, and the current lack of documentation is rather frustrating to say the least, that and the fact that you seem to have to have a Mac to develop for it, is another reason why I find myself going back to looking at Gecko.

Because documentation and a friendly community actually does matter.

Posted in Uncategorized | No Comments » | Add to Delicious | Digg It

Not all webkits are equal, stories of reading code | June 17th, 2009

Recently, there’s been concern over the state of WebKit on Android. If anyone has ever used the WebView, people realize that it doesn’t have gears. However, once you look at the source code of the Browser in Google Android (You can actually do this), you realize very quickly that it’s not an issue with the browser, it’s an issue with the Shared Library not being loaded.

Now, currently I don’t know if the current SDK would support the NDK-style JNI required for PhoneGap to do this, but it should be coming in Donut. However, I want to know when HTML 5 is coming to Android. If you take this page and try to run it on the Android browser, it will fail, but it should work on the iPhone, Safari and it works on my version of Midori that I’m running on Ubuntu.

I don’t have a copy of the source code to the Palm Pre, although I hope that one day in the future I can see their version of WebKit and see how they managed to get HTML 5 on the phone. I hope that Google follows suit and gets proper HTML 5 support on their browser instead of using gears in a shared library linked in the Browser APK. This is important since Gears is not HTML 5. I honestly enjoy going through the Android Source Code for the most part and seeing how the Java fits with the rest of the embedded system. It’d be great if I could do this with the Pre as well.

Posted in Uncategorized | No Comments » | Add to Delicious | Digg It

Open Web Vancouver | June 15th, 2009

Open Web Vancouver was pretty awesome this year. The Pirate Party keynote by Rickard Falvange was awesome, and really was a solid follow up to Zak Greant’s talk on “The Age of Literate Machines”. Given the current climate with people fighting against more oppressive copyright, I really liked how relevant it was, and how it tied to the Civil Rights movement.

The second keyonote talk was also really well put together. I saw Angela Byron’s “Women in Open Source”, and it was interesting to see how many other people were shocked as to how few women were in Open Source. The talk was interesting, and depressing at times, but it was a good talk, and it showed a need for everyone in the Open Source community to wake up to this reality and do something about it.

The thing that irritated me the most about the conference was actually not the fault of the organizers of the conference, and is entirely the fault of Bell Canada, and the convention center. Jake Appelbaum of the Tor Project (and of Noisebridge) was giving a talk on Tor. Tor is an anonymizing router that allows for people in places such as Iran and China to access roughly the same internet as someone living in a country such as Canada or the United States, getting around government restrictions such as the Great Firewall of China. The problem is that unfortunately, the Vancouver Convention Center is more oppressive than the Chinese Government, because they blocked the following sites:

Now, I can understand blocking something like 4chan (the Anime convention had a talk on it, BTW), but blocking Tor and UNICEF is crossing a line. The site in question had information on a project that I was looking to promote during my Android talk, which allowed for formatted SMS messages to indicate where things like Mosquito Nets to prevent Malaria should go, and where buckets for distributing clean drinking water should go. This project actually does a LOT of good. Too bad Bell Canada disagrees with me.

The other talks at the conference were pretty awesome. The big complaint that I had this year was
that the PhoneGap presentation by Brock and Rob was at the same time as Franklin Lopez’s presentation about Documenting Dissent. The Open Data talks by David Eaves were pretty interesting as well, since the City wanted to know what data it should open first.

In short, the conference was great, despite the fact that Bell censored the Wireless. I find that this will be the one thing that sticks in my mind this year, since the organizers did their best to position Open Source, Free Speech and Fair Copyright in the forefront.

Posted in Uncategorized | No Comments » | Add to Delicious | Digg It