display.setCurrent(null);
To check if the cal was succesfull, we can use the isShown() method of the class displayable. So if m_disp is your displayable you can use:
if ( m_disp.isShown() ) { // method didn't work } else { // app is in background }
display.setCurrent(null);
if ( m_disp.isShown() ) { // method didn't work } else { // app is in background }
Google announced the adding of new features to their Google Maps on Wednesday 17th. The most important is Street View coming with the same street-level imagery available on desktop. You can use the Street View feature clicking on the apposite command after a search or clicking on a map and selecting "Street View".
Another interesting feature is the introduction of the business reviews: now it is possible know in advance if visit a store worths or not.
Also the walking directions introduced recently in the desktop version are available in the mobile application.
The search speed and the accuracy of the location has been also improved. Users with J2ME phone and BlackBerry can now enjoy the new features!
The new Opera Mini 4.1 lets you search for text within a Web page so you can get to the information you need even quicker than before.
When typing Web addresses, Opera Mini 4.1 will recognize and suggest completions for you based on your Bookmarks and browsing history, making address input faster, easier and much more intuitive.
On phones with File connection API, you can now upload and download files using Opera Mini 4.1, without being re-routed to your phone’s native browser. Update your blog while on the go. Upload photos to your Web site or social network. Add attachments easily to Web-based email, and download other non media-rich content to your phone using Opera Mini 4.1.
On phones with File Connection API, Opera Mini 4.1 lets you save pages for offline viewing so you can quickly access and read your desired Web content, even when you’re on a plane, in the subway, or in other places where you can’t get network reception. Depending on your phone, you may need to choose a destination folder for storing pages for offline viewing.
Now, we have only to try it!
The MIDP 2.0 specification says:
For some devices the keys used for commands may overlap with the keys that will deliver key code events to the canvas. If this is the case, the device will provide a means transparent to the application that enables the user to select a mode that determines whether these keys will deliver commands or key code events to the application.
//Softkeys...
public static int LeftSoftKey = 0;
public static int RightSoftKey = 0;
Thread myThread = new ReturnSoftKeys();
myThread.run();
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
}
}
}
}
}
}
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();