martedì, 23 ottobre 2007

Sometimes it is useful to know informations about the J2ME platform running in a devices. To get this data it is possible use the System class and its method getProperty().

Both standard properties and brand's specific properties exist.

At this URL:
www.forum.nokia.com/info/sw.nokia.com/id/37086440-dcce-4fb4-aa3e-8d8c16d62b33/MIDP_System_Properties_v1_2_en.zip.html

you can find a document from Nokia Forum where a list of system properties is shown. You'll see some specific Nokia properties also.


Did you like the article? Buy me a coffee!

postato da: emanuelepec alle ore 19:51 | Permalink | commenti
categoria:nokia, tipsandtricks, j2me


lunedì, 15 ottobre 2007

Sony Ericsson logo


The registered Sony Ericsson Developers Community members have now the opportunity to test their own application on pre-commercial phones.This is an online services which:
  • is a global service, 24 hours a day, 7 days a week
  • is convenient: no shipping of phones or firmware updating required
  • has selected 2007 phones, representative of JP-7, JP-8 and UIQ 3
  • can test key presses and network behavior
  • has on-line session reservation, virtual view of phone and real-time results
  • for one hour testing slot per phone, $18-20 (USD) per hour depending on selected monthly package
Link: developer.sonyericsson.com/site/global/products/virtuallab/p_virtual_lab.jsp


Did you like the article? Buy me a coffee!

postato da: emanuelepec alle ore 20:54 | Permalink | commenti
categoria:sony ericsson, mobile phones, emulators


domenica, 07 ottobre 2007

Surfing on Internet, I found this post in the Sony Ericsson Developer Forum. I've not tested it yet but it seems a good idea!

I'm going to test it in the next days....if someone wants do the same here is the link:


http://developer.sonyericsson.com/thread.jspa?threadID=41399&tstart=0

...in main class (Presentacion.java):

//Softkeys...
public static int LeftSoftKey = 0;
public static int RightSoftKey = 0;



...while a splash screen is showing:

Thread myThread = new ReturnSoftKeys();
myThread.run();


...in some point, inside the main class:

private class ReturnSoftKeys extends Thread{

public void run(){

try {
Class.forName("com.siemens.mp.lcdui.Image"); // Set Siemens specific keycodes
Presentacion.LeftSoftKey = -1;
Presentacion.RightSoftKey = -4;
} catch (ClassNotFoundException ignore) {

try {
Class.forName("com.motorola.phonebook.PhoneBookRecord"); // Set Motorola specific keycodes
if (getKeyName(-21).toUpperCase().indexOf("SOFT") >= 0) {
Presentacion.LeftSoftKey = -21;
Presentacion.RightSoftKey = -22;
} else {
Presentacion.LeftSoftKey = 21;
Presentacion.RightSoftKey = 22;
}
} catch (ClassNotFoundException ignore2) {
boolean found;

// check for often used values
// This fixes bug with some Sharp phones and others
try {
if (getKeyName(21).toUpperCase().indexOf("SOFT") >= 0) { // Check for "SOFT" in name description
Presentacion.LeftSoftKey = 21; // check for the 1st softkey
Presentacion.RightSoftKey = 22; // check for 2nd softkey
found=true;
}

if (getKeyName(-6).toUpperCase().indexOf("SOFT") >= 0) { // Check for "SOFT" in name description
Presentacion.LeftSoftKey = -6; // check for the 1st softkey
Presentacion.RightSoftKey = -7; // check for 2nd softkey
found=true;
}
}catch(Exception e) {}


for (int i=-127;i<127;i++) { // run thru all the keys
try {
if (getKeyName(i).toUpperCase().indexOf("SOFT") >= 0) { // Check for "SOFT" in name description
if (getKeyName(i).indexOf("1") >= 0) Presentacion.LeftSoftKey = i; // check for the 1st softkey
if (getKeyName(i).indexOf("2") >= 0) Presentacion.RightSoftKey = i; // check for 2nd softkey
}
}catch(Exception e){ // Sony calls exception on some keys

//I change this, the following lines will be commented
//Presentacion.LeftSoftKey = -6; // including softkeys
//Presentacion.RightSoftKey = -7; // bugfix is to set the values ourself
}
}
}
}
}
}


At this point, if the ReturnSoftKeys method failed, the values of the softkeys are 0. This could be because a exception crashes the method. Usually getKeyName

inside the keypressed method:

public void keyPressed(int code) {

int gameAction = getGameAction(code);
//bla bla bla

if (this.LeftSoftKey != 0 || this.RightSoftKey != 0){ //The ReturnSoftkeys method was a success

if (code == this.LeftSoftKey){

softKeyIzquierda();
}

else if (code == this.RightSoftKey){

softKeyDerecha();
}
}

//ReturnSoftKeys was a failure, looking for SOFT in the key name
else {

if (getKeyName(code).toUpperCase().indexOf("SOFT") >= 0) { // Check for "SOFT" in name description

if (getKeyName(code).indexOf("1") >= 0 || getKeyName(code).toUpperCase().indexOf("LEFT") >= 0){

softKeyIzquierda(); // check for the 1st softkey
}

if (getKeyName(code).indexOf("2") >= 0 || getKeyName(code).toUpperCase().indexOf("RIGHT") >= 0){

softKeyDerecha();
}
}

//the name of the key doesn't include "soft". for example if is in spanish: "tecla Accion" instead "soft" I assign the value manually
else{

if( code == (-6) || code == (-202) || code == (-21) || code == (-11)/* || code == (-1) */){

softKeyIzquierda();
}

else if(code == (-7) || code == (-203) || code == (-22)/* || code == (-4)*/){

softKeyDerecha();
}
}
}

repaint();
 


Did you like the article? Buy me a coffee!

postato da: emanuelepec alle ore 19:45 | Permalink | commenti
categoria:tipsandtricks, j2me


martedì, 02 ottobre 2007

At this link, we can find several interesting J2ME system properties useful when we are working with File Connection API and we want know, for example, names and path of some directories.

The link is from Forum Nokia website but is a good start for all the devices supporting this optional package.

www.forum.nokia.com/document/Java_ME_Developers_Library_v1/GUID-545CA84A-8378-4DFA-9035-94479F5BE26E.html




Did you like the article? Buy me a coffee!

postato da: emanuelepec alle ore 19:29 | Permalink | commenti
categoria:nokia, tipsandtricks, j2me, mobile phones, emulators


lunedì, 01 ottobre 2007

When we are working with FileConnection API, it's good to have an easy way to put file in the file system of the emulator to test at least the read side of our midlets.

If we are using the Nokia Serie 60 3rd edition FP1 emulator we can find the filesystem at

C:\Nokia\Devices\S60_3rd_MIDP_SDK_FP1\bin\epoc32\winscw\c\

(supposing we have installed the SDK under C:\).

If you enter in the "Data" folder, you can then see the folders for the files like Images, Sounds, etc.


Did you like the article? Buy me a coffee!

postato da: emanuelepec alle ore 21:37 | Permalink | commenti
categoria:nokia, tipsandtricks, j2me, emulators


Blogs Directory