Monthly Archives: March 2009

Mobile Dev Joy : The Adventure with Mobile Browser

My post today will be rather technical, but I’m sure some will find it interesting because it’s about a topic that’s not as widely discussed as others. Some may even find it useful. It’s about my brief stunt with mobile development.

Some time ago I was asked to look at a web-based apps which is to be used with a mobile phone. A Nokia E70 to be exact. It’s based on Symbian S60 3rd edition platform. Basically, a Javascript which is supposed to run won’t. So I looked into it.

This piece of Javascript is vital for usability reasons. Without it, the input process will take up to 50% longer. So I thought, yeah I’ll set aside a bit of my time and hack this.

Then I realized that when I thought the browser situation on the PC / desktop platform is a mess; it actually look very tidy and well-ordered compared to the situation on the mobile platform 🙂

First, mobile platform is much more limited — in terms of CPU / processor power, memory capacity, secondary storage (hard disk / flash ram) capacity, power, etc. These limitations in turn must be taken into account by all mobile browsers. Which causes various quirks / incompatibilities to surface when you dig deeper into it.

Second, free(dom) software has not yet made as much impact here as it is on the desktop. Therefore we have plethora of proprietary technologies, which sometimes doesn’t work together / conform to the open standards.

Third, there’s not as many documentations available on the topic. As I googled around, I realized in horror that I may have to hack around much more than I thought necessary.

Back to the hack – first thing I tried was to install Opera mobile (not Opera mini). Yes, we’re willing very willing to pay Opera if it works. In short – the Javascript works on it.
Unfortunately, Opera mobile crashes around so much, it’s impossible to enjoy any kind of productivity with it.

Also there are a LOT of quirks with Opera mobile when used with keypad.
They are small things, but gets annoying very quickly. Which doesn’t help when you’re trying to accomplish good amount of work.

Maybe it’d be better if I try an older version of it, but seeing it consume too much RAM anyway; I thought I’ll give the built-in browser a try first.

Called “Nokia Mini Map Browser” because of its “mini map” feature, it’s speedier than Opera mobile and doesn’t use as much memory. However, the Javascript on our web-apps doesn’t work there.

So I thought, perhaps this browser doesn’t support the latest version of Javascript. Or worse, perhaps it has its own version of Javascript. That would suck greatly.
Anyway, I started to try looking for documentation on the topic, also for a tool to help me debug the problems there.

I found Nokia Mobile Browser Simulator 4.0. It’s Java-based. However, it seems to be hard-coded for Windows, with Windows installer too. Ok so I found a Windows machine, and set it up.

To my dismay, it doesn’t work very reliably. To be precise, it won’t even load the web-apps. While the actual browser in Nokia E70 will display it correctly.

With documentation on the subject (Javascript capabilities of Nokia Mini Map Browser) also very lacking, this is starting to look like a dead end.
Until I found out that the Nokia Mini Map Browser is actually an open source project !

Code named “S60browser”, or “S60Webkit”, it’s available from opensource.nokia.com
There’s hope – if there’s code available, then anything can always be traced / found out.

My sharp-minded readers will quickly realize another thing – yes, it’s basically the same as the Safari browser, the one on Mac OS X 🙂

Nokia Mini Map Browser aka S60browser aka S60Webkit is based on another open source project called WebKit. Which happens to be the foundation used as well by Apple to build their browser, Safari.

Now this is getting interesting 🙂

I dug deeper into these new clues, and began to feel sure that both browser’s cores are indeed identical. Which means that I’d be able to debug the problem with Safari browser.

safari-pref-advanced
I fired up Safari, invoked the Preferences screen, and clicked on Advanced icon. I enabled “Show Develop menu in menu bar”, then I restarted Safari. A new menu then showed up. I chose Develop – Show Web Inspector (also accessible via Cmd-Alt-i)

I got the detailed error message in no time. It’s “Object [object HTMLInputElement] (result of expression document.getElementById(“testForm”).submit) does not allow calls“.
As I already mentioned, the script works on Firefox and Opera, but somehow it doesn’t work on Safari. So it’s Googling time again.

Turn out it’s a generic error message whenever Safari have problems executing a function.
So it could be that the function doesn’t exist. Or the function name is mispelled. Or any other function-calling related problems.
Great, looks like this will cause more questions than it answers…

Thankfully I wasn’t on the wild goose chase for too long. A comment on a blog post gave me the hint I needed :

I gave a form button the *same name* as the function it was calling in its onclick. This error was the result.

Joshua, thank you. That’s exactly what happened in my case 🙂
A line in the script is as follows :

document.getElementById(“testForm”).submit();

While there’s also a button on the same script named, you guessed it, submit :

<input type=”submit” name=submit />

So Safari got confused, and threw this generic error message.

And it’s very easy to fix, I just need to change the button’s name value to something else – and it works now on Safari & Nokia Mini Map Browser, as well as on Firefox and Opera.

I love happy endings 🙂

Moral of the story ? Open source software empowers developers.

And this is not the first time – my MSc thesis was about to fail; when I found ping’s source code on the Internet. It gave me the hint needed to continue the project. The thesis got among the best mark at that year.

With availability of the source, we can learn from the brightest minds on Earth with ease. The knowledge and wisdom become available for all.
Even to the ones with feeble minds, like me.

Here’s another cheer for free(dom) software movement : May the source be with you 🙂

(oh, and also, all hail Google !)

Old & New

Ketika akan posting hari ini, saya baru sadar bahwa situs ini lenyap. Kosong melompong. Hanya menampilkan indeks directory nya di server, yang polos tiada berisi suatu apa pun.

Kena hack? Bisa jadi.
Padahal ini dihosting di sebuah server yang sudah di harden.

Untunglah ini bukan masalah, karena situs ini rutin di backup 🙂
Dalam waktu kurang dari 5 menit, data situs dari backup nya selesai saya restore – dan situs ini kembali berjalan sebagaimana semula.

Ada beberapa pelajaran yang bisa kita ambil dari sini :

(1) Server yang secure itu percuma, jika aplikasinya belum secure. Tetap saja para hacker/cracker akan bisa masuk.

(2) Backup data itu sangat penting.

Oh ya, perusak situs ini adalah cracker, BUKAN hacker.
Hacker itu bisa jadi adalah seseorang yang banyak ingin tahu, senang mengutak-atik berbagai hal, senang mencoba-coba — namun, hacker TIDAK merusak.

Seseorang yang desktruktif / senang merusak tidak layak untuk menyandang predikat hacker.

OK, itu berita yang baru. Apa berita yang lama?

Tidak terlalu spesial sih. Saya hanya menemukan blog saya yang lama di Internet Archive. Lalu, saya putuskan untuk memindahkannya ke blog ini.

Ternyata, saya pertama kali ngeblog itu adalah tanggal 3 Januari 2001 🙂

Semua posting di blog lama tersebut akan mulai saya posting di kategori old-blog.

Memang blog itu luar biasa menarik. Tanpa sadar, ternyata sudah 8 tahun saya ngeblog ! Wow… rasanya baru kemarin saya membuat script blog saya sendiri, dan mengetikkan posting pertamanya.

Saya tertawa membaca posting saya tentang kamera digital pertama saya, pada tanggal 7 Maret 2001. Kamera tersebut merk Intel, dan memiliki kapasitas simpan memory sebesar 8 MB. Yak, 8 Megabytes saudara-saudara – BUKAN Gigabytes 😀

Kapasitas cuma secuil segitu bisa ngapain???“, mungkin itu pertanyaan kita semua.
Ternyata, bisa menjadi ratusan buah foto kenangan. Ya, sebagian besar foto-foto di halaman tersebut adalah berasal dari kamera digital yang super cemen ini 🙂
(ya, saking cemennya, bahkan foto-foto tersebut tidak ada metadatanya sama sekali / nama kamera yang digunakan tidak muncul. Pakar IT kita bisa kelabakan kalau menemukan foto-foto ini)

Selain tawa, dengan terharu saya juga menemukan kembali catatan-catatan perkembangan anak-anak saya. Berbagai memori yang sudah mulai terlupakan muncul kembali dengan manis. Inilah harta saya yang paling berharga.
Tanpa blog, semua kenangan itu akan pudar & lenyap seiring dengan berjalannya waktu.

Jadi, mari kita jangan ngehack blog orang lain. Mari kita ngeblog saja yuk. Mari 🙂

Google Killer ? Wolfram Alpha etc

These past few days I’ve been stumbling on articles about Wolfram Alpha. How that it’d be the next search engine. How it’d be the Google killer. And so on.
Unfortunately, it’s not the first time I’ve heard about such claims.

I can’t remember exactly when I was first online on the Internet. Probably 1995. Back at that time, there was only a handful of websites. There was a book claiming to be the Yellow Page of Internet. It was enough to get me around.

Then the internet grew. Very quickly. So I started to utilize Yahoo to find websites of interest. At that time, Yahoo looks like DMOZ.org. Yes, seriously.
Anyway, it was enough for my needs.

But the Internet doesn’t stop growing. Then I realized that I’ll need a different kind of assistance, to enable me to continue utilize it as best as possible.

So I found AltaVista. Lycos. And others. A.k.a “search engines”

It was truly amazing. You can find what you’re looking for from several millions of pages on the Internet within several seconds. Totally unheard of. I became adept at utilizing it. People thought I’m an IT wizard. While actually I was just rather good at asking the right questions to Altavista.

One thing about the Internet is that it’s a free place. Everyone can do anything at anytime. Altavista was not left alone for long — soon others are gunning for its position.

Long story cut short – Yahoo made Google as its search engine, Google became successful, Yahoo cut the deal; but it was too late. Google already became the King of Search Engines.

So now others are gunning Google.
And they’re not always doing it exactly the same way as Google. Which is good.

We’ve heard about Mahalo. About Cuil. Metacrawler, Ask.com, etc.
However, after years, still none managed to unseat Google from its top position. Despite the fact that some are answering questions even better than Google.

For example, do you know that there are search engines that can process questions in natural language form ? Example : Who is the president of Indonesia ?

Awesome 🙂

START is the first web-based answering system, online since Dec 1993. Yes, what Wolfram Alpha trying to achieve is already done by MIT. 15 years ago.
That made START even more impressive.

Have a look around : Who is Sarah Connor ?

It can be biased too 🙂
What is the best programming language ?

It can even lie !
Are you alive ?

Ahem. Okay, back to the topic – with all these wonderful engines, why it’s Google that’s still on the top ?

It’s because performance alone doesn’t ensure success.

You need also :

(1) Marketing : Google is already a very well-known brand. It’s even included in Merriam-Webster dictionary.

Competing with such well-known brand is a significant challenge.

(2) Scalability : Incoming : Can the engine scale to today’s billions of pages out there on the Internet ?

Google could. Not all the others fare as well.

(3) Scalability : Outgoing : Keeping point 2 above in mind – can you reply to people’s questions within / under 1 second ?

Google could. Some others could too – by sacrificing point 2.

(4) Relevancy : Can you read people’s mind ? Oops, let me rephrase that – can you give relevant answers to the questions ?

This is not easy as it might be because Internet keeps changing. It’s a moving target.

A while ago I was using a search engine called GigaBlast.
It was pretty good, and at the time it was even faster than Google.

However, after a while it started giving me irrelevant results. When I checked, it was because of various SEO techniques being deployed. So it got tricked in certain queries.
But Google kept becoming better. So I went back to Google.

Any contender for Google’s seat must be able to compete in the long run. They must not stay the same, because Google is always becoming better.

Yeah, it might be a while before we saw someone killed Google. Actually, they may be absorbed into Google’s collective instead.

But just as two-person start-up managed to shook the search engine world several years ago by creating Google, we may very well witness that again in the next several years. Because on the Internet, nothing is sacred and forever.