Tuesday, October 26, 2010

Is the iPhone and "walled garden" approach really that bad?

I am a software developer, and as such, I have found mobile phones a great new market to focus attention on. Naturally I started developing for what I had, a T-Mobile G1 running Android. When I first got the phone, I wanted to write a Last.fm scrobbling client, but I didn't understand the whole SDK, particularly the API calls needed for such a program. As it turns out it's a fairly advanced application to write. After some time of getting nowhere, ScrobbleDroid showed up in the Market, then some time later A Simple Last.fm Scrobbler and finally the official Last.fm application. By that time I had already abandoned my efforts since I was beat to the market. What's great, is all 3 of those applications are not just free, they are open source. I could view the source code and figure out where I went wrong, which has been a huge help in what I am currently working on.

Next I decided to write an unknown call blocker. Monitoring incoming calls, and if the number was unknown or blocked it would send the call immediately to voicemail. This could be further expanded by checking numbers against an online known spammer registry. I was very disappointed then to learn that the Android SDK which supports outgoing call interception does not support intercepting incoming calls. Your application cannot prevent the phone from ringing on an incoming call.

After those two projects failed to materialise, I went back to the drawing board, but at the rate new applications were pouring into the Market I couldn't think of an original idea that really filled a gap in the Android software stack (there weren't many of them). So I continued to study the SDK and continued to think about a new app, but never wrote any code. I even would periodically check out what's cool on the iPhone for inspiration, but I never could find any cool iPhone apps that really did anything Android or an Android app didn't already do better. They were just sound makers or stupid games, and they weren't open source, in fact people were charging $1.49 - $4.99 for completely pointless and stupid software.

Finally, I had my idea, and not just 1, but 5! Two of them are not original, just a different, better approach or extra features. The first was a Phase 10 (card game) scoring application, which beats the others on the market by actually calculating score (simple I know), having a better workflow and automatically sorting the players by phase and score.

My second application was a wallpaper slideshow. It lets you select a photo gallery on your phone and will cycle through the images at a user defined interval as the phones wallpaper. It crops, resizes and rotates as needed to fill your screen.

Next I did a Starbucks card manager that lets you select a card to display as a desktop widget, so you can quickly see your balance at a glance from your home screen.

Following that I started working on another homescreen widget, to show your PS3 player score and trophies.

And finally, a Dynamic Playlist application that monitors what you listen to using your stock music player and adds recommendations from Last.fm to keep a cohesive playlist running instead of shuffle all or party shuffle which would randomly pick music from different genres. Currently, I am adding in support for popular third-party players.

A few things recently occurred to me. None of these applications would even be possible on an iPhone. First, Phase 10 Score on iOS wouldn't allow me to keep the same workflow. iOS only lets you set a single static photo as a wallpaper, it doesn't have a "live wallpapers" concept. Background applications are only supported on iOS4 and Wallpaper Slideshow would not fall into one of the seven allowable background APIs. iOS has no widgets that can be placed on your homescreen, so Starbucks Card Manager and PS3 Trophies Widget are out. iOS has no content providers and doesn't allow you to bind to other application services so I couldn't write a Dynamic Playlist plugin for iTunes. To this day you still can't even live scrobble your iTunes to Last.fm even with the official application, it requires syncing to iTunes running on your computer.

The Android emulator is great, but if I want to test my applications on one of my devices, I simply connect it to the debugger and push it onto the device. 10 seconds later it is up and running. I can then put it through an automated stress test and memory profiler to make sure it won't crash on various hardware. I don't have to pay $99 and wait 1 month for the application to be approved by Apple to run it on my own device.

If I want to test my application on any specific hardware, I simply send someone the installer. This is so simple on Android as I can send it to their Gmail account which is pushed directly to their phone. The user simply clicks 'Install' right from Gmail on their Android phone and I can even have it send me dumps and stack traces directly. Again, no paying Apple or Google for this privilege and no approval process or waiting period.

When it comes time to publish, a single $25 developer certificate covers ALL of my applications, and my applications are available to download from the Android Market in 5-10 minutes, and pushed to all mirrors in all supported markets in less than 24 hours.

The Android SDK, developer tools and emulator run on ANY computer, not just Apples OS X, and you can upload your applications to the Android Market from ANY computer. You don't have to borrow a friends Mac to test or upload your applications.

So from this developers perspective, the iPhone and walled garden approach simply does not work, and there is next to no chance that I will ever take the initiative to publish an application to iOS. The iOS platform and Apple Store are just too restrictive to develop creative applications, and I don't want to spend several months developing an application just to have it repeatedly rejected by Apple before I can even test on my own devices.

From what I can gather, I am not alone in this thinking. Android Market now has over 100,000 applications, is selling faster and iPhone and as more users leave their iPhones behind and jump ship to Android, more and more developers no longer wish to deal with the headaches of iOS development. So, Is the iPhone and "walled garden" approach really that bad? YES.

Sunday, October 10, 2010

How to secure your Ubuntu Linux desktop

A big reason a lot of people install Linux is for the extra security. While Ubuntu is a pretty secure operating system, new exploits and viruses are found every day. There are still a few simple steps you can take to secure your computer against intruders and internet exploits.

Anti-Virus is a pretty controversial topic on Linux. The popular belief is that Linux is by design immune to virues. Even though your Linux computer may not be infected, you can still host virus infected files. If you are downloading and sharing files via P2P, email or across your network with other Windows computers, anti-virus is essential. The method we take here will not consume vast amounts of system resources that slow your computer down, as is the case with most security suites on Microsoft Windows.

Regardless of operating system any computer connected to the internet should:

1) Install security updates automatically
2) Configure a firewall with a minimal set of rules
3) Install anti-virus software with updated virus definitions and regular scans
4) Protect their browser from XSS and link jacking exploits

This video will show you how to set up all of the above, simply, using only the Linux GUI. No terminal is needed.



This just scratches the surface of securing Ubuntu. Check back later for more advanced topics such as: port scan detection, brute force detection, application profiles, logging and more.

Thursday, October 7, 2010

Getting ADB (Android Debugger) to work on Ubuntu 10.04+

In my spare time I enjoy writing Android applications and exploring the vast Android SDK. Though I have not yet published any apps to the Market, I have a few going through final QA testing which will be released soon.

Often times, I will need to get an adb shell, watch the logfiles on the phone, or want push my apps to my devices for testing or debugging on a real device. I do most of my coding in my spare time on my laptop which was running Ubuntu 10.04, and any time I tried to open adb it wouldn't connect to the device. I would just see "????????" as the serial number and "no permissions" as the device name. As a result, I have been having to use my workstation which runs Ubuntu 9.10 for all of my debugging.

I upgraded early to Ubuntu 10.10 as I often like to test the latest Ubuntu betas and release candidates. I was also hoping the latest release would fix my issue, which unfortunately, was not the case. So I started out on a quest to get to the bottom of things.

It didn't take long to discover that it's a permissions issue, and the recommended fix I found repeatedly was to kill adb server and restart it as root. I quickly tested that and surely it worked, however that doesn't work so well for starting it via Eclipse and ADT and I never want to run a program as root without good reason.

It works in 9.10, it's just a permissions issue, so I thought a quick change to the new hal rules in Ubuntu were in order, but I couldn't find any such documentation on the workings of hal and its permissions. Lots of digging around and I found a comment on XDA with a udev rule. Opened up the terminal and typed 'lsusb -v | grep 0bb4' and sure enough that was the correct vendor id for my HTC Evo.

So here are the steps I took to get it working:

echo "SUBSYSTEM==\"usb\", SYSFS{idVendor}==\"0bb4\", MODE=\"0666\"" | sudo tee /etc/udev/rules.d/51-android.rules
sudo restart udev

I hope that helps you. If you need to find your devices vendor id you can try this:
$ sudo lsusb -v | grep -C5 Android 2>/dev/null
  bMaxPacketSize0        64
  idVendor           0x0bb4 High Tech Computer Corp.
  idProduct          0x0c8d 
  bcdDevice            2.26
  iManufacturer           1 HTC
  iProduct                2 Android Phone
  iSerial                 3 HT05JHL0XXXX
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2

P.S. Please feel free to add your device and vendor id in the comments to save others some trouble.