mercoledì, 31 dicembre 2008

Everyone will be looking at his own watch tonight around midnight...so why get blind to look at small screen...use a big clock for a big event. This application on GetJar show a big digital watch that can be used for the new year countdown...

BigClock screensghot
Here are the other features:

Features:

Carillon every hour

Vibrate and sound at 15/30/45 minutes.

Alarm

Rotating display

Time adjust *NEW*

Commands:

* - Switch horizontal / vertical display

# - Format: 24h / 24h without seconds / 12h AM-PM

0 - Flash every second (use as emergency beacon!)

1 - Change foreground color

2 - Time adjust

3 - Change background color

4 - Sound enable / disable (does NOT override alarm)

6 - Vibra enable / disable

7 - Backlight enable / disable (overrides `0`)

8 - Alarm menu

9 - Quit

 

Said that...download it and HAPPY NEW YEAR!

 

 



Did you like the article? Buy me a coffee!

postato da: emanuelepec alle ore 08:35 | Permalink | commenti
categoria:j2me, application


mercoledì, 24 dicembre 2008

The string is the java object for which the '+' operator causes an overhead because its use produces either a new String and a new StringBuffer.

A solution to avoid this overhead is use a StringBuffer when you need String concatenation for example inside a loop.

Best is to manage everything with chars array. That's very useful in your own code but less if you need to use external API that requires strings as arguments: you need to create a string object anyway and the char array's advantage is lost.


Did you like the article? Buy me a coffee!

postato da: emanuelepec alle ore 18:14 | Permalink | commenti
categoria:tipsandtricks, j2me


sabato, 20 dicembre 2008

Opera Mini is one of the best J2ME application ever and on 25th of November the new version 4.2 is available. Some new nice feature have been added:
  • Synchronize, edit and delete notes via Opera Link
  • 24 new languages
  • Better handling of RTSP, enabling more users to watch video (from You Tube Mobile for example...)
  • Skins are back (along with new skins)
  • "Accept" link at the end of the EULA (for BlackBerry users)
The developers are also working on the global load balancing for all the users.

Here is a screenshot of the application:

opera_mini4.2You can download Opera Mini clicking here


Did you like the article? Buy me a coffee!

postato da: emanuelepec alle ore 17:01 | Permalink | commenti
categoria:opera, j2me, application


venerdì, 12 dicembre 2008

The following article shows how a simple mp3 file in your jar application can be played using the mmapi classes (included in the JSR-135 optional package or in all the MIDP 2.0 devices which include a subset of mmapi).

Suppose the file is sound.mp3. You can create a class implementing this method:

    public void playSound(final String soundFile, final Display display) {  
        try {
            InputStream is =
                getClass().getResourceAsStream( "/sound.mp3" );
           
            Player player = Manager.createPlayer( is, "audio/mpeg" );
            player.addPlayerListener( this );
            player.realize();
            player.prefetch( );
            player.start();
        }
        catch ( Exception e ) {        
            e.printStackTrace();
           
            if ( player != null ) {
                player.close();
                player = null;
            }
        }
    }


In the method we have added a PlayerListener (player.addPlayerListener( this )) so we suppose the class implementing the playSound method implements the following PlayerListener interface playerUpdate ( Player player, String event, Object arg2 ) method:

public void playerUpdate ( Player player, String event, Object arg2 ) {
        if ( event.equals( STOPPED ) || event.equals( ERROR ) || event.equals( END_OF_MEDIA ) ||  event.equals( DEVICE_UNAVAILABLE ) || event.equals( CLOSED ) ) {
           
player.deallocate();
            player.close();
            player = null;
        }
    } 


This method frees resources when the player ends the sound playback or an unexpected error occurs. The same method can be used to play sound from network or using the FileConnection API (in those case the URL of the file changes).


Did you like the article? Buy me a coffee!

postato da: emanuelepec alle ore 09:18 | Permalink | commenti
categoria:tipsandtricks, j2me, mmapi


Blogs Directory