I’m Carol Hamer, and I’m a software (and Q.A.) engineer living in Switzerland.

Check out my new book Learn BlackBerry Games Development and my previousCarol Hamer climbing wall book Creating Mobile Games: Using Java™ ME Platform to Put the Fun into Your Mobile Device and Cell Phone!!

57 comments so far

  1. balakumar on

    hi carol

    am much interested in mobile blogging and i want to know in detail about the mobile blogging. am also doing a project in this topic will u please help me by sending the details

  2. carolhamer on

    Hi Balakumar,

    I’m not sure where you’re at on your project so I’ll start from the beginning:

    Getting started mobile blogging is very easy. There are many blogging services that allow you to create a blog for free, such as WordPress. If all of the mobile blogging you want to do is to read your blog from your handset, then you’re done, because as long as your handset can load html pages, you can just load your blog’s page and read it.

    If you also want to post blog entries from your handset, it’s a little more complex, but not much. You can get a free blog from blogger and they have a service for uploading posts from a mobile phone, explained here.

    (I hope I won’t get in trouble for mentioning the competition here on a WordPress blog. If any WordPress employees are reading this, I looked for the corresponding service on WordPress and couldn’t find it. However, if you tell me where to find it, I’ll edit this comment to mention WordPress’s service instead. 😀 )

    For more advanced topics, please see my fun with mobile blogging post and especially the article I linked to and the link in the comment.

  3. ankush on

    Hi Carol ,

    It was going ur sms checker game . I am interested to know more about how to dynamically register for a pushport for sms . I tried out a couple of code snippets but could work out. I would appreciate if you send me code snippets or explain the concept for the same


  4. carolhamer on

    Hi Ankush,

    I’ve posted the code for the dynamic push port registration exercise as a comment on my I’m sending out an SMS post.

  5. Alex on

    Thank You

  6. jinsabraham on

    Hello Carol..I need some help in devoloping a BlueTooth Application…and please get me some means to contact u..email or something like that…i have an urgent requirement..jinzabraham@gmail.com

  7. jinsabraham on

    Hello Carol..I need some help in devoloping a BlueTooth Application…and please get me some means to contact u..email or something like that…i have an urgent requirement..jinsabraham@gmail.com

  8. Tim Zheng on

    Hello Carol,
    I am having a hard time setting up Polish with Eclipse on my machine, could you give me a brief walk through? Thank you very much.

  9. Gordon on

    Hi Carrol,

    First, good luck with your book!

    Second, I’m fairly new to J2ME (but not programming), and I’m puzzled at the lack of foundations for creating normal application UI. There are 2 commercial libraries that cost way too much for an individual programmer, yet the default lcdui package looks pretty bad…

    Even if I stick with lcdui, I encountered another problem:
    I couldn’t find a decent contact list browser (to select a contact number from). Netbeans 6.0 beta just came out with one, but it’s buggy as hell. It tries to load the entire contact list, only to crash in the middle… I’ll probably end up building one myself, but it sounds like a lot of work:
    – Need to browse list in portions
    – Present alternative phone numbers
    – Allow keystrokes to jump through the list


    Cutting to the chase:
    1. Do you know any good UI foundation I can use?
    2. Any suggestions regarding that PIM browser?


  10. carolhamer on

    Hi Gordon,

    I know what you mean about the problem — the default lcdui classes really aren’t appropriate for a professional project. My preferred solution has been to write UI classes from scratch, but not only does that represent a lot of programming, but you also need to deal with customizing for the various devices.

    As far as the contact list is concerned, in some devices when you set an lcdui textbox or textfield to PHONENUMBER the platform will automatically provide functionality to browse the phone numbers from the contact list. Even if you’re writing your own UI utilities, you can use an lcdui textfield with the following trick: Draw a fake textfield on your custom-drawn UI screen and add navigation functionality to allow the user to focus/select different widgets. Then once the user selects the fake textfield, you switch the screen to an lcdui TextBox. Once the user has pressed OK, go back to your custom-drawn UI screen, and draw the contents of the lcdui TextBox in your fake text field. (I’m thinking of writing a quick blog entry with code for this trick.)

    One advantage (plust disadvantage) to using an lcdui TextBox as the implementation of a custom textfield widget is that the look-and-feel will vary from one platform to the next. So you’re sure you’ll have an implementation that is appropriate to each device, but your product’s behavior will vary from one device to the next, and hence might not always match your desired product specs. It’s a fairly quick (temporary?) solution though.

    I don’t know of a third-party solution that I can recommend as an alternative, but I haven’t really been on the lookout since I’ve kind of been thinking of ways to work out my own solution…

  11. Tony on

    Hi Carol,

    I’ve been a hobbyist Java ME programmer for awhile now, pacman clones etc. I recently bought your book and have found it a great resource – especially the bluetooth checkers project!

    I’m doing an MSc in Artificial Intelligence and would like to do my thesis on a subject relating to mobile phone games/applications or their development. The lecturers encourage us to base our thesis on real world or practical ideas.

    I was just wondering if you know of any areas that might be worth researching?

    Thank you very much for your time!


  12. carolhamer on

    Hi Tony,

    Thanks, I’m glad you like my book!

    As for a research project that involves AI and mobile games? That’s a tricky one, but I can try taking a stab at it:

    One difficult aspect of writing mobile games is optimization (such things as when you load resources, when you release them, etc.). The annoying thing is that it varies from platform to platform based on both hardware and software, so a change that improves performance on one platform can make it worse on another. One useful project would be to make an (intelligent?) application that can run on different handsets and figure out optimization parameters such as how many KB of resources to load into memory at a time to balance the loading cost with the memory footprint.

  13. Tony on

    Thanks for the reply Carol, I’ll definitely look into it!

  14. Kawa on

    Hi Carol,
    I just bought your book from Amazon. Hopefully it will arrive in two weeks. I can’t wait to get my hands on it 🙂 Hopefully it will meet my expectations 🙂 Have a nice day.

  15. carolhamer on

    Thanks!!! I hope you’ll like it!!! 😀

  16. Kawa on

    I’m pretty sure I will, since I’m a noob in java, is will certainly help me. Can you point me to the right docs and support pages regarding java? I hope I’m not asking too much. I really have a hard time understanding the class, constructor, etc. concepts. Last time I was seriously programing was Pascal, wich I mastered very well, but it was a long time ago. Thanks and hopefully we’lll keep in touch. Have a nice day.

  17. carolhamer on

    It’s true you’ll need a little bit of background on object-oriented programming with Java in order to use my book. (As I recall, Pascal is not object-oriented.)

    Fortunately, it’s not too complicated and there are a lot of good articles floating around the Internet. I googled “object-oriented basics with Java” and found a few that look promising here and here.

  18. Lukas on

    Dear Carol,

    I’m preparing hands-on lab tutorial for JavaOne 2008. Its name is “Create Your Own Mobile Game”. The game idea is a duke looking for James Gosling in a maze. I found out that it’s much more easier to re-use a part of your code from the dungeon game from your book than to write it from scratch again.(The game idea is very similar to a princess looking for a crown 😉 ).

    I don’t want to steal your code therefore I wanted to ask you if you would mind if I’ll use a part of your code and modify it. I will note everywhere in the tutorial and the code itself that it is based on the original source code from Carol Hamer. The hands-on lab will be published on JavaOne pages under BSD or CDDL license after J1.

    I wanted to contact you through the LinkedIn however it allows to sent invitation just to friends.

    Could you send me an answer by an email (lukas dot hasik at sun dot com), please? Thank you.

    -Lukas Hasik

  19. carolhamer on

    Hi Lukas,

    That’s fine with me — I’m glad you like my game. 😀

    I’ll send you an email.

  20. manoj on


    I am writing Blurtoothbroadcaster app. Only One Mobile contains my app and rest doesnt hold do any app written by me.

    basically I should be able to broadcast my visiting cards, photoes.. whenever i meet any one in a party ..
    SO I dont expect them to copy my appl.

    So far,

    I have written a mobile app(jsr82). and be able to find the devices, services.. and be able to make connection…
    then (streamConnection)out.write(buf) also works..

    But the Other device doesnt receive any..

    1) Mobile1-with my app – starts connection
    2) Mobile2 – NO APP — gets the connection req and the bluetooth inside the mobile2 identifies and asks me for allow/deny the connection
    3) I allowed it.
    4) Mobile1-with my app- now I send the data.
    5) it goes no exceptions….
    6)Nothing happens at mobile2.

    I am sure I am missing some thing, where/what/how I should tell to other Mobile2-InbuiltBluetooth.. about the File(name) I am sending.. before I send the data..

    Remeber, the app is in mobile1 only.. mobile2 should NOT have any app.


  21. nabihah on

    Hi Carol,

    I tried your codes from your new book using Netbeans. When I compiled them, there are no errors. But when I runned them, it does started in emulator but until the selection of server/client mode only. But then there’s no connection. I’m not sure whether emulator does support bluetooth connection or not. So I tried install them in my phone, and this worst. The game could not be started at all. I don’t know what is wrong.

    I really need your help. How did you run or what did you do to make the game works? (I tried the BluetoothCheckers.jar and it worked perfectly) How did you do that? Please could you help me by giving maybe a step by step on how to make the game run on my phone, please? If it is ok for you, can you send the answer to nabihah_a4@yahoo.com as soon as possible. Please!

    Thanks a lot..


  22. yasmin on

    i’ve bought your two books; J2ME Games with MIDP2 and your newest book..

    it really helps!

    p/s: always keep your blog updated! can’t wait…

  23. Manoneeta on

    Hi Carol,
    I’m making an application using PIM.Do I need to get my midlet sign to be able to save new contact to contact list because I’m getting security exception.How can I get it signed ?
    Please reply soon as this is very urgent.

  24. carolhamer on

    Hi Manoneeta,

    If it’s just a question of needing this for development and testing on the emulator, then you can use the tools that come with the WTK to sign the jar and import the corresponding certificate into the emulator’s keystore. (There are a few steps here, but it’s explained clearly in the WTK documentation and also in my book).

    If you need it to work on an actual handset, however, there’s no quick and simple way to get your MIDlet signed with a certificate that the handset will recognize. Getting a certificate signed by a recognized Certificate Authority is a procedure that is costly and takes time even for medium-sized corporations. If you want to eliminate the warnings on one individual handset, sometimes there’s a menu of security preferences where you can turn off the warnings, but that won’t help you get rid of the warning screens for other users. I’m sorry to say there’s not a simple answer — Java ME security was specifically designed to prevent applications from bypassing these warnings.

  25. Manoneeta on

    Hi Carol,

    Thanks for a quick reply.I am not much bothered about the warnings but about the ability to write on phone’s memory so that I can add a new contact.In my application I have used PIM.READ_WRITE.Yesterday I executed my application a SonyEricssonZ520i handset & it was able to add a new contact ( Let me tell you that my application is not signed) but when I executed the same application on Nokia6233 it didn’t even let me start that application.Is it possible to break security level in Nokia6233 so that I am able to write (i.e. add a new contact)on my mobile? Is there any site from where I can get information on handsets which will allow me to add a new contact and save into its contact list.

    Thanks & Regards,

  26. carolhamer on

    Hi Manoneeta,

    If you’ve listed the permission as required in the Jad and Manifest, it’s possible that could prevent the MIDlet from installing or running unsigned. You could try listing the permission in the “MIDlet-Permissions-Opt” attribute instead of the “MIDlet-Permissions” attribute. If that doesn’t help, Nokia has a large and active site for developers: Forum Nokia where there’s almost surely someone who knows what’s going on with that device.

    Unfortunately, I don’t know of a big comprehensive database that gives this level of detail on implementation differences from one handset to the next. You can find information about a lot of unexpected handset behaviors by searching around the Internet, but there’s not really a one-stop site where you can expect to find all the details on the differences among Java ME implementations.

  27. Manoneeta on

    Hi Carol,
    I tried adding the permission to “MIDlet-Permissions-Opt”,but WTK didn’t allow me to do so.I think this was because I had already mentioned it in “MIDlet-Permissions”.Anyways, I was finally able to add a new contact into my mobile i.e. Nokia6233 after changing the settings for application’s accessibility level.

    Thanks & Regards,

  28. carolhamer on

    Hi Manoneeta,

    Yeah, you have to list the permission in one or the other of those attributes, not both. It’s good that changing the permission settings worked. Things would be a lot simpler if all of the handsets behaved the same way with respect to permissions and security.

  29. Manoneeta on

    Hi Carol,
    Now I want to retrieve Contact List from SIM and save few Contacts back to SIM.Can you tell me some simple example of doing this task.Even if I get to know how to read SIM contact list that’ll be enough.

    Thanks & Regards,

  30. djis on


    I’m not sure whether I should write in french or in english… Let’s go with english. 🙂

    I’m stumbled upon your game page when looking for an app that could give me BlackBerry keycodes.
    I managed to download and install the app (KeyCode) from the mobile with no problems. That’s why I’m contacting you.

    I’m currently developping a j2me game which has to be distributed over the web and playable on the most mobiles possible, including BlackBerry.
    The thing is when I put my jar/jad couple on my webpage, the download always fails due to a 907 error “invalid jar” with a detail like: 403 forbidden. (it only fails with blackberry mobiles)

    I’ve added the cod, jar, and jad mime types via .htaccess but it still does not work.

    Could you give me a hint like how did you configure your server or I dunnowhat (I’m noob to web technologies) to make it all click?

    Thank you very much, and keep on the nice work.

  31. carolhamer on

    Hi Manoneeta,

    It’s not clear that there’s an API that will allow you to specifically get the contacts from the SIM (as opposed to the phone’s memory). I would guess that at best this is platform dependent — some may provide access to the SIM memory but not all.

    Actually, the other half of JSR 75 may be the key: there may be a way of accessing the SIM through the filesystem on some handsets. But I don’t see a JSR that gives a generic way of accessing memory specifically on the SIM for a MicroEdition device…

    Hi DJIS,

    That’s very annoying since it looks like you’re getting one of those catch-all error messages that could mean anything. I don’t think I did anything special to my site beyond changing the .htaccess, so the next thing I’d check would be the jar/jad. Have you tried installing this jar/jad on the blackberry via other means (like bluetooth or via cable from a P.C.)? That way you can confirm that it’s really a problem with the site config and not a problem with the jar.

    Worse case scenario you could mail me your jar/jad and I could put them on my page so you can see if they can be installed from there, since you say the installation from that page worked for another app…

  32. Djis on

    Well, I’m really stuck with this BlackBerry problem.
    THe thing is the jar/jad couple downloads, installs and runs fine on a htc touch mobile, so I don’t really see what is wrong…
    It would be very nice of you to try and put my program on your page.
    Could you provide me with an email to send my app to?
    I’m currently finishing the game in itself, I hope it will be done sometimes tomorrow so I can look deeper in that BlackBerry problem.
    Anyway, thanks for your concern.
    I really appreciate it.

  33. carolhamer on

    OK, done.

  34. Manoneeta on

    hi Carol,
    I was able to retrieve SIM contacts using JSR75 itself but only in few handsets & that I think is dependent on accessebility provided by the manufacturer.Anyways thanks a lot.

  35. Jimmy on

    Hi Carol,

    may I seek your expertise advice as in whether is it possible to create a camera video background? Because from what I have known, the background can only take in image format, like gif, png etc. I was hoping to create a J2ME mobile game that can make use of the real environment by controlling the phone camera.

    Many thanks.


  36. carolhamer on

    Hi Jimmy,

    I’m not sure MIDP is really well-suited to this task. As you correctly point out, MIDP displays buffered image data. This can simplify some tasks, but you’d probably need more direct control over the native raster operations to get the necessary performance to create a camera video background in real time.

  37. Pat on

    Hello Carol,
    I’m really hoping you still actively check this blog, because I’ve run into a bit of a problem with your Creating Mobile Games book. I am not extremely skilled at Java, but I just bought your book and have been working through it. I understand most of the logic and commands, it makes sense, but from Chapter 3 onward the source code provided in your book doesn’t seem to work. At first I was using your code more as a guideline and working on my own “game” using sprites and such but when it didn’t work I directly copied your code that I had downloaded from the resources page on the website, and it has the same error. It doesn’t give me an error number, it simply says java.io.IOException, which is the biggest problem. With no error code I don’t know what to do to try and fix it. It has the same error on all of the emulators and on my personal phone. Do you know about anything that may be causing this? I know this is a big question, but it’s annoying that the code straight from the book doesn’t work either. I appreciate your reply. Thanks for the book, it’s been good up until this point.


  38. carolhamer on

    Hi Pat,

    I do check this blog, although it’s true it has been a bit less frequently lately.

    In my experience, the most common cause of an IOException that makes the MIDlet fail right off the bat is that there’s a problem with the resource files, and especially the path to the resource files.

    In general, what I’d recommend to troubleshoot this problem is the following:

    Add a print statement just before and after the first call to Class.getResourceAsStream(“yourImageFilenameHere.png”). Then run it in the emulator to see if that’s where it’s failing. If that’s it, then verify that you’ve got the right resource files in your “res” folder, and by checking the jar (using the “jar tvf midletname.jar” command) verify that the resource files were built into the jar.

    If that’s not where the error occurred, then if you run it in the emulator, the exception should at least print you a stack trace in the console so you can track it down. If it doesn’t, you can force it to print the stack trace by putting a try/catch just inside the constructor and the startApp methods which catches the exception and calls e.printStackTrace().

  39. Pat on

    Thank you very much for your extremely fast reply! It did end up just being that the images weren’t being built into the Jar, so a pretty easy fix. I’m not used to having to do all that kind of stuff because I come mainly with a Visual Basic background, I’ve only dabbled a little bit into Java and C++ at this point. Anyway, thank you for taking the time to answer my question.


  40. carolhamer on

    No problem, glad it worked! 😀

  41. Pat on

    Hello again. I have been continuing to work off and on on my game that I had asked about earlier. I am not at the stage where I want to make it downloadable by my friends and family so they can critique it, but it doesn’t seem to be working. I personally have a HTC Tilt (PDA) and I can download the game easily, though it doesn’t stay installed. But when I try to download and install it onto my wifes Samsung Alias and it isn’t working. When I open the JAD file from the internet it simply shows the JAD information and does not install the file. When I try to access the JAR directly it gives me some sort of error. If you would like to look at it, or if you could, the website it is currently hosted at is:
    Thank you so much!

  42. carolhamer on

    Hi Pat,

    I just downloaded your Turtle Tanks game onto my Nokia 6300. It works fine, nice graphics.

    It had trouble recognizing the file types of your wml page and your jad file, though. Are you sure your server is configured to give the correct MIME types? You said you have my book — look in the “Configuring the Server” section in chapter 1.

  43. liquid on

    Is it okay to use your code (here: http://www.java-tips.org/java-me-tips/midp/how-to-create-a-maze-game-in-j2me.html) to learn/refresh my memory of java? I will be breaking it down and building up something for essentially personal educational purposes. Mostly I am just playing with ideas at the moment and am completely unfamiliar with the appropriate manner in how these usage things are gone about. So I figured I’d ask. Thank you,

  44. carolhamer on

    Yes, you can use my code for personal educational purposes. Really, you can use the code for any purpose, up to two caveats:

    1. If you’d like to use it in a published article (such as a tutorial or something), then contact me for permission.
    2. There is of course no warranty, real or implied.

  45. liquid on

    Thank you,

  46. aaguu on

    Hi Carol,
    Thank you for this blog.
    i have one problem.
    How to work pound key (#) on Textfield J2MEPolish 2.0.7
    i defined TextField.DECIMAL but doesn’t work pound key(#) not input minus character.

    best regards,

  47. Thor on

    Hi Carol,
    sorry to bother you, but I have a question regarding your JSRTest MIDlet. I need to check if JSR 177 and JSR 219 are supported on my mobile. Is it either possible to release the source code of this MIDlet so I can incorporate this additional tests myself, or could you take a few minutes yourself to incorporate them and release the tool afterwards? Either way, it would be really helpful for me.

    Thank you in advance!

    Best Regards,

  48. carolhamer on

    Thor — of course. I posted the source code in my original post about JSRs: JSRs galore!!!

    You can cut and paste that code to check for any API you like. 😀

  49. Thor on

    Hi Carol,
    thanks a lot for that 🙂

    Best Regards,

  50. Elf on

    Your book “Creating Mobile Games” is great! Thanks for it.

  51. niyi on

    Hi Carol,

    My question is more random and not really about your book 🙂

    I am wondering if you would be able to recommend a free lance blackberry app developer who would be able to work with me in developing an app and who lives in london or close by. It would be paid for so i would like someone who is pretty good and would have the time and commitment to the project. The app isn’t complicated.

  52. Julio Reguero (San Francisco) on

    Hi Carol,

    I am currently looking for an experienced BlackBerry developer for a 3 month contract, to help me finish the development of a Netflix-based application for BlackBerry.

    Please I would appreciate if you help me out. You can always contact me on my email.



  53. Erum irshad awan on

    hi , i am Blackberry developer , am looking for some freelancer on permanent base work can you help me or refer me .I shall be very thankful to you.

  54. Daniel S. on

    Hi Carol,
    I am a 3D engine developer from Germany. I found your blog when I googled “Spaceship Sprite” while I was playing around with HTML 5 canvas and sound. The result was a very rudimentary game in one html-file showing two of your spaceship sprites in action.

    Sadly I don’t have any webspace where I can put it, but if you send me an email I will send it back as attachment (1MB).


  55. Daniel S. on

    Okay, now there is a temporary address at least:

  56. steve oatman on

    HI. saw your blog, would like to say hi, call or email me steveoatman@*****

  57. Kacey on


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: