Tuesday, January 15, 2013

BlueStacks Review

Just a while ago I heard about an interesting software called BlueStacks which lets you run Android apps on your Windows (or Mac). Before this, I've tried a couple of Android emulators. One from Samsung and the other from the official Android Software Development kit. These emulators are intended to help developers testing their own app. So they don't provide access to Google Play, thus you can not download your favourite apps into the emulators. You can only install an app if you have the installation package (the apk file). I'm sure there are ways to circumvent that, but it's not going to be easy. Furthermore, the performance is sluggish. You'll notice some lag in the GUI responses to your touch (or mouse clicks to be precise). You just can't expect smooth experience using these emulators.

BlueStack, on the other hand, provides access to Google Play (also Amazon's app store, and a couple other app stores which I've never heard of). So it really opens up the possibilities.

BlueStack GUI

Although it doesn't claim to be a full fledge Android emulator, it does spent some effort to make it's GUI feels like an Android. It has the familiar home, back, and menu buttons

Downloading app is not very smooth. Probably due to my intermittent Internet connection, it often got interrupted, and when it does it won't resume. I had to start all over. Nevertheless, I managed to download some game apps in it.

Playing Games

Fruit Ninja is playable using a mouse. The GUI is quite responsive, although not as smooth as when playing in the real device. Note that I'm using a Core 2 Duo CPU -- a rather old processor, but still gets the job done.

However, when I try it on my other PC that has Intel Atom processor, it is unbearably sluggish.

If you try playing Angry Birds, then you start seeing the problem of running Apps on your PC. Without the ability to pinch zoom, you cannot really aim. I guess this problem would disappear if I had a notebook that supports multi-touch.

But the problem becomes really apparent when you try playing Raging Thunder.
Help, how do I turn?
What Do I need BlueStacks for?
So, realistically speaking, there aren't so many use cases for running android apps on your PC/notebook. As someone mentioned to me, you can use it to run WhatsApp using an account which you have registered in your phone before. Running WhatsApp in PC has a benefit since you can use the keyboard so you can chat faster. However, this benefit is not applicable for other instant messaging apps (Line, Facebook Messenger, Yahoo, etc), because they all have PC/Web client. So you can just install them without the need for BlueStacks.

Other than that, I can't think of any use cases for BlueStacks.

What I hate about BlueStacks
Granted I don't see much use of this software, but what really annoys me is that this software is not well-behaved. I see evidences that this software is trying to take root deep in your system.
  • On start up the software always attached itself to the windows task bar. Most software will give options to disable auto start feature, but not this one. 
  • It doesn't give a link for uninstalling. You have to go to Control Panel to do that. 
  • Even after you uninstall it from the Control Panel, it won't uninstall cleanly. Its files are still in Program Files folder. Also, It still has two services that starts automatically when your computer boots up. I had to disable it manually.

I thought I had totally get rid of BlueStacks from my system. I was wrong. It still has a program named HD-Agent.exe which starts automatically at boot time. I had to remove this manually from Windows registry. 

Don't waste you time. Stay away from this. In the meantime, Android apps should stay in real Android devices.

Tuesday, January 1, 2013

Making My First Android App – part 2

The Server
I started with the Server side first, because this is the area I’m most comfortable with. I decided to use Google App Engine as the server platform. This is a cloud service which takes care of all the gory technical details of setting up a server environment such as installation, operation, high availability, scalability, etc. All we need to do is develop the logic. For that, GAE support 3 different languages: Python, Java, & Go. I definitely chose Java, as it is my native language (I was born, raised and live in the island of Java).

The best part of GAE is that it is free for low traffic. This means that you can develop the server app without paying a dime to Google. In fact, you can deploy it for production use and still not paying anything as long as the traffic is still below certain limit. Just pay as you grow.

The Client
Lucky for me, Android app development is also based on Java. Thus learning the Software Development Kit (SDK) is not the most difficult part for me.  The difficult part is designing the GUI. I’m not at all experienced in designed a software with GUI. Whereas in server development you usually deal with performance, memory efficiency, scalability and the likes, here you need to put more emphasis on intuitiveness and handling for unpredicted user behavior.

Another challenge is the fact that Android devices comes in various sized from tiny handset to wide screen tablets. Android SDK provides the framework to work with multiple screen sizes, but the developer still needs to spend some effort ensure that the GUI looks good in all screen sizes. For my particular game, I ended up with two different layouts: one for small to medium screen and another for larger screens.
Even for simple game that does not rely on graphics, designing a visually pleasing GUI can still be time consuming.  I rely on beautiful and free icons from http://icons.mysitemyway.com/ to help spice up the app. Even then, I still need to spend a significant part of development time Photoshopping (I used GIMP actually).

 The Dictionary
Finding a dictionary/word list is one of the last things on my to-do list, since I thought it would be easy to find one. Apparently not.  Scrabble has several official word lists (depending on where you play). They’re called OWL, TWL, SOWPOD etc. The problem is they’re all copyrighted. It seems that many of the word games available in the Internet or Android simply uses one of those lists without license.  And some of them apparently has received not-so-friendly letters from Hasbro / Mattel (Scrabble’s copyright owners) lawyers.

Thus, I decided to look for an alternative. For English, I found English Open Word List (EOWL) which is compiled by Ken Loge (http://dreamsteep.com/projects/the-english-open-word-list.html) for the exact purpose of providing free alternative word list for word games or spell checkers. It’s not perfect – many valid words such as plural forms, past forms are missing. But it’s the best option there is.
With Bahasa Indonesia, things got a bit more difficult. I couldn’t find a single comprehensive word list. I had to resort to Wiktionary (http://id.wiktionary.org). It’s quite comprehensive although still far from complete. The problem is it doesn’t provide the word list in an easily downloadable format. I had to write a script to crawl the site to extract the word list.

Publishing the App
After everything is ready, it’s time to publish the App via Google Play. Registering is almost as easy as it gets.  You need to pay 25 USD to Google to get yourself registered as Developer. I’m not 100% sure, but I think it’s a one-time payment and you don’t need to pay more for uploading more apps. Definitely cheaper from registering an app to Apple’s iTune (which costs 100 USD, CMIIMW ). Google also does not require any certification process for your app. This means your app is ready to be downloaded almost immediately (read: few hours).

So it goes, after 2 months of part time development  (I still need to do my day job, which pays the bill) and several liters of lattes, “Words against the World” is finally available for download.

Wednesday, December 26, 2012

Making My First Android App - Part 1

I’ve got to admit, when it comes to smartphones, I prefer green robots than partially eaten apples. Firstly, it’s cheaper. Secondly, and more importantly, it embraces an open architecture. The later is not limited to the open source nature of the Android operating system, but also the fact that Google gives more freedom and fewer barriers for developing applications on their platform. I think this is the reason Android now has almost 1 million apps in Google Play store.

Okay, one million apps sounds impressive. But if you look closer, most of the apps are not impressive at all. In fact, most of them are simply junks. This is when an epiphany came to me: if anybody can make junk, why can’t I make one too. Perhaps even a slightly better junk. So here I am chronicling my effort in making my first app.

The Idea
The difficult part is finding an idea for the app. With one million apps out there, there is a good chance that someone has already thought of your idea. So I give up trying to find an original idea. I decided to make a very simple word game. The premise of the game is as simple as it gets. The player is given a set of 8 not-so-randomly selected letters. Within a limited time, the player must construct as many words as she can using those letters. Like Scrabble, but without the board. 

To differentiate a bit from the crowd of word games, I decided to include these features:
·         Synchronized game play, meaning that everybody will be playing the same set of letters. At the end of the game, the scores are collected and ranked. Thus essentially everyone is competing against everyone else.
·         Support for English and Bahasa Indonesia. This is to attract more players (especially kids) from my home country.

The Name
Finding the right name for your app is also not as easy as it sounds. At first I name it Scrambler. But turns out there is already a word game with that name. Finally I ended up with “Words against the World”, which is a tongue-in-cheek reference to a popular Scrabble-like game called “Words with Friends”. 

With the idea set, the following requirements are identified
  • The Client application: This is the Android app that is downloaded by users from Google Play and installed in their phone. 
  • The Server application: This is the web service which is responsible for generating the set of letters and collecting the results. It runs almost transparently from users’ point of view
  • The dictionary: The list of valid words in English and Bahasa Indonesia.
I’ll talk a bit more details about each of the above in my next posting. In the mean time, if you want to take a look at the final result please visit “Words against the World” page in Google Play: https://play.google.com/store/apps/details?id=rz.scrambler.app

Sunday, February 8, 2009

Search Engine for Dummies - part 1

What would Internet be without search engines? You have a humongous amount of data, but without a tool to find what you need, you would be at lost.

Today you probably take it for granted that Google is the most popular search engine. But that wasn't always the case. If you've been around in the Internet long enough (i.e. a decade or more), you'd probably remember those days before Google become household name. Before the turn of the new millennium, the most popular search engine was Altavista.

Back than Altavista was considered cutting-edge and the pioneer of a truly usable Internet search engine. It was one of the top web destinations. But by early 2000's. It's popularity quickly dropped due to the arrival of a new kid on the block: the venerable Google.

When Google entered the search engine market, many people thought the market was already saturated. There were already a bunch of search engines (You may recall names such as Lycos, Magellan, InfoSeek, Excite, etc). But Google proved them wrong. It rose steadily in prominence, and soon enough it grasped the top spot and remained there ever since.

So how does Google do it? And where did Altavista and those other search engines fail?

All search engines begin with a web crawler. It is a piece of software which automatically crawls the web, collecting information about every page it encounters. This data is then stored and indexed in the search engine's database, making it available for search queries from users.

The quality of a search engine from user's point of view depends on the relevance of the result set it gives back based on the search term. The primary difference between old generation search engines (Altavista et al) and newer generation ones is the method to determine the most relevant web pages to be put in the result set.

Old search engines' method is based on the textual content of the web pages. In this method, a page's relevance to a search term is calculated based on how many times that search term occurs in the page. For example, if you search for "Nuclear Weapon", the search engine would probably return a page where this term occurs multiple times at the top of the search result.

That sounds reasonable, right? But it turns out that this simple method has serious flaws. Supposed you create a page which contains nothing but the term "Nuclear Weapon" repeated a dozen times. This page would rank high in the result set, despite the fact that it's a useless page. This is the reason why results returned using this method typically have low quality. How do you improve the quality then?

to be continued...

How Big is Your Internet Footprints?

A while ago, for one reason or another I remembered a good old friend from my college years in Illiois, US which I haven't heard for more than five years. We now lives at the opposite ends of the earth. He stayed in the US after graduating, while I went back to my home country, Indonesia.

Time passed, life got me busy, hence I no longer kept in touch with him. His old email was no longer active and we didn't have many mutual friends. So when I wanted to find out news about him, I was at lost. What do you do then when you're in a situation like this?

Well, if you use Facebook (or any other social networking sites), most likely that would be the first place to go. That I did. But nop, he wasn't there. The next logical thing would be to go to uncle Google. I did that too. Voila, after a few searches I found some info about him. Now I know that instead of Facebook he uses LinkedIn. I found out know where he works, his gmail email address, and things he did for college project assigments. Search a little more, I found out that last year he had married his longtime girlfriend (they hooked up since the college days. Dude, what took you so long...). That's not it, I even found that just recently, they had a baby daughter. Had I searched deeper, probably I could find his home address, phone number, and his shoe number (ok, probably not that one).

Pretty scary, huh?! His personal information is all exposed on the Internet. In the old days, probably you need to be a cop or a private investigator to obtain that kind of information. Now, a Google skill is all you need.

What about yourself? If you have used Internet for a while and you have been active (use a lot of web services, join social networks, forum discussions, etc), chances are your personal information are all over the web. You may think that some of the websites that you use have somehow violated your privacy. But the fact is, in most cases it is you who expose to the world about yourself. Just think of what others can see in your profile in your favorite social network.

I heard now it's not uncommon for employers to find out as much as they can about their prospective employees via Internet. The Internet can tell them what you don't mention in your CV. It's easier for the employer to Google for your information than ask your reference giver. If you have been behaving "nicely", than you have nothing to worry about. But if you've been "bad", well, your Internet profile is like a criminal record which is difficult to erase. Perhaps now you should be more careful about what kind of footprint you left in the Internet. In my case, it's already to late, my footprints are all over the place....

Tuesday, November 18, 2008

Mobile TV Wish List

Mobile-TV, especially DVB-H is starting to gain traction nowadays. Dozens of commercial & trial services have been launched all over the world. Nevertheless, I still have my doubts whether this will actually take off or not. There are several issues which I find not very appealing. Then there are also a couple of things which I would like to have on my mobile TV. Thus, here is my wish list regarding this mobile TV thing:

1. More flexibility on supported subscription model
In subscription model supported by Nokia's solution (which in turn is based on OMA BCAST DRM Profile), subscription process is fully controlled by subscribers. I.e. a subscriber can start, cancel, change subscription at (almost) any time. This is actually good from the subscriber's point of view since they have the freedom over the use of the service. However in a few cases, The service provider (especially when the service provider is more like a traditional cable/satellite TV broadcaster instead of a mobile operator) may prefer typical subscription model where Service provider can “push” and “cancel” subscription centrally. They may also want to limit subscriber’s ability to buy/cancel/change subscription on their own.

2. Widespread adoption of SPP standards
Currently, the available open standard for the Service Protection & Purchase (SPP) is OMA BCAST DRM Profile. The issue is that I still don't see widespread adoption of the standard, resulting in lack of support from terminal vendors. To date it seems that only Nokia, Samsung, & LG(?) that produces compatible handsets. Even viewer vendors provide the complying head-end equipments. Most CAS vendors still provide proprietary OSF-based systems.

3. Variety of Terminal types
Only few varieties of the terminals, especially those that supports encrypted channels are available in the market. More diverse terminal types, not just handphone are definitely needed. They have to be affordable too.

4. Less limitation on user experience
In all the devices that I have seen, user cannot record TV broadcast or send the output to another device. This limit is not due technical issues, but intended limitation. I think users should be liberated just like in the typical broadcast/cable TV. I have a feeling this lacking of recording capability is actually a desired feature demanded by content rights owner.

5. Free mobile TV services
One way to guarantee quick market adoption is to offer free mobile TV services. Then we can forget about SPP standards, forget the lack of terminal availability. Service providers should think of other ways to get revenue (advertisement, interactivity). You wish!!!

Sunday, September 14, 2008

TTL of Multicast Packets in Linux

One of the key enabling technology for Mobile TV is IP Multicasting. IP Multicast allows the distribution of streaming multimedia content with efficient bandwidth utilization.

So it was, during a DVB-H implementation project, one of the software tool that I had to develop is called a "Multicast Proxy". What the tool does basically is listen to a multicast address, and forward all the received packets to a different multicast address. Java came to the rescue. J2SE comes with java.net.MulticastSocket class which makes receiving and sending multicast packets very simple to do.

Typically multicast and broadcast packets are treated with cautions by the OS. This is because both carry the risk of flooding the network. Hence the OS usually set the TTL (Time To Live) attribute of the those packets to 1. This attribute defines the maximum number of hops the packets can go through (1 means the packet can only be received in originating LAN). However, in my network I needed a larger TTL, since the packets must go through several hops. Thankfully the MulticastSocket class already provides a method called setTimeToLive. In my notebook (under Windows), it worked fine and everytyhing was hunky-dory.

Yet, as is always the case, problem occured the code was deployed to the production machine which was running on Ubuntu. Everything seemed to be working except no packets reached the receiving hosts. After banging my head against the wall for a while, I found that the packets can only be received in the same LAN segment. Apparently the TTL of those packets was still 1. Somehow the OS ignores the TTL setting from the java application. I needed to bang my head for another while until I found the solution by Googling.

Luckily, Some linux systems provide a way to configure the TTL of the IP packets using iptables command (works on Linux kernel 2.4 - 2.6, CMIIMW). In my case I used the following command:

iptables -t mangle -A OUTPUT -j TTL --ttl-set 32

The above line sets the TTL for all outgoing IP packets to 32. I know I should've set the TTL only for outgoing Multicast packets only, but I'm too lazy to dig deeper into iptables manual. Besides, my problem is now solved. Here's a tutorial on iptables if you're interested to learn (a lot!) more.