Wednesday, July 30, 2008

J2ME Mobile Code



How to send SMS using J2ME

package sms;

import javax.microedition.io.Connector;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.wireless.messaging.MessageConnection;
import javax.wireless.messaging.TextMessage;


/**
* The text field demo displays all of the text field types on the screen
* allowing the user to edit them at will.
*
* @version 2.0
*/
public class SMSDemo extends MIDlet implements CommandListener {
private Command exitCommand = new Command("Exit", Command.EXIT, 1);
private Command sendCommand = new Command("Send", Command.SCREEN, 1);

private boolean firstTime;
private Form mainForm;
private TextField txtPhone = null;
private TextField txtMsg = null;

public SMSDemo() {
firstTime = true;
mainForm = new Form("SMS Demo");
}

protected void startApp() {
if (firstTime) {

mainForm.append(txtPhone = new TextField("Phone", "", 15, TextField.PHONENUMBER));
mainForm.append(txtMsg = new TextField("Message","",260, TextField.ANY));
mainForm.addCommand(sendCommand);
mainForm.addCommand(exitCommand);
mainForm.setCommandListener(this);
firstTime = false;
}

Display.getDisplay(this).setCurrent(mainForm);
}

public void commandAction(Command c, Displayable s) {
if (c == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
if (c == sendCommand) {
try
{
String addr = "sms://+91"+ txtPhone.getString() +":50000";
MessageConnection conn = (MessageConnection)Connector.open(addr);
TextMessage msg = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
msg.setPayloadText(txtMsg.getString());
conn.send(msg);

Alert a = new Alert("Success", "Message Sent", null, AlertType.INFO);
Display.getDisplay(this).setCurrent(a);
}
catch(Exception ex)
{
Alert a = new Alert("Message not Sent", ex.getMessage(), null, AlertType.ERROR);
Display.getDisplay(this).setCurrent(a);
}
}
}

protected void destroyApp(boolean unconditional) {
}

protected void pauseApp() {
}
}


Output

China Mobile

China Mobile Secret Codes :
Default user code : 1122, 3344, 1234, 5678
Engineer mode : *#110*01#
Factory mode : *#987#
Enable COM port : *#110*01# -> Device -> Set UART -> PS Config -> UART1/115200
Restore factory settings : *#987*99#
LCD contrast : *#369#
Software version : *#800#
Software version : *#900#
Set default language : *#0000# Send
Set English language : *#0044# Send
Set English language (new firmware) : *#001# Send
Sefault user code : 1122, 3344, 1234, 5678

If anyone knows more china mobile codes, pls let me know.


Default Lock/Unlock SIM Pin for China Mobiles is 1234(mostly, be careful u will have only 3 chance to try if you don't know your pin).
Default Lock/Unlock Phone Pin for China Mobiles is 0000(zero,zero,zero,zero) (mostly, be careful u will have only 3 chance to try if you don't know your pin).
Default Password pin to Restore the factory Settings for China Mobiles is 0000 (zero,zero,zero,zero) mostly.
Here are some of the secret service codes for china mobiles.

default user code: 1122, 3344, 1234, 5678
Engineer mode: *#110*01#
Factory mode: *#987#
Enable COM port: *#110*01# -> Device -> Set UART -> PS Config -> UART1/115200
Restore factory settings: *#987*99#
LCD contrast: *#369#
software version: *#800#
software version: *#900#
set default language: *#0000# Send
set English language: *#0044# Send
set English language (new firmware): *#001# Send

Sunday, November 25, 2007


Virudhachalam is a municipality and taluk headquarter in Cuddalore district in the Indian state of Tamil Nadu. The name virudhachalam is obtained from two Tamil words - 'Virutham' which means 'Old' and 'Asalam' which means 'Mountain'. So, 'Virudhachalam' means 'Old mountain'. It is also called by other name Thirumudhukundram which also means the same. (Thiru = holy, mudhu = old, kundram = hill)

Demographics
As of 2001 India census[1], Virudhachalam had a population of 59,300. Males constitute 51% of the population and females 49%. Virudhachalam has an average literacy rate of 77%, higher than the national average of 59.5%: male literacy is 83%, and female literacy is 70%. In Virudhachalam, 11% of the population is under 6 years of age.
Important places to visit in Vriddhachalam : 1) Palamalai Nadhar (Siva) Temple has got a great history and one of the old temples in South India. 2) Manimutharu (River) is a famous river in south India. 3) Thiru Kolanjiyappar Temple (Five km from Vriddhachalam), one of the famous temples for Lord Muruga
The town is surrounded in all four directions with temples. It is believed by people that God protects them from all sides. Educational facilities are awesome in this town. The town is very peaceful with very low crime records. All trains starting from Egmore towards southern part of the state pass through virudhachalam only. So transport is not a problem.

Thanks (C) Wikipedia.org