After looking into forums, I learned that to get the IMEI number, a midlet must be signed. I also learned how to sign a midlet using the WTK.
Now, problem is how to get a certificate ? When I run WTK -> Sign option, it shows only 1 keypair named "trusted" in list and if I sign my midlet using this, it shows an error message in handset with message missing certificate.
So, I searched more and found a link
which tells how to create own certificate using OpenSSL and use that to sign midlets. I haven't tried it yet, but will do today. Since I am doing a learning project, I am not ready to purchase a digital certificate for now.
At this point, I want to know if there is any list of devices which supports getting IMEI number via a signed midlet. I have Nokia 6270 and it don't allows (as per some posts in the forum). So if I can have a list of phones which supports accessing IMEI through a signed midlet then it would be helpful for me.