Updates from January, 2009 Toggle Comment Threads | Keyboard Shortcuts

  • pit 12:46 pm on January 26, 2009 Permalink | Reply
    Tags: facebook, ,   

    Like Gcal? Became a fan! :) 

    As you know, Gcal is a free Google Calendar client for (quite) all Java enabled mobile phones. If you like it and want to give your support, now you can join the Gcal fan crew on Facebook!

    Becoming a fan, you’ll automatically receive all future Gcal updates and, and can share your thoughts and feedback with other Gcal users.

    And, above all, you’ll make my coding nights happier :D

    • mario 7:32 pm on August 24, 2009 Permalink

      …ma perchè lo vogliono togliere???

  • pit 1:04 pm on January 25, 2009 Permalink | Reply
    Tags: , , image reflection, , , ,   

    J2ME Images: how to create a reflection effect 

    It’s surely time for some new J2ME tutorial, so this article will explain how to create a nice reflection effect starting from a simple Image.

    You can see the final effect, as usual, on the emulator page: J2ME Image reflection in action.

    Source code

    1. Method declaration

    Let’s start by our method declaration:

    public static Image createReflectedImage(Image image, int bgColor, int reflectionHeight)

    We have 3 arguments:

    • the original image that we want to reflect
    • the background color (used for transparent images)
    • the height of the reflection effect

    2. The mutable Image

    Now, let’s create the mutable Image that will hold the resulting effect:

    int w = image.getWidth();
    int h = image.getHeight();
    Image reflectedImage = Image.createImage(w, h + reflectionHeight);

    We store the original image width and height into 2 int variables, and then create the mutable image with the same width, but with an height equal to h (the original image) plus the specified reflection height.

    3. Copy the original Image

    Now, first drawing steps are:

    1. Getting the Graphics object of our mutable image
    2. Filling the image with the background color
    3. Drawing the original image on the upper part of the mutable one
    Graphics g = reflectedImage.getGraphics();
    g.fillRect(0, 0, w, h + reflectionHeight);
    g.drawImage(image, 0, 0, Graphics.TOP | Graphics.LEFT);

    4. Create the reflection effect

    Now, let’s get to the important part of this tutorial, that is the reflection effect itself:

    • for each horizontal line of the reflected image part, take the corresponding vertical coordinate of the original image
    • get the RGBA data of the corresponding horizontal line of the original image
    • calculate the alpha to be applied to this line, and apply it to each element of the RGB data array
    • draw the RGB data into the reflected image, by using its Graphics object

    And here is the source code:

    int[] rgba = new int[w];
    int currentY = -1;
    for(int i = 0; i < reflectionHeight; i++)
    	int y = (h - 1) - (i * h / reflectionHeight);
    	if(y != currentY)
    		image.getRGB(rgba, 0, w, 0, y, w, 1);
    	int alpha = 0xff - (i * 0xff / reflectionHeight);
    	for(int j = 0; j < w; j++)
    		int origAlpha = (rgba[j] >> 24);
    		int newAlpha = (alpha & origAlpha) * alpha / 0xff;
    		rgba[j] = (rgba[j] & 0x00ffffff);
    		rgba[j] = (rgba[j] | (newAlpha << 24));
    	g.drawRGB(rgba, 0, w, 0, h + i, w, 1, true);

    as you can see, the rgba[] int array holds the current pixel row data, and will be refreshed only when necessary (so, when the y coordinate of the original image changes).

    Sample usage

    Using the above method is really simple, since it’s only necessary to:

    1. Create the original Image
    2. Call createReflectedImage() method by passing the original Image as argument, together with the background color and the reflection effect height
    Image originalImage = Image.createImage("/cap_man1.png");
    Image reflectedImage = ReflectedImage.create(originalImage, bgColor, 64);


    You can download the complete source code of this article here:

    Vote this article!

    If you liked this tutorial, feel free to vote it on Forum Nokia Wiki: How to create an image reflection effect in Java ME

    • ion 9:51 am on February 5, 2009 Permalink

      hi.. nice code

      could you help me how to draw a “Justified” Paragraf in canvas…. please !!

  • pit 9:38 am on January 20, 2009 Permalink | Reply
    Tags: , , , wallpapers, web2.0   

    Pikkoo gets launched: express your mobile creativity! 

    After 3 days in the cold and magic lands of Calabria, I found great news from Kuneri team: Pikkoo, the first community to create, share and download mobile wallpapers and screensavers, gets launched!

    What’s great about this project?

    • You can create your screensavers and wallpapers in a snap! No graphic skills? No problem at all! Just drag the elements you want, choose colors, enter texts, define animations, and you’re done!
    • Do you think your creations are great? Share them! Not only on Pikkoo gallery, but also on your favorite social websites, with the cool Pikkoo social apps!
    • It’s FREE!

    Still waiting? Just give it a try, and create your new mobile style!

  • pit 10:53 am on January 11, 2009 Permalink | Reply
    Tags: , , gcal update, , , ,   

    Gcal update: version 0.2 released! 

    NEW: check out the new Gcal 0.3 version!

    Holidays are gone, but gifts are not! So, here’s a big update to Gcal, the J2ME Google Calendar client: version 0.2 is available for download!

    Thanks to your precious support and feedback a lot of improvements and bug fixes have been done: thank you all (and please don’t stop :) )!

    New features of this version include:

    • Check for updates and auto-update features: you can now manually check for updates, or switch on auto-updates (from Settings screen) to always get the latest Gcal releases!
    • More control over events: delete, duplicate and copy an event from a calendar to another in a snap!
    • Comments: It’s now possible to add and view comments for an event
    • More event details: event visibility (private/public) and available/busy status now available when creating an event
    • Map viewing: different types of maps have been added, so you can now switch among satellite/terrain and other views
    • Sending an event, with his details, via SMS

    Important bugs fixed in this release:

    • Character encoding: terrible lack of first versions, character encoding should now correctly work
    • Wrong time when creating/showing events, with some timezones
    • Events order sometimes scrambled
    • Wrong login error messages: now, different types of errors are correctly handled
    • Calendars filter sometimes resetted without changing the account
    • Different types of errors and Exceptions when receiving events (e.g.: on Nokia S40 devices)

    Many other minor fixes have been done, so it’s highly recommended to upgrade your Gcal to 0.2 version. As always, for any kind of feedbacks or bug report, please leave a comment here :)

    • Jack 12:34 pm on January 13, 2009 Permalink

      Still having problems on the INQ1. The app loads fine, and I enter my details, but it gives the error: ‘There was an error while loading calendar data’.

    • Rich G 5:40 pm on January 14, 2009 Permalink

      Great app! I’ve been looking for a j2me google calendar app for quite some time.

      I have a suggestion:

      For those of us who would (either by choice or policy) like to use the application on a blackberry instead of Google Sync, could you provide key mapping to the numeric keypad?

      Something like:
      2 = up
      8 = down
      4 = left
      6 = right

      • = left soft key
      1. = right soft key

      I ask because my 8130 can emulate the left soft key, but can’t figure out how to emulate the right soft key .


    • pit 10:54 pm on January 14, 2009 Permalink

      Hi all!

      @Jack: unfortunately I have not an INQ1 device to test on. Anyway, I’ll dig more into this problem and let you know.

      @Rick: thanks for your appreciation! You’re right: BlackBerry key mapping is not perfect right now. I’ll try to integrate your precious hint into next Gcal versions.

      Thank you all!

    • Rich G 7:04 pm on January 16, 2009 Permalink

      A follow up on my earlier suggestion:

      The absolute easiest way to implement bb support (and isn’t the easiest usually the best) is to trap the right convenience key (keycode: -19) in addition to the other right soft key keycodes on other devices.

      You already trap the bb left convenience key with keycode -21 ;)


    • Mads 7:39 pm on January 19, 2009 Permalink

      Very useful app. Maybe I’m just blind, but is there any way to show more than one day at a time? If not, that’s my number one suggestion for additions.

      I’d love to be able to see one week at a time, either Monday-Sunday or starting with the current day. One month as well would be stellar. I’m not necessarily looking to see every detail of every event for every day, just something like a small mark showing that there are events scheduled for that day would be great. Then the user could go to the specific day for details.

    • pit 10:25 am on January 20, 2009 Permalink

      Hi all!

      @Rich: thanks for the hint! Will surely use it for the next Gcal version :)


    • Yukone 9:42 am on January 21, 2009 Permalink

      Loading error too for me. I have a lg secret. What a pity. :(

    • Julie 11:44 am on January 26, 2009 Permalink

      I’ve just realised there’s another missing function that I use a lot: the ability to copy a calendar item.

      Typically, I’ve just completed an appointment, and book a repeat one for another day.


    • pit 11:50 am on January 26, 2009 Permalink


      @Yukone: I must get some Lg phones to do some tests. Meanwhile, can you please specify where you get the loading error?

      @Julie: the item copy feature is available in version 0.2. When you are in event detail view, just click “Options” -> “Actions”: there you have both “Copy to calendar” and “Duplicate” functions, that should be what you’re looking for :)


    • Julie 7:44 pm on January 26, 2009 Permalink

      Apoliges Pit. I missed the option under edit for duplicating.


    • Yukone 12:38 pm on January 27, 2009 Permalink

      It gives me loading error when trying to load calendar data

    • pit 12:59 pm on January 27, 2009 Permalink


      @Julie: no problem at all :)

      @Yukone: thanks for the feedback, I’ll dig into this and let you know

    • Steve 10:50 am on January 29, 2009 Permalink

      Program is great but all my appointments are showing as ‘all day’ and not showing the appointment times. Am I doing something wrong or do I need to configure something ?

    • aston 7:42 am on January 31, 2009 Permalink

      Blackberry 7290: Error while connection to Google.

      Blackberry 8800:There was an error while loading canlendars data.

      can not use.

    • pit 9:12 pm on February 1, 2009 Permalink


      thank you all for your feedbacks!

      @Steve: it seems like some timezone issues are still there.. can you please tell me your local timezone?

      @aston: BlackBerry is still not yet fully tested (due to lack of devices :)), but next version should be greatly improved this way.


    • aston 5:40 am on February 2, 2009 Permalink

      @Pit Thank you.

      Everyday I come here to see the new version;

    • aston 5:47 am on February 2, 2009 Permalink

      @Pit can u twitter?

      and we can follow u with your new status.

    • pit 10:28 am on February 2, 2009 Permalink

      Hi aston!

      Sure, I’ll post on Twitter future Gcal updates, so It’ll be easier to follow for all :)

      If you’re a FaceBook user, you can also check Gcal page, to be always updated and to share your thoughts and feedback with other Gcal users:


    • aston 7:35 am on February 3, 2009 Permalink

      @Pit waiting the blackberry can use version.

    • Cat 11:01 pm on February 3, 2009 Permalink

      Nice app!

      Unfortunately it also fails with “Error getting calendars data” on my RAZR2. Google’s GMail application works.

      I would be happy to coordinate with you to debug this (I have written J2ME apps before) — just drop me an e-mail.

    • pit 10:06 am on February 4, 2009 Permalink

      Hi Cat!

      Thanks for your feedback. Can you please specify on which exact screen you’re getting that error (e.g.: login/calendar retrieving/events retrieving)?


    • aston 10:10 am on February 4, 2009 Permalink

      When the new version?

    • Danik 4:35 pm on February 5, 2009 Permalink

      Hi there! I’d just so much like to say “Great job!” but sadly the app is for the last few minutes just downloading calendar data so I can’t really appreciate all its functions (dunno if it is my calendar being that big or some strange bug somewhere) but nevermind – I’d like to say at least “Keep up!” This is something I’ve always yearned for :o)

      // I’m using a Nokia E61 / Symbian S60 3rd, should be OK… hope se :o)

    • pit 5:16 pm on February 5, 2009 Permalink

      Hi all!

      @aston: some more days, and it’ll be out ;)

      @Danik: thanks for the feedback! This is effectively a bug, but it has been fixed and will be totally solved by next Gcal version (like said to aston, in the very next few days :)).


    • Danik 8:52 pm on February 5, 2009 Permalink

      :o) then as a programmer I have to say Great job, at least for tracing the bug :oD now seriously, I’ve tried GooSync meanwhile just to see and man, it sucks. The only thing it does is provide a syncing server to sync the internal calendar (which sucks) through the inbuilt Nokia syncing mechanism (which sucks even more)… so I’m looking very much forward to the next release! :o) Thank you and keep rollin’!

    • David Kinlay 10:35 am on February 7, 2009 Permalink

      Every time I try to download GCal (latest version), it causes my phone to crash. Why?
      Can download other midlets.
      Reply asap

    • pit 11:09 am on February 9, 2009 Permalink


      @Danik: thanks :))

      @David: are you trying downloading the MIDlet directly from your device? Which phone are you using?


    • Stefan 10:44 am on February 12, 2009 Permalink

      using GCal 0v2 on a Sony Ericsson K850i – works great.

      Bug found a small annoying bug in the sort order with recurring events.
      Seems like you use the whole date not just the time in your sorting so the recurring events show up prior to one off events of the actual day in the agenda view.
      Example setup:
      1) Recurring daily event, 10:00, event series started 13/02/2009
      2) Single event, 14/02/2009 9:00
      -> on the events overview for 14/02/2009 the recurring 10:00 event is listed first, the 9:00 event second – but it should be vice versa…

      Second issue discovered when playing around with the “Filter calendars” function. Looks like only the first 8 calendars can be (un)selected. the cursor refuses to jump to the 9th item. Maybe device related, didn’t check on other mobiles.

      Nevertheless very good stuff and feels very stable already. Looking forward to the next release ;-)


    • pit 11:07 am on February 12, 2009 Permalink

      Hi Stefan,

      thanks for your feedback!

      About the events order: yes, there’s some problem with recurring events, but it’ll be surely fixed for the next release.

      Second issue is already solved: so, this fix also will be available in next release, that should be during this week :)


    • pascal 2:55 pm on February 12, 2009 Permalink

      Dude this seems like a great app
      I’ve a N73 nokia
      it’s stuck in the Initializing screen,
      I’m trying to reach a mapped calendar

    • Chris 3:57 pm on February 12, 2009 Permalink

      Any chance the new release this week will have the diagnostic mode you mentioned earlier? I am very interested in diagnosing the connection problem with my Helio Ocean, thanks for all the hard work:)

    • pit 4:01 pm on February 12, 2009 Permalink

      Hi Chris,

      this week a new Gcal version will be released, that will include a lot of bug fixes and important new features.

      Give it a try, to see if it solves issues on your Ocean, otherwise I’ll send you a debug version to dig into your specific problems.


    • javil 12:09 am on May 6, 2011 Permalink

      can i use QCal offline in my movile phone?

compose new post
next post/next comment
previous post/previous comment
show/hide comments
go to top
go to login
show/hide help
shift + esc