Stardate 20040101, somewhere in the Milky way galaxy: Enterprise has encountered a strange entity, which has identified itself as....The Blog
Thursday, November 18, 2004
Thursday, November 11, 2004
Cellphone Tricks and codes
· How to copy & paste text in your Nokia 3650:
Press and hold the pencil key and select your text using the scroll key.
Left function key will change to 'Copy'. Press it to copy the selected text to clipboard.
You can paste the clipboard contents the same way:
press and hold the pencil key and press 'Paste'. Or, press pencil key once and select 'Paste'.
· Press and hold the Menu key to open the application switching window, where you can *duh* switch between applications.
If a program hangs and you can't shut it down, select the application in the
application switching window and press 'C' to kill it. It's also a faster way to exit programs.
· Turn on/off the "click" sound made by the camera by selecting the 'Silent' profile or by turning warning tones on/off:
Menu > Profiles > "select your activated profile" > Personalise > Warning tones > On/Off.
(This also effects the sound of Java games and apps).
· To change background image go to:
Menu > Tools > Settings > Phone > Standby mode > Background image > Yes > "choose an image".
The best size for background images is 174x132 pixels.
· Only got blue, green and purple in your 3650 colour palette?
This free app adds 3 more colours: Palette Extender.
· Display an image when someone's calling:
Menu > Contacts > "select a contact card" > Options > Edit > Options > Add thumbnail > "choose an image".
· Add a personal ringing tone to a contact:
Menu > Contacts > "select a contact card" > Options > Open > Options > Ringing tone > "choose a ringing tone".
· Delete all messages from your Inbox at once:
Menu > Messaging > Inbox > Options > Mark/Unmark > Mark all > Options > Delete.
· Send or hide your caller ID: Go to: Menu > Tools > Settings > Call > Send My
Caller ID > 'Yes', 'No' or 'Set By Network' to follow the default settings of your home network.
· If you often copy large files to your MultiMedia Card, I recommend a card reader.
E.g. With a card reader it takes only 12 seconds to copy a 10 MB file!
· Record the sound of a phone call using the (sound) Recorder.
Menu > Extra's > Recorder > Options > Record sound clip.
Note: short beeps are audible during call registration.
But there is a 60 second limitation so if you want unlimited sound recording get this app: Extended Recorder.
· While writing text, press "#" to switch between upper and lower case and Dictonary on/off (predictive text input).
Press and hold "#" to switch between Alpha mode and Number mode.
· Keyboard shortcuts for zooming and rotating images in Images:
1 = zoom in, 0 = zoom out, press and hold to return to the normal view.
2 = rotate anticlockwise, 9 = rotate clockwise, * = full screen.
· In standby mode, press and hold the right soft key to activate voice dialling.
To add a voice tag to a phone number, open a contact card and scroll to the phone number and select:
Options > Add voice tag.
· You can customize both soft keys located below the screen (in standby mode):
Menu > Tools > Settings > Phone > Standby mode > Left/Right selection key > "select an application".
· In standby mode. press scroll key center (joystick) to go directly to Contacts.
· In standby mode, press and hold 0 to launch your wap home page.
· In Menu or any subfolder, press numbers 1 - 9 to start the application at that location.
123
456
789
· In standby mode,
45# + dials the number on your sim in memory slot 45.
50# + dials slot 50 and so on.
· If you have your keylock activated just press the on/off button to turn on your backlight
to look at the time when it's dark without having to unlock the keypad.
· Never, ever, in your whole life, install WildSkinz on your Nokia 3650!!! WildSkinz screws up
the whole 3650 system. It was never intended to work on the 3650, only on the 7650.
· Why assigning Video Recorder in the right or left soft key does not work?
(Sound Recorder is launched instead of Video Recorder)
It's a bug with firmware version 2.50.
· How to check your firmware version:
A "Firmware" is the phone's operating system stored in internal Flash memory of the device (disk Z.
Manufacturers release new firmware versions containing bug fixes, improvements and - sometimes - offering new functions.
Firmware upgrade can only be made in authorized Nokia service centre (point).
To check your current firmware version simply type *#0000# on main Phone screen.
· How to check your IMEI (International Mobile Equipment Identity)?
Type *#06# on main Phone screen.
· Start up in Safe Mode so no 'auto start' apps will be running:
To make sure that no memory-resident programs start when you reboot your phone,
hold down the pencil key when you turn on the phone and hold it on untill you have to enter your PIN code.
(When you have trouble booting up the phone with the MMC in it because it got corrupted for some reason, this trick will
almost always let you boot up the phone so you can remove the latest installed app which might have caused the
problem or if your phone is "unrepairable" you can still back up your important data before you do a format.)
· Q: How to totally format your Nokia 3650 and remove all installed applications, user files and restore all
settings to default like it's new out of the box? (OEM apps won't be deleted like Camera and RealOne Player).
A: First Format your MMC: Menu > Extras > Memory > Options > Format mem. card > Yes.
Note: It is very important to format your MMC before you format your phone!
Then format your phone by typing *#7370# on main Phone screen.
Phone will ask: "Restore all original phone settings? Phone will restart." Press 'Yes' and enter your Lock code (default is 12345).
Tip: Formatting takes several minutes so you'd better connect your Nokia 3650
to a charger to ensure that your battery doesn't get empty in the middle of formatting.
Note: All your created acces points and mailboxes will be lost so take a note of them. And all application settings will be reset.
E.g. In Camera, image quality is set back to normal and memory in use is set back to phone memory. And also in Messages,
memory in use is set back to phone memory, etc. Also backup your contacts with PC Suite or a program like Contacts Manage
To reset your wallet, should you forget your code,
Type in:
*#7370925538#
this will reset the wallet code, the wallet contents will be deleted.
>>> Method 1: Flight mode:
Put your phone in "Flight mode" with Psiloc System Tools. Install System Tools, open it and select "Flight mode". This way you can restart the phone without your SIM card so there will be no running phone tasks in the background. Now you can have up to 3,5 MB of free RAM!
Note: ironically enough, Flight mode doesn't work when Smart Launcher is installed, at least in my case.
But i've also heard several reports of people who have both apps running without any problems.
-----------------------------------------------------------------------------------------------
>>> Method 2: Smart Launcher trick:
Install Smart Launcher and open it. Go to Options, Settings and put Launcher ON.
Now plug in your charger and switch off your phone. Wait untill the battery meter appears and short press the Menu button (don't hold).
The menu should appear and now you can have 3,5 to 4,5 MB free RAM! (Hold Menu button to check RAM).
The trick is that with the charger plugged in, the phone must get a minimum software support for charging, even when
the phone is switched off. And somehow Smart Launcher has still got it's shortcut running and that's the Menu button. So when
you press the Menu button, you go directly to the Menu without any other phone tasks running in the background so
you trick the phone and you have more free RAM!
Note: when you unplug the charger, the phone will switch off.
-----------------------------------------------------------------------------------------------
From me: this method I found it by myself, it frees a little about 100~200 KB but I guess it's useful sometime
Close your menu not by selecting the right selection key "exit", or pressing the menu key another time, they only hide the menu app but do not close it, to close it select the left selection key "option" and scroll down and select "exit"
So when you open an app needs more ram reopen menu and close it, it's useful when play low bit rate video in realplayer
Cellphone Tricks and codes
· How to copy & paste text in your Nokia 3650:
Press and hold the pencil key and select your text using the scroll key.
Left function key will change to 'Copy'. Press it to copy the selected text to clipboard.
You can paste the clipboard contents the same way:
press and hold the pencil key and press 'Paste'. Or, press pencil key once and select 'Paste'.
· Press and hold the Menu key to open the application switching window, where you can *duh* switch between applications.
If a program hangs and you can't shut it down, select the application in the
application switching window and press 'C' to kill it. It's also a faster way to exit programs.
· Turn on/off the "click" sound made by the camera by selecting the 'Silent' profile or by turning warning tones on/off:
Menu > Profiles > "select your activated profile" > Personalise > Warning tones > On/Off.
(This also effects the sound of Java games and apps).
· To change background image go to:
Menu > Tools > Settings > Phone > Standby mode > Background image > Yes > "choose an image".
The best size for background images is 174x132 pixels.
· Only got blue, green and purple in your 3650 colour palette?
This free app adds 3 more colours: Palette Extender.
· Display an image when someone's calling:
Menu > Contacts > "select a contact card" > Options > Edit > Options > Add thumbnail > "choose an image".
· Add a personal ringing tone to a contact:
Menu > Contacts > "select a contact card" > Options > Open > Options > Ringing tone > "choose a ringing tone".
· Delete all messages from your Inbox at once:
Menu > Messaging > Inbox > Options > Mark/Unmark > Mark all > Options > Delete.
· Send or hide your caller ID: Go to: Menu > Tools > Settings > Call > Send My
Caller ID > 'Yes', 'No' or 'Set By Network' to follow the default settings of your home network.
· If you often copy large files to your MultiMedia Card, I recommend a card reader.
E.g. With a card reader it takes only 12 seconds to copy a 10 MB file!
· Record the sound of a phone call using the (sound) Recorder.
Menu > Extra's > Recorder > Options > Record sound clip.
Note: short beeps are audible during call registration.
But there is a 60 second limitation so if you want unlimited sound recording get this app: Extended Recorder.
· While writing text, press "#" to switch between upper and lower case and Dictonary on/off (predictive text input).
Press and hold "#" to switch between Alpha mode and Number mode.
· Keyboard shortcuts for zooming and rotating images in Images:
1 = zoom in, 0 = zoom out, press and hold to return to the normal view.
2 = rotate anticlockwise, 9 = rotate clockwise, * = full screen.
· In standby mode, press and hold the right soft key to activate voice dialling.
To add a voice tag to a phone number, open a contact card and scroll to the phone number and select:
Options > Add voice tag.
· You can customize both soft keys located below the screen (in standby mode):
Menu > Tools > Settings > Phone > Standby mode > Left/Right selection key > "select an application".
· In standby mode. press scroll key center (joystick) to go directly to Contacts.
· In standby mode, press and hold 0 to launch your wap home page.
· In Menu or any subfolder, press numbers 1 - 9 to start the application at that location.
123
456
789
· In standby mode,
45# + dials the number on your sim in memory slot 45.
50# + dials slot 50 and so on.
· If you have your keylock activated just press the on/off button to turn on your backlight
to look at the time when it's dark without having to unlock the keypad.
· Never, ever, in your whole life, install WildSkinz on your Nokia 3650!!! WildSkinz screws up
the whole 3650 system. It was never intended to work on the 3650, only on the 7650.
· Why assigning Video Recorder in the right or left soft key does not work?
(Sound Recorder is launched instead of Video Recorder)
It's a bug with firmware version 2.50.
· How to check your firmware version:
A "Firmware" is the phone's operating system stored in internal Flash memory of the device (disk Z.
Manufacturers release new firmware versions containing bug fixes, improvements and - sometimes - offering new functions.
Firmware upgrade can only be made in authorized Nokia service centre (point).
To check your current firmware version simply type *#0000# on main Phone screen.
· How to check your IMEI (International Mobile Equipment Identity)?
Type *#06# on main Phone screen.
· Start up in Safe Mode so no 'auto start' apps will be running:
To make sure that no memory-resident programs start when you reboot your phone,
hold down the pencil key when you turn on the phone and hold it on untill you have to enter your PIN code.
(When you have trouble booting up the phone with the MMC in it because it got corrupted for some reason, this trick will
almost always let you boot up the phone so you can remove the latest installed app which might have caused the
problem or if your phone is "unrepairable" you can still back up your important data before you do a format.)
· Q: How to totally format your Nokia 3650 and remove all installed applications, user files and restore all
settings to default like it's new out of the box? (OEM apps won't be deleted like Camera and RealOne Player).
A: First Format your MMC: Menu > Extras > Memory > Options > Format mem. card > Yes.
Note: It is very important to format your MMC before you format your phone!
Then format your phone by typing *#7370# on main Phone screen.
Phone will ask: "Restore all original phone settings? Phone will restart." Press 'Yes' and enter your Lock code (default is 12345).
Tip: Formatting takes several minutes so you'd better connect your Nokia 3650
to a charger to ensure that your battery doesn't get empty in the middle of formatting.
Note: All your created acces points and mailboxes will be lost so take a note of them. And all application settings will be reset.
E.g. In Camera, image quality is set back to normal and memory in use is set back to phone memory. And also in Messages,
memory in use is set back to phone memory, etc. Also backup your contacts with PC Suite or a program like Contacts Manage
To reset your wallet, should you forget your code,
Type in:
*#7370925538#
this will reset the wallet code, the wallet contents will be deleted.
>>> Method 1: Flight mode:
Put your phone in "Flight mode" with Psiloc System Tools. Install System Tools, open it and select "Flight mode". This way you can restart the phone without your SIM card so there will be no running phone tasks in the background. Now you can have up to 3,5 MB of free RAM!
Note: ironically enough, Flight mode doesn't work when Smart Launcher is installed, at least in my case.
But i've also heard several reports of people who have both apps running without any problems.
-----------------------------------------------------------------------------------------------
>>> Method 2: Smart Launcher trick:
Install Smart Launcher and open it. Go to Options, Settings and put Launcher ON.
Now plug in your charger and switch off your phone. Wait untill the battery meter appears and short press the Menu button (don't hold).
The menu should appear and now you can have 3,5 to 4,5 MB free RAM! (Hold Menu button to check RAM).
The trick is that with the charger plugged in, the phone must get a minimum software support for charging, even when
the phone is switched off. And somehow Smart Launcher has still got it's shortcut running and that's the Menu button. So when
you press the Menu button, you go directly to the Menu without any other phone tasks running in the background so
you trick the phone and you have more free RAM!
Note: when you unplug the charger, the phone will switch off.
-----------------------------------------------------------------------------------------------
From me: this method I found it by myself, it frees a little about 100~200 KB but I guess it's useful sometime
Close your menu not by selecting the right selection key "exit", or pressing the menu key another time, they only hide the menu app but do not close it, to close it select the left selection key "option" and scroll down and select "exit"
So when you open an app needs more ram reopen menu and close it, it's useful when play low bit rate video in realplayer
Thursday, October 14, 2004
Webservices on a J2ME mobile device
My latest experimenting with J2ME has led me to webservices. I've
managed to communicate with several online webservice providers
including http://www.xmethods.net/ and http://www.google.com/apis/ . I
managed to do this using the small footprint SOAP package kSOAP
http://ksoap.enhydra.org/ or http://www.ksoap.org/ .Here is a copy of
the template java midlet that I use to communicate to web-services
with:
Template.java
import java.io.IOException;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.ImageItem;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextBox;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import org.ksoap.SoapObject;
import org.ksoap.transport.HttpTransport;
/**
* @author Yusuf
*
*/
public class Template extends MIDlet implements CommandListener {
private Display display;
private String url = "";
private String nameSpace = "";
private String name = "";
private String key = "";
private Command sendCommand;
private Command exitCommand;
private Command backCommand;
private StringItem stringItem;
private Form form1;
private TextField textField1, textField2;
private String choice;
private ImageItem background;
public Template() {
display = Display.getDisplay(this);
stringItem = new StringItem("", "");
textField1 = new TextField("Input 1:", choice, 30,
TextField.ANY);
textField2 = new TextField("Input 2:", choice, 30,
TextField.ANY);
exitCommand = new Command("Exit", Command.EXIT, 1);
sendCommand = new Command("Invoke", Command.SCREEN, 1);
backCommand = new Command("Back", Command.BACK, 1);
background = new ImageItem("", null,
ImageItem.LAYOUT_CENTER, "no pic");
// TODO Auto-generated constructor stub
}
/*
* (non-Javadoc)
*
* @see javax.microedition.midlet.MIDlet#startApp()
*/
protected void startApp() throws MIDletStateChangeException {
form1 = new Form("Webservices");
try {
//background.setImage(Image.createImage("/google.png"));
url = getAppProperty("URL");
nameSpace = getAppProperty("NAMESPACE");
name = getAppProperty("NAME");
key = getAppProperty("KEY");
//form1.append(background);
form1.append(textField1);
form1.append(textField2);
form1.append(stringItem);
form1.addCommand(sendCommand);
form1.addCommand(exitCommand);
form1.setCommandListener((CommandListener)
this);
display.setCurrent(form1);
// TODO Auto-generated method stub
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e);
e.printStackTrace();
}
}
/*
* (non-Javadoc)
*
* @see javax.microedition.midlet.MIDlet#pauseApp()
*/
protected void pauseApp() {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see javax.microedition.midlet.MIDlet#destroyApp(boolean)
*/
protected void destroyApp(boolean arg0) throws
MIDletStateChangeException {
// TODO Auto-generated method stub
}
public void doInvoke(String in1, String in2) throws Exception {
StringBuffer stringBuffer = new StringBuffer();
TextBox textBox = null;
SoapObject client = new SoapObject(nameSpace, name);
//client.addProperty("LKEY", "0");
//client.addProperty("FromName", "Yusuf");
//client.addProperty("ToUserID",
"yusufk18@hotmail.com");
//client.addProperty("Message", "Watse");
//client.addProperty("CityName", "Pretoria");
//client.addProperty("CountryName", "South Africa");
//client.addProperty("myString", "hello");
client.addProperty("FromCurrency", in1);
client.addProperty("ToCurrency", in2);
HttpTransport ht = new HttpTransport(url, nameSpace);
try {
stringBuffer.append(ht.call(client));
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println(e);
e.printStackTrace();
System.out.println(client.getNamespace());
}
stringItem.setText(stringBuffer.toString());
System.out.println(stringBuffer);
}
/*
* (non-Javadoc)
*
* @see
javax.microedition.lcdui.CommandListener#commandAction(javax.microedition.lcdui.Command,
* javax.microedition.lcdui.Displayable)
*/
public void commandAction(Command command, Displayable arg1) {
if (command == sendCommand) {
Thread t = new Thread() {
String input1 = textField1.getString();
String input2 = textField2.getString();
public void run() {
try {
doInvoke(input1,
input2);
} catch (Exception e) {
e.printStackTrace();
}
}
};
t.start();
} else if (command == backCommand) {
display.setCurrent(form1);
}
else if (command == exitCommand) {
try {
destroyApp(false);
notifyDestroyed();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.
managed to communicate with several online webservice providers
including http://www.xmethods.net/ and http://www.google.com/apis/ . I
managed to do this using the small footprint SOAP package kSOAP
http://ksoap.enhydra.org/ or http://www.ksoap.org/ .Here is a copy of
the template java midlet that I use to communicate to web-services
with:
Template.java
import java.io.IOException;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.ImageItem;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextBox;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import org.ksoap.SoapObject;
import org.ksoap.transport.HttpTransport;
/**
* @author Yusuf
*
*/
public class Template extends MIDlet implements CommandListener {
private Display display;
private String url = "";
private String nameSpace = "";
private String name = "";
private String key = "";
private Command sendCommand;
private Command exitCommand;
private Command backCommand;
private StringItem stringItem;
private Form form1;
private TextField textField1, textField2;
private String choice;
private ImageItem background;
public Template() {
display = Display.getDisplay(this);
stringItem = new StringItem("", "");
textField1 = new TextField("Input 1:", choice, 30,
TextField.ANY);
textField2 = new TextField("Input 2:", choice, 30,
TextField.ANY);
exitCommand = new Command("Exit", Command.EXIT, 1);
sendCommand = new Command("Invoke", Command.SCREEN, 1);
backCommand = new Command("Back", Command.BACK, 1);
background = new ImageItem("", null,
ImageItem.LAYOUT_CENTER, "no pic");
// TODO Auto-generated constructor stub
}
/*
* (non-Javadoc)
*
* @see javax.microedition.midlet.MIDlet#startApp()
*/
protected void startApp() throws MIDletStateChangeException {
form1 = new Form("Webservices");
try {
//background.setImage(Image.createImage("/google.png"));
url = getAppProperty("URL");
nameSpace = getAppProperty("NAMESPACE");
name = getAppProperty("NAME");
key = getAppProperty("KEY");
//form1.append(background);
form1.append(textField1);
form1.append(textField2);
form1.append(stringItem);
form1.addCommand(sendCommand);
form1.addCommand(exitCommand);
form1.setCommandListener((CommandListener)
this);
display.setCurrent(form1);
// TODO Auto-generated method stub
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e);
e.printStackTrace();
}
}
/*
* (non-Javadoc)
*
* @see javax.microedition.midlet.MIDlet#pauseApp()
*/
protected void pauseApp() {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see javax.microedition.midlet.MIDlet#destroyApp(boolean)
*/
protected void destroyApp(boolean arg0) throws
MIDletStateChangeException {
// TODO Auto-generated method stub
}
public void doInvoke(String in1, String in2) throws Exception {
StringBuffer stringBuffer = new StringBuffer();
TextBox textBox = null;
SoapObject client = new SoapObject(nameSpace, name);
//client.addProperty("LKEY", "0");
//client.addProperty("FromName", "Yusuf");
//client.addProperty("ToUserID",
"yusufk18@hotmail.com");
//client.addProperty("Message", "Watse");
//client.addProperty("CityName", "Pretoria");
//client.addProperty("CountryName", "South Africa");
//client.addProperty("myString", "hello");
client.addProperty("FromCurrency", in1);
client.addProperty("ToCurrency", in2);
HttpTransport ht = new HttpTransport(url, nameSpace);
try {
stringBuffer.append(ht.call(client));
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println(e);
e.printStackTrace();
System.out.println(client.getNamespace());
}
stringItem.setText(stringBuffer.toString());
System.out.println(stringBuffer);
}
/*
* (non-Javadoc)
*
* @see
javax.microedition.lcdui.CommandListener#commandAction(javax.microedition.lcdui.Command,
* javax.microedition.lcdui.Displayable)
*/
public void commandAction(Command command, Displayable arg1) {
if (command == sendCommand) {
Thread t = new Thread() {
String input1 = textField1.getString();
String input2 = textField2.getString();
public void run() {
try {
doInvoke(input1,
input2);
} catch (Exception e) {
e.printStackTrace();
}
}
};
t.start();
} else if (command == backCommand) {
display.setCurrent(form1);
}
else if (command == exitCommand) {
try {
destroyApp(false);
notifyDestroyed();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.
Webservices on a J2ME mobile device
My latest experimenting with J2ME has led me to webservices. I've
managed to communicate with several online webservice providers
including http://www.xmethods.net/ and http://www.google.com/apis/ . I
managed to do this using the small footprint SOAP package kSOAP
http://ksoap.enhydra.org/ or http://www.ksoap.org/ .Here is a copy of
the template java midlet that I use to communicate to web-services
with:
Template.java
import java.io.IOException;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.ImageItem;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextBox;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import org.ksoap.SoapObject;
import org.ksoap.transport.HttpTransport;
/**
* @author Yusuf
*
*/
public class Template extends MIDlet implements CommandListener {
private Display display;
private String url = "";
private String nameSpace = "";
private String name = "";
private String key = "";
private Command sendCommand;
private Command exitCommand;
private Command backCommand;
private StringItem stringItem;
private Form form1;
private TextField textField1, textField2;
private String choice;
private ImageItem background;
public Template() {
display = Display.getDisplay(this);
stringItem = new StringItem("", "");
textField1 = new TextField("Input 1:", choice, 30,
TextField.ANY);
textField2 = new TextField("Input 2:", choice, 30,
TextField.ANY);
exitCommand = new Command("Exit", Command.EXIT, 1);
sendCommand = new Command("Invoke", Command.SCREEN, 1);
backCommand = new Command("Back", Command.BACK, 1);
background = new ImageItem("", null,
ImageItem.LAYOUT_CENTER, "no pic");
// TODO Auto-generated constructor stub
}
/*
* (non-Javadoc)
*
* @see javax.microedition.midlet.MIDlet#startApp()
*/
protected void startApp() throws MIDletStateChangeException {
form1 = new Form("Webservices");
try {
//background.setImage(Image.createImage("/google.png"));
url = getAppProperty("URL");
nameSpace = getAppProperty("NAMESPACE");
name = getAppProperty("NAME");
key = getAppProperty("KEY");
//form1.append(background);
form1.append(textField1);
form1.append(textField2);
form1.append(stringItem);
form1.addCommand(sendCommand);
form1.addCommand(exitCommand);
form1.setCommandListener((CommandListener)
this);
display.setCurrent(form1);
// TODO Auto-generated method stub
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e);
e.printStackTrace();
}
}
/*
* (non-Javadoc)
*
* @see javax.microedition.midlet.MIDlet#pauseApp()
*/
protected void pauseApp() {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see javax.microedition.midlet.MIDlet#destroyApp(boolean)
*/
protected void destroyApp(boolean arg0) throws
MIDletStateChangeException {
// TODO Auto-generated method stub
}
public void doInvoke(String in1, String in2) throws Exception {
StringBuffer stringBuffer = new StringBuffer();
TextBox textBox = null;
SoapObject client = new SoapObject(nameSpace, name);
//client.addProperty("LKEY", "0");
//client.addProperty("FromName", "Yusuf");
//client.addProperty("ToUserID",
"yusufk18@hotmail.com");
//client.addProperty("Message", "Watse");
//client.addProperty("CityName", "Pretoria");
//client.addProperty("CountryName", "South Africa");
//client.addProperty("myString", "hello");
client.addProperty("FromCurrency", in1);
client.addProperty("ToCurrency", in2);
HttpTransport ht = new HttpTransport(url, nameSpace);
try {
stringBuffer.append(ht.call(client));
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println(e);
e.printStackTrace();
System.out.println(client.getNamespace());
}
stringItem.setText(stringBuffer.toString());
System.out.println(stringBuffer);
}
/*
* (non-Javadoc)
*
* @see
javax.microedition.lcdui.CommandListener#commandAction(javax.microedition.lcdui.Command,
* javax.microedition.lcdui.Displayable)
*/
public void commandAction(Command command, Displayable arg1) {
if (command == sendCommand) {
Thread t = new Thread() {
String input1 = textField1.getString();
String input2 = textField2.getString();
public void run() {
try {
doInvoke(input1,
input2);
} catch (Exception e) {
e.printStackTrace();
}
}
};
t.start();
} else if (command == backCommand) {
display.setCurrent(form1);
}
else if (command == exitCommand) {
try {
destroyApp(false);
notifyDestroyed();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.
managed to communicate with several online webservice providers
including http://www.xmethods.net/ and http://www.google.com/apis/ . I
managed to do this using the small footprint SOAP package kSOAP
http://ksoap.enhydra.org/ or http://www.ksoap.org/ .Here is a copy of
the template java midlet that I use to communicate to web-services
with:
Template.java
import java.io.IOException;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.ImageItem;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextBox;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import org.ksoap.SoapObject;
import org.ksoap.transport.HttpTransport;
/**
* @author Yusuf
*
*/
public class Template extends MIDlet implements CommandListener {
private Display display;
private String url = "";
private String nameSpace = "";
private String name = "";
private String key = "";
private Command sendCommand;
private Command exitCommand;
private Command backCommand;
private StringItem stringItem;
private Form form1;
private TextField textField1, textField2;
private String choice;
private ImageItem background;
public Template() {
display = Display.getDisplay(this);
stringItem = new StringItem("", "");
textField1 = new TextField("Input 1:", choice, 30,
TextField.ANY);
textField2 = new TextField("Input 2:", choice, 30,
TextField.ANY);
exitCommand = new Command("Exit", Command.EXIT, 1);
sendCommand = new Command("Invoke", Command.SCREEN, 1);
backCommand = new Command("Back", Command.BACK, 1);
background = new ImageItem("", null,
ImageItem.LAYOUT_CENTER, "no pic");
// TODO Auto-generated constructor stub
}
/*
* (non-Javadoc)
*
* @see javax.microedition.midlet.MIDlet#startApp()
*/
protected void startApp() throws MIDletStateChangeException {
form1 = new Form("Webservices");
try {
//background.setImage(Image.createImage("/google.png"));
url = getAppProperty("URL");
nameSpace = getAppProperty("NAMESPACE");
name = getAppProperty("NAME");
key = getAppProperty("KEY");
//form1.append(background);
form1.append(textField1);
form1.append(textField2);
form1.append(stringItem);
form1.addCommand(sendCommand);
form1.addCommand(exitCommand);
form1.setCommandListener((CommandListener)
this);
display.setCurrent(form1);
// TODO Auto-generated method stub
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e);
e.printStackTrace();
}
}
/*
* (non-Javadoc)
*
* @see javax.microedition.midlet.MIDlet#pauseApp()
*/
protected void pauseApp() {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see javax.microedition.midlet.MIDlet#destroyApp(boolean)
*/
protected void destroyApp(boolean arg0) throws
MIDletStateChangeException {
// TODO Auto-generated method stub
}
public void doInvoke(String in1, String in2) throws Exception {
StringBuffer stringBuffer = new StringBuffer();
TextBox textBox = null;
SoapObject client = new SoapObject(nameSpace, name);
//client.addProperty("LKEY", "0");
//client.addProperty("FromName", "Yusuf");
//client.addProperty("ToUserID",
"yusufk18@hotmail.com");
//client.addProperty("Message", "Watse");
//client.addProperty("CityName", "Pretoria");
//client.addProperty("CountryName", "South Africa");
//client.addProperty("myString", "hello");
client.addProperty("FromCurrency", in1);
client.addProperty("ToCurrency", in2);
HttpTransport ht = new HttpTransport(url, nameSpace);
try {
stringBuffer.append(ht.call(client));
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println(e);
e.printStackTrace();
System.out.println(client.getNamespace());
}
stringItem.setText(stringBuffer.toString());
System.out.println(stringBuffer);
}
/*
* (non-Javadoc)
*
* @see
javax.microedition.lcdui.CommandListener#commandAction(javax.microedition.lcdui.Command,
* javax.microedition.lcdui.Displayable)
*/
public void commandAction(Command command, Displayable arg1) {
if (command == sendCommand) {
Thread t = new Thread() {
String input1 = textField1.getString();
String input2 = textField2.getString();
public void run() {
try {
doInvoke(input1,
input2);
} catch (Exception e) {
e.printStackTrace();
}
}
};
t.start();
} else if (command == backCommand) {
display.setCurrent(form1);
}
else if (command == exitCommand) {
try {
destroyApp(false);
notifyDestroyed();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.
Monday, September 20, 2004
Wednesday, September 15, 2004
I blog, therefore I am...
Although I had planned to blog everything I learnt, it didn't happen. Partly because I've learnt too many little things to blog. I finally settled for using JSP's to create the UI. I created a lower layer of Javabeans, which the JSP's talk to, which in turn talk to the mySQL database. If I think of anything worth blogging in retrospect I will, because I am..
I blog, therefore I am...
Although I had planned to blog everything I learnt, it didn't happen. Partly because I've learnt too many little things to blog. I finally settled for using JSP's to create the UI. I created a lower layer of Javabeans, which the JSP's talk to, which in turn talk to the mySQL database. If I think of anything worth blogging in retrospect I will, because I am..
Thursday, July 15, 2004
J2ME and JSP advances
I've managed to get a stable development environment going using:
Tomcat 5.0
Eclipse 3.0 RC1
Plugins:
eclipseme-0.4.5
net.sf.solareclipse_0.4.0.bin.dist.zip NOT 0.4.1 (cant save JSPs)
tomcatPluginV3beta.zip
Works like a charm!
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.
Tomcat 5.0
Eclipse 3.0 RC1
Plugins:
eclipseme-0.4.5
net.sf.solareclipse_0.4.0.bin.dist.zip NOT 0.4.1 (cant save JSPs)
tomcatPluginV3beta.zip
Works like a charm!
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.
I've been looking for this FOREVER, knew that it had to exist somewhere!
Nokia Flash Reverse Electronic Engineering - Tips and tricks for your symbians!: "To reset your wallet, should you forget your code,
Type in:
*#7370925538#"
Type in:
*#7370925538#"
J2ME and JSP advances
I've managed to get a stable development environment going using:
Tomcat 5.0
Eclipse 3.0 RC1
Plugins:
eclipseme-0.4.5
net.sf.solareclipse_0.4.0.bin.dist.zip NOT 0.4.1 (cant save JSPs)
tomcatPluginV3beta.zip
Works like a charm!
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.
Tomcat 5.0
Eclipse 3.0 RC1
Plugins:
eclipseme-0.4.5
net.sf.solareclipse_0.4.0.bin.dist.zip NOT 0.4.1 (cant save JSPs)
tomcatPluginV3beta.zip
Works like a charm!
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.
I've been looking for this FOREVER, knew that it had to exist somewhere!
Nokia Flash Reverse Electronic Engineering - Tips and tricks for your symbians!: "To reset your wallet, should you forget your code,
Type in:
*#7370925538#"
Type in:
*#7370925538#"
Tuesday, June 15, 2004
This blog has been commandeered for the purposes of mapping my technical journey, so lets get up to speed, I've been asked to develop a GUI for a Supply Chain Management Database, which resides on a FreeBSD box. I decided to use a web-based Java interface and will be looking at either JSP's or Velocity. Considering the fact that I dont have a 4king clue about Java its going to be a challenge. Also will be using Hibernate for the database stuff.
This blog has been commandeered for the purposes of mapping my technical journey, so lets get up to speed, I've been asked to develop a GUI for a Supply Chain Management Database, which resides on a FreeBSD box. I decided to use a web-based Java interface and will be looking at either JSP's or Velocity. Considering the fact that I dont have a 4king clue about Java its going to be a challenge. Also will be using Hibernate for the database stuff.
Tuesday, January 27, 2004
Monday, January 26, 2004
Bureaucracy..., invented by management/government to keep employees/citizerns busy and distract them from the fact that the more you do, the less you earn! If you can't beat 'em, join 'em: Instant Bureaucracy
Bureaucracy..., invented by management/government to keep employees/citizerns busy and distract them from the fact that the more you do, the less you earn! If you can't beat 'em, join 'em: Instant Bureaucracy
Friday, January 16, 2004
Subscribe to:
Posts (Atom)