By using this code we can send SMS from J2ME application.
public class SMSSender implements Runnable {
private String message;
private String phoneNumber;
private AmarMIDlet midlet;
private MessageConnection smsconn = null;
public SMSSender(AmarMIDlet midlet) {
this.midlet = midlet;
}
public void run() {
try {
// Open the message connection.
smsconn = (MessageConnection) Connector.open("sms://:50001");
// Create the message.
TextMessage txtmessage = (TextMessage) smsconn.newMessage(MessageConnection.TEXT_MESSAGE);
txtmessage.setAddress("sms://+" + phoneNumber);// !!
txtmessage.setPayloadText(message);
smsconn.send(txtmessage);
} catch (Exception e) {
midlet.displayAlert(e.toString());
}
if (smsconn != null) {
try {
smsconn.close();
} catch (IOException ioe) {
ioe.printStackTrace();
midlet.displayAlert(ioe.toString());
}
}
}
public void send(String message, String phoneNumber) {
this.message = message;
this.phoneNumber = phoneNumber;
Thread t = new Thread(this);
t.start();
}
}
Thursday, July 31, 2008
Make a Call with J2ME application
You can do it by using the method platformRequest().
public class PhoneCall extends MIDlet {
public void startApp() {
System.out.println("will call now");
boolean possible = false;
try {
possible = this.platformRequest("tel:01911008019");
} catch (Exception e) {
Alert alert = new Alert(e.getMessage());
Display.getDisplay(this).setCurrent(alert, Display.getDisplay(this).getCurrent());
}
Alert alert = new Alert("it's " + possible);
Display.getDisplay(this).setCurrent(alert, Display.getDisplay(this).getCurrent());
}
protected void pauseApp() {
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
}
}
public class PhoneCall extends MIDlet {
public void startApp() {
System.out.println("will call now");
boolean possible = false;
try {
possible = this.platformRequest("tel:01911008019");
} catch (Exception e) {
Alert alert = new Alert(e.getMessage());
Display.getDisplay(this).setCurrent(alert, Display.getDisplay(this).getCurrent());
}
Alert alert = new Alert("it's " + possible);
Display.getDisplay(this).setCurrent(alert, Display.getDisplay(this).getCurrent());
}
protected void pauseApp() {
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
}
}
Wednesday, July 30, 2008
J2ME: Identification of Location API in mobile
Before using the Location API we need to know whether the api is in the mobile or NOT.
import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.*;
public class IdentifyLocationAPI extends MIDlet implements CommandListener {
private Display mDisplay;
private Alert alert;
public void startApp() {
mDisplay = Display.getDisplay(this);
//It will return the version number
String s=System.getProperty("microedition.location.version");
alert=new Alert("Information",s,null,null);
alert.setTimeout(Alert.FOREVER);
mDisplay.setCurrent(alert);
}
public void commandAction(Command c, Displayable s) {
}
public void pauseApp() {
}
public void destroyApp (boolean unconditional) {
}
}
import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.*;
public class IdentifyLocationAPI extends MIDlet implements CommandListener {
private Display mDisplay;
private Alert alert;
public void startApp() {
mDisplay = Display.getDisplay(this);
//It will return the version number
String s=System.getProperty("microedition.location.version");
alert=new Alert("Information",s,null,null);
alert.setTimeout(Alert.FOREVER);
mDisplay.setCurrent(alert);
}
public void commandAction(Command c, Displayable s) {
}
public void pauseApp() {
}
public void destroyApp (boolean unconditional) {
}
}
Jaane Tu Ya Jaane Na: Movie Review
The story begins at the airport. With a story. When Rotlu, Jiggy, Bombs and Shaleen offer to tell Mala the tale of Jai and Aditi.

The story is simple but entertainer. It started like the movie "Chalte Chalte" and ends with the movie "Ashiqi". I mean, the whole thing is seems to be familiar. Its kind of traditional hindi movie.
The first half of the movie is just without any fact, any twist ..... but enjoyable if it can be enjoyed with the friends. But the second half...it must need something....but i didnt find anything. The actors are not up to the mark though many told that they have done outstanding.
The music was good enough. And the Nasiruddin in the portrait was funny character.
Verdict:
Its good not better. Nothing new.

The story is simple but entertainer. It started like the movie "Chalte Chalte" and ends with the movie "Ashiqi". I mean, the whole thing is seems to be familiar. Its kind of traditional hindi movie.
The first half of the movie is just without any fact, any twist ..... but enjoyable if it can be enjoyed with the friends. But the second half...it must need something....but i didnt find anything. The actors are not up to the mark though many told that they have done outstanding.
The music was good enough. And the Nasiruddin in the portrait was funny character.
Verdict:
Its good not better. Nothing new.
Sarkar Raj: Movie Review
Cast: Amitabh Bachchan, Abhishek Bachchan, Aishwarya Rai
Director: Ram Gopal Varma

Sarkar Raj featuring Bollywood’s first family is a mediocre sequel to Ram Gopal Varma’s unimpressive Godfather-inspired 2005 gangster flick Sarkar.
A gangstar movie need a lot of blood and gore. But There’s just no velocity in Sarkar Raj, the movie is all flat. Its full of talking , most of the shot is taken in soft lighting. And lot of work is done on shade.
Verdict:
Its not bad .... not bad at all. But not good either.
Director: Ram Gopal Varma

Sarkar Raj featuring Bollywood’s first family is a mediocre sequel to Ram Gopal Varma’s unimpressive Godfather-inspired 2005 gangster flick Sarkar.
A gangstar movie need a lot of blood and gore. But There’s just no velocity in Sarkar Raj, the movie is all flat. Its full of talking , most of the shot is taken in soft lighting. And lot of work is done on shade.
Verdict:
Its not bad .... not bad at all. But not good either.
Monday, July 28, 2008
Get SQLTEXT from the snapshots with CPU_TIME
/*
FOR EXECUTION : EXECUTIONS_DELTA
FOR CPU TIME: CPU_TIME_DELTA
FOR DISK READ: DISK_READS_DELTA
FOR BUFFER GETS: BUFFER_GETS_DELTA
*/
SELECT SQL_TEXT,X.CPU_TIME FROM DBA_HIST_SQLTEXT DHST,
(SELECT DHS.SQL_ID SQL_ID,SUM(DHS.CPU_TIME_DELTA) CPU_TIME
FROM DBA_HIST_SQLSTAT DHS
WHERE DHS.SNAP_ID IN(SELECT SNAP_ID FROM DBA_HIST_SNAPSHOT
WHERE BEGIN_INTERVAL_TIME>=TO_DATE('07/20/2008','MM/DD/YYYY')
AND END_INTERVAL_TIME<=TO_DATE('07/27/2008','MM/DD/YYYY'))
GROUP BY DHS.SQL_ID) X WHERE X.SQL_ID=DHST.SQL_ID
ORDER BY X.CPU_TIME DESC;
FOR EXECUTION : EXECUTIONS_DELTA
FOR CPU TIME: CPU_TIME_DELTA
FOR DISK READ: DISK_READS_DELTA
FOR BUFFER GETS: BUFFER_GETS_DELTA
*/
SELECT SQL_TEXT,X.CPU_TIME FROM DBA_HIST_SQLTEXT DHST,
(SELECT DHS.SQL_ID SQL_ID,SUM(DHS.CPU_TIME_DELTA) CPU_TIME
FROM DBA_HIST_SQLSTAT DHS
WHERE DHS.SNAP_ID IN(SELECT SNAP_ID FROM DBA_HIST_SNAPSHOT
WHERE BEGIN_INTERVAL_TIME>=TO_DATE('07/20/2008','MM/DD/YYYY')
AND END_INTERVAL_TIME<=TO_DATE('07/27/2008','MM/DD/YYYY'))
GROUP BY DHS.SQL_ID) X WHERE X.SQL_ID=DHST.SQL_ID
ORDER BY X.CPU_TIME DESC;
Thursday, July 24, 2008
ORA-12712: new character set must be a superset of old character set.
We can get the following error while changing the character set in oracle.
SQL> Alter database CHARACTER SET UTF8;
Alter database CHARACTER SET UTF8
*
ERROR at line 1:
ORA-12712: new character set must be a superset of old character set
Then what we have to do,
SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE UTF8;
Database altered.
SQL>
SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
After restarting verify the nls_parameters..
SQL> select * from v$nls_parameters;
SQL> Alter database CHARACTER SET UTF8;
Alter database CHARACTER SET UTF8
*
ERROR at line 1:
ORA-12712: new character set must be a superset of old character set
Then what we have to do,
SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE UTF8;
Database altered.
SQL>
SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
After restarting verify the nls_parameters..
SQL> select * from v$nls_parameters;
Subscribe to:
Posts (Atom)
search engine
Custom Search