giovedì, 09 ottobre 2008
Finally also LG has his own developer site where we can find documentation, emulators and SDK. Their phones were some of the most misterious devices on the market for the developers.
To see the new developer site click
here
Did you like the article? Buy me a coffee!
mercoledì, 23 luglio 2008
If you want to set the volume in the MediaPlayer using the following code:
InputStream is = getClass().getResourceAsStream( "/sound.amr" );
Player player = Manager.createPlayer(is, soundType);
player.addPlayerListener( this );
player.realize();
VolumeControl volumeControl =
(VolumeControl) player .getControl( "VolumeControl" );
if ( volumeControl != null ) {
volumeControl.setLevel( volume );
}
when you launch the player with:
player.start();
no sound can be heard on the LG KE970 Shine without getting any error.
This device requires to get the prefetched status if you want to set the volume and play the sound correctly. The working code is then:
InputStream is = getClass().getResourceAsStream( "/sound.amr" );
Player player = Manager.createPlayer(is, soundType);
player.addPlayerListener( this );
player.realize();
player.prefetch( );
VolumeControl volumeControl =
(VolumeControl) player .getControl( "VolumeControl" );
if ( volumeControl != null ) {
volumeControl.setLevel( volume );
}
Maybe other phones are affected as well (especially LG). Post comment if you other phones with the same problem.
Did you like the article? Buy me a coffee!
venerdì, 29 febbraio 2008
The platformRequest method is a very useful method to start an external application from within a J2ME application. Typical use of that is call it (the method belongs to the Midlet class) passing an url to open the device default browser or to place a phone call. Examples:
platformRequest( "http://j2mesoccer.splinder.com") ;
platformRequest( "tel:3351111111");
The LG phones (at least those three I've tried) have a bug and the platformRequest doesn't work (in both the previous cases). A connectionNotFoundException is raised when the call is placed.
The three tested phones are:
- LG P7200
- LG KG320
- LG KG800 Chocolate
If anyone knows other devices with the same behaviour or a workaround for the problem, post a comment.
Did you like the article? Buy me a coffee!