Category Archives: Uncategorized

BlackBerry Java Development: As compared to Android = Horrible Experience

The BlackBerry device , when it came out was amazing. There was nothing like it! At one time it was at the pinnacle of its glory, as an amazing little communication tool, when iPhones and Android’s weren’t there yet. But in the recent years , due to various reasons I feel like listing out here, BlackBerry is going home.

I’m an android developer. My love for android and java started at an early age, and now I’m pretty established over the Android market. After that I decided to try BlackBerry development. And boy was it tough! Anyone who has gone through this transition will know what I’m talking about.

All the Android developer tools are well documented, easy to use, built with great care and allow people who are fundamentally weak in programming to do things they never thought possible. But when it came to BlackBerry, I was very disappointed.

Lets go pointwise

1. Development tools

You need to sign up with Blackberry and download their development environment which is around 400 MB. Now though it seems heavy, everything is packaged into one neat little bundle ready to run. Android has a very tedious process of installing the development environment which isn’t very easy at all and some configuration needs to be done in order to get the SDK working.

Although both run eclipse, BlackBerry somehow seems to be slower. Writing programs in the BB environment isn’t so user friendly – not many suggestions or tweaks RIM has implemented. Nothing fancy at all.

Now when you start writing code, You’ll realise for debugging and testing, Android has the upper hand. LogCat, Emulator control, Profiler , Allocation Tracker and so many tools in Android make debugging a breeze. BlackBerry is the worst when it comes to debugging. Firstly the emulators are horrible. Simply horrible. Firstly they take a hell of a lot of time to start up. The emulation isn’t efficient at all and immediately hogs about 500MB of your memory. Oh and this is without the debugger. If you choose to attach the debugger from the start you can probably take a bath and it still won’t be ready yet. The debugger output isn’t at all categorized like android. Its just random shit blurting out at you. It takes you time just to find out where you wrote a simple System.out.Println(“Hello World”) , and be sure to include newline characters because it wont do that either.

Now assuming your program has a bug in it and you hit run, most of the emulators just show you this nasty Java error screen and halt. Thats it. They halt. Then you can’t even quit the bloody thing. You have to kill the processes on Windows Task Manager , well not only kill but to FORCE it to close. Then you edit your code and restart. The same thing all over again. And no my laptop isnt slow – its an Acer Aspire with 3 gigs of RAM and a core i3 processor runnning windows 7 x64.

Also, theres a funny thing. You would expect things that work on an emulator to work on a device of same specs. Sometimes, the program runs fine on the device but not on the emulator! The emulator keeps throwing weird errors at you. You have to keep “cleaning” the emulators. I really do not understand why RIM can’t put a little effort into their development tools. Its almost like BlackBerry doesn’t want you developing apps!

Sometimes the environment just will not show you exactly where the error occured. It just shows you the top level stack trace like the line MyScreen = new Screen() failed. Gee, I need to know WHERE the error occurred in order to fix it don’t I? So I google this error on the BlackBerry blogs. It looks like there’s a poor guy by the name of Mark Sohm answering everyones questions. The best part is, not even trained advanced developers have a clue about what is going on because of RIM’s slack implementation of Java.

2. Official Documentation and Support

The BlackBerry website seems to have detailed documentation about implementation with code, but sometimes that code simply does not run. Yes their own code has bugs in it and does not run. Also, they don’t explain proper methodologies on their website, they will never tell you efficient ways of doing it. Apart from that there is very little documentation out there. Android has tutorials on almost every website , not one but like ten different websites with ten different methods!

Also, for Android developers, theres a website called Stack Overflow. It is an amazing community of people who solve any problems related to Android and I refer to their questions more often then I do with the official website. Blackberry doesn’t have such a community. Everything is corporate. You need help, you pay for it. Nobody is interested in offering you good advice or code for free. They don’t even have proper videos on how to start programming.

3. Components

The RIM Blackberry API has very very limited components with limited functionality. You can’t skin them just by giving them a stateful background like android. You have to download heaps of code just for a simple stylable button. Wastes a lot of the developers time. There is no drag and drop UI. The UI isn’t separate like in android xml layouts. Everything is crammed into one ugly piece of code.

4. Signing and Publishing

Well registration is free for a BlackBerry developer account. But its a very long process, they ask you to fax them your identification proof before they accept your registration. Then the ISV portal where you submit your apps doesn’t work half the time. The graphs dont show saying there was an unexpected error, right now I’m getting a server overloaded error, and they ask you to upgrade to the latest browsers. The app submission process isn’t friendly at all. Its very ugly and complicated. Theres no good mechanism for uploading files, the app approval process takes a huge amount of time like 15 days or even three weeks or so. If you have an error the process repeats. Same like apple. Now the Android market gives you good analytics. BlackBerry analytics = one ugly CSV file.

RIM has murdered blackberry development by not supporting it and making it more user friendly. Looks like they don’t want people to develop BB apps.  I hope someone from RIM reads this. Shame on you. All of you.

The sad truth about Assignments

Many of you know I oppose UoP a lot. I have my reasons for opposing them. And today my effrontery has reached its pinnacle. Now that I have probably become the epitome of shamelessness, I might as well start.

For those of you who do not know UoP – Its the university in Pune, India which probably is analogous with most , but not all universities in India. Wikipedia says It is one of India’s “premier” universities. It was founded in 1949.

” Assignments are Criminal “

Most Indian colleges tend to give something called “assignments” to the students. These assignments are usually questions from a local author book or questions from previous papers. Now by definition “assignments” were always meant to be insightful small tasks to be performed by the individual at his own pace. Assignment pages in US universities for undergrads probably span maybe 3 or 4 pages long consisting of original objective questions put forward by the professor. It is assumed that the student will do this task if he wants to and nothing is forced with few or no deadlines.

UoP apparently has a policy in place where a minimum number of assignments must be assigned to each student to grant his/her term. Most teachers take this a step further and make the two page assignment into a ten page one taking the average time per assignment from say thirty minutes on your own to a few hours at least. They also impose certain “deadlines” along with other extortion tactics like not “marking your attendance”.

Also, a deeper study of why teachers do this is led me to the reason that they believe that if you “write” something , whatever you write will magically be embedded deep within your brain and you will never forget it, something like a Harry Potter blood quill.

A much deeper flaw is that on an average only 10/60 students sincerely complete the assignment task while the others replicate it in fear or sheer laziness. These assignments when completed are never checked deeply because even the teachers know they are copied.

On an environmental note, you also waste a phenomenal amount of paper. Each journal has around 14 assignments on average with around 4 to 5 pages of write ups with it. So one journal comsumes 14*5 = 70 pages. There are around three journals per semester. So 70*3 = 210 pages for a semester not counting the extra internal assignments. Each branch has around 120 students per year of college. So 120*4 = 480 students in a college. Last time I checked there were around 700 colleges in Maharashtra state itself. So 480  * 700 (students) * 210 pages per semester thats around 7,05,60,000 or around 7 crore pages per semester. Multiplied by eight semesters so 7*8 = 56 crores. With my calculation that amounts to around 20 lakh trees being cut down in one state of one country.

We kill 20 lakh trees per engineer writing assignments that never help anyone.

The question we have to ask is are these assignments really necessary? They lead us absolutely nowhere,  benefit no one and help in global warming.

Controlling your PC via the internet: A XML Approach

I’ve recently come across thousands of paid apps that allow you to control your pc via the internet through a mobile phone / tablet pc. I couldn’t help pondering over how to code this or implement this in real life. A very simple, stupid approach which I will introduce here through this tutorial should teach you how to easily create a simple framework for access.

This should give you a fair idea how it is going to be implemented


Again, just so you know – This isn’t the ideal way to implement it but as I said – this is the quick and dirty base you can set up within a few hours.

For this tutorial you will need the following:

  1. A Shared/Dedicated Hosting Web Space with PHP and FTP access
  2. Visual Studio 2010 (C#)
  3. A good php and xml code editor like Dreamweaver
  4. A testing server (Optional)
  5. A mobile device with internet access (For testing!)

I will briefly explain how it works:-

  • A C# executable will be running on your PC (Which you will code of course) which establishes a connection to the server and “listens” (keeps downloading the file every X seconds)
  • The information is downloaded, parsed and actions are taken according to the values found after parsing.
  • This executable shall issue the commands to the .NET API to control your PC ( I will show you a simple mouse demo )
  • A PHP front end interface will allow the user to issue commands to the PC. An HTTP GET request will be dispatched to the server with a variable(number) that tells PHP to write that number out into an XML file and keep it on the server
  • The file is again pulled by the computer and commands are executed.

Lets Start!

1. Coding the C# Application

Fire Up Visual Studio 2010. Open a new C# Project (Windows Forms Application). Make your UI Similar to this.

Four Button Controls , Two Labels, Two Textboxes,A timer, A Status Strip

The Buttons are just for testing your code for moving your mouse. Before I explain what everything is for, start implementing the simple code for moving your cursor. Take a look at this

Cursor.Position = new Point(Cursor.Position.X + d1, Cursor.Position.Y + d2);

This is the crux of the program. This will move your cursor to the X,Y Position already present + the displacement in pixels (d1=displacement in x direction and d2=displacement in y) Replace d1 and d2 with integer values and watch the fun!

private void btnDown_Click(object sender, EventArgs e)
 Cursor.Position = new Point(Cursor.Position.X, Cursor.Position.Y + 10);

Once you double click on any of the buttons – just like Visual Basic, code is generated. In that paste the given line with modifications. Keep in mind the coordinate axes meant for computer screens and give values accordingly. I have showed the code for the down button.

Our next job is to create the sample xml file we will use for parsing and upload it to the server.

Now some of you might ask, why XML? The answer is simple. XML is a generic, simple markup language which allows any language to communicate with any other language. The parsing functions for XML might differ but the result is unique. If you are not familiar with XML you can read a bit on

Our XML file structure will be something like this

<?xml version="1.0" encoding="ISO-8859-1" ?>


Our ‘root’ nodes shall hold a Command object which has the following properties:

id: A number to keep track of which command was executed previously

instruction: A number which we assign a special meaning to – it tells which instruction is to be executed. For example instruction =1 could mean Mouse Up, Instruction=2 could mean Mouse Down, and so on.

We can also have Multiple Commands if we plan to extend it. For example Open Media Player. Play the file. Exit ; Well you get it!

Now you could code the xml file in any text editor you like, just make sure it is well formed. Once you have done that, save it temporarily on your drive. Open up your FTP Manager Program / Login into your shared hosting control panel File Manager

Transfer the xml file to some directory for testing. I have named mine “remote”.

Keep the absolute location in mind ( or whatever , because our program is going to need this.

Now we have to write a function that parses the XML file in C# So we know what to do.

Specify the using directive on the System.Xml namespace so that you are not required to qualify XmlTextReader declarations later in your code. You must use the using directive before any other declarations.

Create an instance of an XmlTextReader object, and populate it with the XML file. Typically, the XmlTextReader class is used if you need to access the XML as raw data without the overhead of a DOM; thus, the XmlTextReader class provides a faster mechanism for reading XML. The XmlTextReader class has different constructors to specify the location of the XML data.

Read through the XML. (Note that this step demonstrates an outer “while” loop, and the next two steps demonstrate how to use that loop to read the XML.) After you create the XmlTextReader object, use the Read method to read the XML data. The Read method continues to move through the XML file sequentially until it reaches the end of the file, at which point the Read method returns a value of “False.”

The code above should help you with the parsing of XML files. I have used Booleans to check at what point we are in the xml file.

while (reader.Read())
    // Do some work here on the data.

The last three steps were from Please refer for more information.


I have also handled exceptions for when there is no internet connectivity.

Now where does this function go? Simple! The timer should execute this function every “X” seconds to get the right Data.

private void timer1_Tick(object sender, EventArgs e)ReadMyXML();That should take care of getting and parsing the data.  Your demo is ready and should run with the static xml file.



Now the question arises, can we generate this file dynamically? Can we get a user to enter a link in his browser passing a parameter he wants so that the xml file is generated?  for example will generate an xml file that contains a “Mouse Up” command!

The answer is , yes, We can use a dynamic web language such as PHP or python to generate this. PHP shall parse the URL entered in the browser and find the parameter (here it is ‘c’) and its value (1).

Here is the php code for writing out an XML file in the way we want. Make sure permissions for writing files are enabled on your server or it gives an error when you try to write a file.

PHP Code for Index.php

PHP Code for Index.php

Thats it! Try your new link or something and enjoy the fun. You could do the following modifications to make it fully featured

1. Provide user security with user name and passwords

2. Make an Android App that will have a nice UI and issue those commands

3.Add Code for more functionality – Playing Music, Powerpoint (Google them!)

Let me know on my email if you do come up with something!

Till then Cheerio!

Create your own trance,rock,pop songs! Professionally on your computer! Without a single Instrument!

Ever listened to Armin Van Buuren , Dj Tiesto trance songs and wondered if you could try ? Ever wanted to create your own songs but never had the cash? Here’s just the thing for you!


FL Studio 9 by Image-line!

This is the most amazing piece of software I have come across by far. This software will allow you to create, edit, mix your own drum samples, make your own loops for techno/trance songs. You can use built in drum-loops or make your own. It has support for a lot of musical instruments. If you ever fall short you can always download your own sound samples or plugins from their website.

The basic layout is somewhat like this –

Main FL Studio Window

On the extreme left you can see the Browser window which allows you to see all the files and sound samples available as also plugin presets.

In the middle you can see the Pattern Sequencer. The sound sample can be triggered on or off by clicking the switch-like buttons.

Pattern Sequencer

You start off with a basic Kick,Clap,Snare,Hihat. After that you add your own channels according to your requirements.

You get a piano-roll interface to find the exact notes. There are Bassline synthesizers built in. You just have to play around a little to get the beats right. If you try the one above you might get an idea.

The TS404(or any other) will sound a bit boring alone on its own. So try and send it to an ‘FX’ channel, and apply different effects.

Effects/Send Window

The easiest to start with for a techno preset are the Fruity Delay Bank which gives a nice delay effect. Recorded vocals can use the Vocodex plugin.

If you have a MIDI compatible keyboard at home you can enter your notes directly into fruity loops. Dont have one? no worries! Just type with your normal keyboard and hit record.

Also you can use the Hardcore Plugin to experience real AC/DC guitar like-effects. Just like the real ones.

Hardcore Plugin

What are you waiting for? Navigate to and download your free trial!

Dont believe me? Try listening to this created on Fruity Loops.

1000 views: Thank you

1000+ Views!

I just checked my stats right now and my blog has 1085 views. Thank you everyone!


Snow Leopard 10.6.2 on HP 530 Fully loaded

Snow Leo

Snow leopard on HP530

After hours of tinkering and downloading kexts , distros, finally I managed to get Snow Leopard Working on my HP530.

Here are the specs of my HP 530


Core 2 Duo 1.6 Ghz T5 series

Intel GMA 950 Graphics

2GB DDR Laptop RAM

Intel PRO/8245 Ethernet and Wireless

Realtek HD Audio (On 7)

Chameleon 2RC4 bootloader with Mac OS X 10.6 / Win 7 / Snow Leo Dual boot

Installed Kexts/Drivers: [ Available in file attached below ]

1.Graphics – Intel GMA 950 (0x27AE) series kexts. Please note I had to add the device-properties UUID to the apple so that it detects it.[Full Resolution with acceleration]

2.Audio – VoodooHDA (fixes the mic and headphone ports and makes them work )

3.PS/2 Controller – Synaptics Apple PS2 controller

4.Ethernet – Intel 8255x controller.

5. Wireless – Intel PRO Wireless [Does not support encryption]

6.Power – VoodooBattery / VoodooMiniPower (Google it) Enables Speedstep required for greater battery life and less overheating

Download Netbook Pack here

Download Trackpad kext here

Download Ethernet Card kext here

Download Extensions folder here

Netbook Pack contains IntelGMA950 x27AE specially for HP530 and voodoo battery meter/hda kexts along with which you need to place in your extra folder to run snow leo.

My method

After reading hundreds of different tutorials I decided to do it my own way. I downloaded SNOW OSX 3.5 , burned it to a DVD and tried to run it. It gave a kernel panic with something about page fault error type 14 and forced me to restart.

This is a problem with HP Laptops. I cannot set it to IDE through the bios I can just enable or disable the native SATA mode which in my opinion does not make a difference. Also I did not know about the DSDT or what it is used for.

Also I wanted to triple boot it on MBR partitions. This was a major problem.

1. Installed Kalyway’s Distro  10.5.2 to DISK 1. Updated it to 10.5.6 following the update guides given. Used Chameleon 2 RC4 and EFI 9. (RC4 and EFI 9 or 10 is MUST)

2. Then Downloaded Snow Leo Distro SNOWOSX. Burned it to a DVD.

3.Booted into Leopard. Browsed to the System/ Install/ Folder to a file called OSInstall.mpkg

4.Formatted DISK 2 on which snow leo was to be installed. Installed Snow leopard with the file above. DO NOT RESTART AT THIS POINT.

5.Installed Chameleon 2 RC4 and EFI v10 on the other drive too.  Replaced the mach_kernel with the voodoo one and the boot file which I got from somewhere

6.Find the DSDT GUI Patcher on the drive. Run it. Select the drive you are going to install Snow on. Do not select any other drive. Hit the Make DSDT button or whatever. You should see a dsdt file on the drive root now.

7.Make a new folder called “Extra”. Copy from the netbook pack, and also copy the dsdt file here too. Next make a folder called Extensions. Copy the extensions you want it to load on startup. Best way is to copy the extensions folder from your working Leopard. Pay attention to IntelPIIXATA. Read threads about the IOFamily kext causing problems with SATA.

8.I deleted the IntelPIIXATA file. Downloaded fakesmc from netkas. Deleted the DSMOS inside the installed snow leopard drive in  S/L/E

9.Restart. Select the snow leo drive. Type -v cpus=1 arch=i386 rd=diskAsB where A and B are the identifiers for your drive. You need cpus=1 or it just wont start.

8.If you get a waiting for root device message there are a lot of ways to solve this. Its a problem with the SATA drive. Play around with the IOATAfamily kext. I deleted it and I got no kernel panic. That file caused a page fault for me and snow leo wouldnt boot. Add the UUID string for the disk if you need to in the file in the Extra Folder

9.Snow leo should start with 1024×768 and no graphics/ethernet/sound working

10. Use kext helper. Install the kexts one by one. Restart

There you go a working Snow leo install with almost no kernel panic!

How to shoot better Night Shots: The ISO Factor

Night Shots

There must have been a time when your dad just got this amazing digital camera. It shoots great in the daytime but the night shots on Auto mode suck. It’s not the camera’s fault. Its yours.

This is what happens on my Sony Cybershot  P200 on Auto mode when I try to take a shot of the city at night.

Auto Mode Shot Pic

Auto Mode

 Sucks, does it not?

We can do much better. But first there are a few things we need to learn

1.Use the Manual Mode. Read the Manual

Go to the manual mode on your camera. For mine its “M”.You can set the shutter speed manually as well as the arpeture.

Shutter speed is  literally exposure time measured in seconds.Very short shutter speeds are used to freeze fast-moving subjects, for example at sporting events. Very long shutter speeds are used to intentionally blur a moving subject for artistic effect or night 30 ” (long exp) & 1/125 (daylight)

Arpeture controls the amount of light that reaches a digital camera sensor.It is measured in f-stops. A lower f-stop number opens the aperture and admits more light onto the camera sensor.e.g( f/2.8)

ISO denotes how sensitive the image sensor is to the amount of light present. The higher the ISO, the more sensitive the image sensor and therefore the possibility to take pictures in low-light situations.

 (The stuff in red is what you need to pay attention to)

2. Keep the camera still

More exposure time means any sort of moving objects will be seen as ghost images and will spoil the picture.

Get a tripod, or if one isnt available , find a flat surface and keep the camera on it with the subject in the frame and hit the auto-timer. Try not to “hold” it steady. Pay attention to the vibration warning.

3. ISO drawbacks

Higher ISO speed means higher sensivity which means more noise (like grain in old photos). We don’t want noisy photos. Usually ISO 100 is used for shooting outdoor sunny scenes where 200,300,400,and higher are used for darker conditions. You have to strike a balance between ISO speed and noise

You can see the new pictures with different ISO speeds. The ISO 400 starts to get noisy

Above shots were about 4 seconds exposure time.

4. Use Long exposure

Use the auto timer and set the exposure time to maximum like 30seconds. If you want light trails in your photos at night use this setting. Also for better light.

Long Exposure 30 secs ISO 400


5.When to use flash

Shut the flash off if you need to click a picture of the city like above

If you want a subject in front of you to come in the picture and have like light trails behind him then use the flash.