Feb 10, 2012

Hindi on an Android Phone

This is just an app I am developing on the side. It uses Devanagari scripts to render the text, rather than displaying images as most of the similar apps in the Android Markets do.

Part 1 of the problem was how to load the hindi font in the code and get the display to render it. If you try this on a phone without Hindi support - which is the vast majority of the phones out there, then all you see is squares instead of the text.



This was pretty simple. If you want to load a custom font, this is what you do :


  1. Get the specific font you want to bundle with your application. Lets call it Hindi.ttf
  2. Put it in your project under the "assets/fonts" folder. You will need to create the folder 'fonts'. Not necessary to have the exact name, but I use it as it denotes what the files int the folder are. 
  3. Now you need to tweak your code a bit as you need to load the font before you render the text. This is quite simple - use something like the following :


//Font work
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Hindi.ttf");
// Get the UI element handles
mText = (TextView)findViewById(R.id.body_text);
// Set the title and read the file for the text
mText.setText(readRawTxt(pName));
mText.setMovementMethod(new ScrollingMovementMethod());
mText.setTypeface(tf); // setting font for the text. 
 Now when you run the program, you will get the fonts loaded and rendered, which brings use to Part 2 of the problem.

Part 2 of the problem is that the maatras are not getting aligned properly. For this I have so far not been able to figure out how to fix it. If you know , let me know. If I get to know about it, I will update this post.



Tips on purchasing an Android Phone

Here are some tips which I think you may find useful when you are looking to buy an Android phone.

Unlike the iPhone , the Android mobile space has a huge number of variants, which is good and bad at the same time. Good - cause you get variety ( though the current designs all seem to be very similar) , and Bad as you cant figure out what to buy !

My tips below will be looking beyond the advertized features of the phone. So, you will have to read the specifications of the phone you are trying to get and see if it fits for you!

Tip#0 : Wait for ICS

ICS is the next version of Android ( Version 4.0 ) but it is still not available in the market. So, if you can wait then wait for the phones with the new versions to be available.

Android 4.0


Tip#1 : Check for available custom ROMs

When you buy an Android phone from a manufacturer, you will end up with a system with a lot of customizations from the manufacturer. Its like how you go and buy a laptop and get all the preinstalled software. Now, you may actually want this, in which case you can ignore this tip. But, you may also be thinking that this is a lot of bloatware. Not only does it reduce the amount of space that you have available in the phone, it also causes your battery to drain much faster and slows down the phone.

So, have a look at the mods available in the market. I used the Cyanogenmod for installing onto my phone:

Samsung Galaxy ACE running CyanogenMOD7


Some sites you can refer to :
1. Cyanogenmod
2. MIUI
3. XDA Developers

Please note : by flashing the new OS you will void any guarantee from the manufacturer and also you have a risk of bricking your phone. Take all backups and then take them again. Use recovery mechanisms to take backup of the actual OS.

Tip#2 : Check the battery

Don't go by the claims from the manufacturers about the uptime. Its usually by turning off all the features and on a stock device. It falls flat on the face in actual use - the gap is quite large. The one thing you can do now is to look at the mAh rating on the device. Minimally it should be above 1500mAh for lasting around a day. The more the better it is.

Tip#3 : Check the internal memory

The advertisements will be pointing out that you can get upto 32GB of memory by using a SD Card. Ignore that. It is true, but it is not what you are looking at. You are looking at the internal memory present on the device. Look for things which are atleast 2 GB if not more.

Why ? Because most of the apps to function properly need to use the internal memory. Some can function only if they are installed in that part ( e.g. enterprise software ) and almost all require the memory to store user related data. The external SD card is where you store the pictures/videos/songs etc  ( and can move some apps to that area also)

Tip#4 : Now look at other specs
Now you are free to look at the other specs that are available on the phone which you may like. But if you neglect the above 4 tips, i am pretty sure you will end up wishing you hadn't.


Feb 5, 2012

Hard Re-setting Galaxy Ace

Recently, I had a bit of a problem with my phone - the Samsung Galaxy Ace. Apart from being pretty annoyed with Samsung for giving next to no internal memory (150MB only), the phone was eating up battery quite fast and becoming quite slow. So , I decided to hard reset it. Problem is - the information about android phones is too much in plenty and scattered all over the blogs. So, here are the ways you can do it:

1. Enter Recovery Mode
Press the home key and the power key simultaneously. 
When you see the Samsung logo , let go and you get into recovery mode.

2. From the dial pad
Enter the following key strokes:
*2767*3855#

3. From the phone itself.
Go to settings->Privacy Settings -> Factory data reset

Jan 1, 2012

Happy New Year !

Happy New Year to you all ! 

As the new year begins, I look back at the last year and can't help but be amazed at how much was squeezed in that one year. What a year it was . 2011. So many things happened on a global scale that things happening to your life seemed to be quite dwarfed. A quick recall...

Personal Front

On the personal front, not much to report. Life going on as usual. Working in McAfee and working on tailoring solutions to various partners on the mobile front. I guess I am a household name in people interacting with the partner world in McAfee :D

One place though I was able to tick off from my list of places to go to - Amritsar's Golden Temple.

Golden Temple


Biking

Not a good year for my biking. Hardly any rides worth mentioning. We had the BN annual meet at Goa. This year we don't want to have it in the places we already had the meets on.

Breakfast ride near Gurgaon


The Highs

A couple of memorable events stood out this year.

India won the World Cup! Yeah ! I am not a big cricket buff, but then, you dont need to be a buff - its a religion. Now I hope Sachin can get his 100th 100 this year.

The biggest wedding on the planet - of British royalty - happened. About 2 billion people ( one out of every 3 people ) watched the live event.

Gaming
Big year for gaming. Lots of good titles. However, I don't play everything available, and also I am limited to the PC so, heres a short list.

World of Warcraft raid. 

World of Warcraft continued to hold its sway in the online gaming world. I had started a guild in the end of 2010, which finally disbanded in early 2011 due to efforts of an individual called Easha R. Swamy. Apparently, I am not a good guild master, so he forced me to give the guild master over to him, after which he just squandered away all good will and killed of the guild. Next effort was around the year end but this time i wisely stayed away from any role of responsibility in the guild - which was as well as office work takes up a huge chunk of my time. Finally a guild was formed on the Horde side on a server, and then the guild moved to the Alliance side on another server ( You can join the facebook group if you are interested). I think the downfall of all the Indian endeavors is the politics and favoritism that plague us in any sector.

Skyrim was launched, which became an amazing experience with its open worlds and fighting dragons. However, mid-way across i lost interest as it is just too vast and my time is quite limited.

Diablo 3 : I don't know when the game will be launched. But , somehow I got into the beta, and had a blast playing up to level 13 ( which is the level cap in beta). As the game is getting ready for launch, the characters keep getting reset and you need to keep start playing from 0. I just cant wait for this game to be released.

Star Wars : The old republic : This is a new MMO from Bioware and Lucas arts set in the world of Star Craft about a few millenia before the movies. I got lucky, and my secret santa clause gifted me a 90 day subscription. I find myself playing more of this game now than WoW cause its new and the story telling is really epic. Right now i am playin as a Jedi Sentiniel - who can wield 2 light sabers at the same time :)

I tried a few other games also like DeadSpace, Crysis 2 etc, but FPS is not my cup of tea specially when all the action happens in closed spaces. Crysis 2 was specially a big let down. Apart from the opening cinematics, the game was quite stupid. You are asked to meet someone at a location, and when you get there after being the death incarnate, you get to know that person has moved somewhere else and has asked to meet there. And this kept looping, till i lost interest.

Celebrities & Death

So many celebrities died that its not even funny. A list can be found on Wikipedia at http://en.wikipedia.org/wiki/Deaths_in_2011

Steve Jobs, an icon for many - either of adoration or hate, passed on. I think this effect will be felt through the world. The last decade had apple featuring prominently in pushing the boundaries of usable gadgets, lead by the iPod. I don't think that today's generation will ever know the pains of using tape-recorders, which is not a big loss to be frank.

Osama Bin Laden was killed in an American mission on foreign soil. I think the one thing I found quite interesting was the stealth copter that crashed into the compound.

Kim Jong of North Korea died. The supreme leader was not as supreme as he thought.

India had its share of prominent people passing off:
Dev Anand died at the ripe age of 88. He was still going strong in his late years, and I think he had a great life.

Shammi Kapoor , another iconic actor breathed his last. Tareef karoun kya uski - indeed ! I think I will miss the antics of Shammi Kapoor more than Dev Anand.

Jagjit Singh the ghazal maestro passed away. I get nostalgic, remembering playing the tapes of his and Chitras and humming along with the music while studying ( any analytical task i do, it helps me to have some music in the background). Oh, the random player just switched to a track by Jagjit - Hoshwaalon Ko Khabar Kya.

Mario Miranda, another great person, a cartoonist also passed away. He had his own distinct style, which cannot be copied.

Nawab of Pataudi breathed his last this year. The one eyed Tiger of Indian cricket will always be remembered by Cricket fans - of which there are plenty in India.

Disasters

These can be man made of natural. Man made disasters are the slowdown in economy, and the fall in rupee. Man, is the Indian government incompetent or what ?

The disaster that hogged the most deadlines is of course the earthquake in Japan ( and that country does not get a break - there was another one this morning). That lead to widespread Tsunamis and the meltdown of the nuclear plant. On the bright side ( if you are a sci-fi buff), there is now more probability of having a real Godzilla.

Damn ! That was a happening year. Now, lets see what 2012 will have in store for us ! Which are the 2011 events that you remember most clearly ?

Dec 12, 2011

Making Android Better

You may have read my last rant against Android. After posting that I got into a more constructive mode and started thing how the OS can be improved. This is based on the 2.x (Gingerbread) version of the Android OS as I do not have access to a 4.x version (Ice Cream Sandwich).

I have also defined ownership to Google or the Manufacturer as they need to work it out. Unlike apple's iOS, Android has much more complexity as it has to synergize with multiple vendors and a plethora of hardware.

1. Get rid of the internal memory concept. 

At this point, Android phones act like the older phone OSs which assumed a small internal memory and user expandable SD card slots to keep data. The problem with this approach is that with the Android market, users have the option to download hundreds of applications. But the internal memory limit means that you can hardly download more than 10 apps before the phone starts to cry out about issues with the memory being full.

Since the SD cards are cheap now, we can argue that a manufacturer sourcing a large number of memory chips ( without the plastic casing etc to put in the phone) should be able to get it quite cheap. Even a 2GB internal memory will do wonders. Most vendors provide an extra SD card anyways with your purchase, so to me it makes more sense that they have the memory as part of the device. If required, they can keep an additional SD card slot also for extra brownie points.

Ownership : Google, Manufacturers.

2. Make sure that the default apps do not crash. 

If there are some 3rd party apps that you download from the app store that crash, you expect it. But when the installed apps start crashing - that is just sloppiness. I have seen multiple crash on the default apps - most of them on the Android market application. This should not be happening.

Ownership : Google

3. Make it an easy way to reach the top of the screen. 

Due to the screen size limitations of the phone, many of the applications display content in a list view ( e.g. Twitter, Facebook etc). Android does not have an easy way to scroll up , so if I want to see the topmost tweet in a list of 100, i have to swipe up multiple times.

I have a solution : implement a long-press on the top bar which will make the currently active app jump to the top of the view.

Ownership : Google

4. Battery longevity. 

The battery life of an Android device is crap. The Samsung Galaxy ACE that I have was hardly lasting a day in my initial usage. If a call comes and lasts an hour ( my conf calls go on for longer than that) then I need to immidiately plug it in to charge even now.

Some ways are there of switching off Wifi/data etc - but then why would you want to buy a smartphone ?

Juice Defender is a great 3rd party software which helps out in the batter management. I strongly recommend that Google buy this company and integrate the battery savings into the core part of the OS.

Manufacturers also need to look at better battery options - either as default , or in worst case as available battery packs. My phone has a 1350mA capacity battery. Why cant it have a 2500mA battery pack ?

Ownership : Google, Manufacturers

5. Define different hardware profiles.

One of the most irritating thing about Android devices is that they promise a lot in terms of features, but when it comes to actually running them, they are really bad. For example, live wallpapers are sooo cool, but they suck up the mobile's performance. Since nowadays manufacturers are coming out with all sorts of Android based devices - from low end to high end phones, it makes sense to have different hardware profiles for different hardware levels. This will tie into the Android Market, so that you can only download and install applications which adhere to the settings on your phone.

Ownership : Google, Manufacturer

6. Clean up the Android Market

The market is in a mess. Its hard to find anything. Search will list down a lot of stupid apps which you do not want and going through the lists is a pain.

Google needs to curate the applications submitted and have a guideline for minimum quality. Like Apple did, they should also disallow multiple frivolous apps. Its not a number game to see which appstore has more downloads, but it should be a quality game to see which appstore has better apps.

Also, i think that allowing manufacutrers, telcos etc having their own app stores is killing the user experience. This was a pretty bad move on Google's part. There should just be one android market not multiple ones on the phone. And even if you do have multiple markets, then the logins should be the same.

Ownership : Google, Manufacturer

Dec 1, 2011

I dislike Android phones now

I have started to dislike using the Android phones.Sure there are a lot of people who swear by it - but I am getting hit by issues which I did not have to contend with in the last couple of years that I was using the iPhone. Here are just a few of those.

Why is it that the phone manufacturers do not learn from apple and provide substantial internal storage ? Here I got a very stupid error which wants me to uninstall applications. WTF ! Why have an Android market if you cannot even install programs on the device ? The internal memory of the device is just around the 200MB mark - its a joke.

I

Also keep getting frequent crashes. I understand if there is a crash due to a 3rd party application - but this crash occurred in the android market application !


And now the straw that breaks the camel's back. See the message underlined in red. The damn device rejected an incoming SMS ! WTH !

The phone manufacturers are still taking the consumers for a ride. I am also guilty of being a gullible party - but this is also to do with my friends who let me down in guiding for a new phone. They did not point out these issues - and now when I come across this - they say its there.

Unfortunately I am stuck with this phone for sometime till the price of the 4S comes down in India or I get it from a friend. This is quite frustrating. Simple common sense has not been used by the Android team and the Android vendors.

Sometimes, in interviews people ask what can be changed for a product. If someone asks me about Android - well, they will get an ear full. 

Nov 27, 2011

Show me the apps !


Somedays, i just love the new interface in Ubuntu unity. This is one of them. The 'Windows'+ W key combination shows me all the running apps ont he desktop neatly arranged. Then just click on the app you want to go to. This is much better than using the Alt+Tab combination to cycle through applications if you have many of them open.

Nov 13, 2011

missing org.eclipse.wst.sse.core

If you get this error with Eclipse on ubuntu, this is how you solve it. This is because of faulty default apt-get repository for Eclipse. You will most likely get this error when you are trying to install the ADT for Android development.
Help -> Install New Software ... 

There add the following source
http://download.eclipse.org/releases/indigo/

My current Eclipse install is indigo - which you can find from the splashscreen. To make sure that the URL exists , just open the url you think you should be using in Firefox and it should not give a 404 error.

Now you should be good to go. Go to the 'Install Software..' and try installing the ADT plug-in again - it should work now.

/Rant
Linux is supposed  to be a dev friendly environment, but the amount of time I spend getting things to work after every new upgrade to the system is insane. No wonders Linux is still not capturing the market ( apart from being a lousy platform for games).

Oct 26, 2011

Happy Diwali !

Have A Great Time this Diwali !

This Diwali, may you be blessed with 
Good Fortune as long as Ganeshji's trunk, 
Wealth and Prosperity as big as his stomach, 
Happiness as sweet as his Laddoos and
Your Troubles be as small as his mouse ! 

Oct 19, 2011

Review : Samsung Galaxy Ace

Most of my friends know that I am a big fan of iPhone. So it may come as somewhat of a surprise that I ended up getting an Android phone. The Samsung Galaxy Ace to be exact. 

Lock screen on my Android

One of the main factors for going in for this phone was the cost - at a bit over 13K INR it is almost a third cheaper than the iPhone4s which is still not available in stores in India. Another factor was that I wanted to try out Android programming. 

The most often asked question that I get from people is how do I find the Android OS and the phone after having used the iPhone 3G over the last 3 years. Here is my review. 

My main criteria in looking for a new phone was as follows : 
- Android 2.3 as that is the current latest OS for phones available ( Samsung just launched with aOS4, but it is not yet available in India). 
- Within 15k INR
- Have a camera with a flash
- Be able to create a wifi-hotspot 

The ACE in my research came out to be good on all counts.

Now onto the actual review broken into categories. Comparisons are based on my experience with iOS4 on iPhone3G, iOS5 on my iPad, and Android OS 2.3.4 on the Galaxy ACE.

Notifications
Notifications on the Android rock ! The multitasking and background processing is phenomenal. Whether you are on gtalk, or twitter or facebook, any updates that you get are instantly displayed on the top notification bar. iOS5, with its new shiny notification system does not match up to Android in terms of notifications.

User Experience. 
Android still needs to go a long way in terms of user experience to match up with iOS5. The experience on my old iPhone is still better than the new phone. The screen transitions, the font rendering , the display of graphics is just so much better on iOS than aOS. Lets take the simple case of double tapping in a webpage. On the iOS it expands that table or div element to span the screen perfectly. Easy to read now. However, on the aOS, it just expands to what it thinks is a readable size which gets the lines to go out of the screen ! Horrible ! 

Battery Life
The 3 year old iPhone has better battery life than the few weeks old Ace. It is probably due to the fact that I can have multiple background services running, while the iPhone3 cannot multi task at all. the iPad has the most amazing battery life so far - i can get through a week with it.

This is my biggest pain point as of now. My current work involves me being on calls for quite a bit during the day, and I cannot get through a full work day on one charge alone . To be fair my work day is long - 10am -10pm kinds.

Edit : Battery life is horrible! 

Music quality 
Both are good. The speaker on the ACE is louder than the iPhone.

Camera
The Galaxy ACE wins hands down. the 5MP camera does great pic and video recording and also has a flash. However, the iPhone4s has an amazing camera which will beat the Galaxy Ace to pulp. 

Unprocessed pic of a view in Dehradun with Mussorie hills in the background. 

Earphones
Typically people do not pay much thought to it, but the default earphones with the Galaxy Ace actually hurt the ears. I need to get a new one. The default earphones with the iPhone on the other hand are very comfortable. 

Customization
The aOS allows for many customizations that you cannot even dream of in the iOS. For instance below is my home screen on the phone - the date and calendar widgets are down loaded from the app market. iPhone gives much better apps, but the screen layout by itself is limited. 

A customized home screen

App Store
Here, the apple's appstore is much better. The categorization and browsability - either throught the phone or itunes is much much better than Android. If you want to just browse apps in android, you will get lost. Its better to figure out what you want and then search for it. Also the quality of apps is much better on the iOS than on the aOS. Lets take the case of the facebook app - it is much better on iOS.

Ultimately, I think it comes down to price. If price is a constrainging factor, the android based phones - like this Galaxy ACE is total value for money , paisa vassol. If however, you are not constrained by money, then the iPhone4S is an amazing device to get. 


Sep 6, 2011

Anna Effect


There was a lot of euphoria about Anna Hazare breaking his fast. It was no mean feat to go 13 days without food - most of us cant last a day.

However, now that things are simmering down, and the Govt. is after the group associated with Anna for various petty reasons ( in-spite of a much greater stashes of money being siphoned off), the question that comes to my mind is whether the Anna Effect will last - and if so - for how long ? Will it lead to a transformation of society ?

One sure thing about the last month or so is that the Nation has got to know about the larger issues of Corruption. I dont think everyone necessarily agrees with the dictacts of the LokPal Bill, but they do agree that our Country is riddled with corruption - and it is in each and every rung of the society.

Talking with a few cab-drivers on a recent visit to Bangalore , got some insights into their mind.

The one in Delhi had gone to RamLila maidan to be part of the movement. He was adamant that changes will come, and he and his group of friends will not be a part of the corruption. The cab waala in Bangalore was equally vehement and was feeling miffed that he had paid Rs500 as bribe to renew his driving license.

But, once the euphoria settles down, I fear that we will just go back to our old ways. People will rather part with Rs500 than stand in multiple queues trying to get things done the right way. Call me a pessimist, but the behavior of our countrymen does not inspire much optimism in me. I had seen the demonstrations during Mandal commision and the more recent OBC reservation policy, and have seen that people have short term memories and easily forget the pledges they have made when the reality of life strikes them.

What are your thoughts ?