Google has finally launched Google Sites. This product comes after buying the wiki company - JotSpot sometime back. They have bundled it with Google Apps & I managed to see the changes today on my extended website on google apps. Its very much like any other web based page editing tools primary having two main features:
First, you can set it up so anyone you want can edit a Google Sites page (or you can keep it private).
And second, it records all changes and lets you change things so you can un-do these edits.
This serves the purpose of multiple people editing pages or creating sites. Also, you dont have to know html in order to publish pages through Google Sites. Google Sites makes it easy to embed other elements from its Apps or Doc suite, including spreadsheets and presentations, and also YouTube videos and iGoogle widgets!
Finally, its Google yet again with a feature packed tool bundled into their spectrum of innovative products. Go Google Go !
Thursday, February 28, 2008
J2ME - Item State Listener
How can you find out when the value in the TextField has been changed?
You must use the ItemStateListener interface and register the listener to the form. The easiest way is to implement ItemStateListener on the form that contains your TextField and put your code into the itemStateChanged method.
class MyClass extends Form implements ItemStateListener
{
public MyClass()
{
setItemStateListener(this);
}
public void itemStateChanged(Item item)
{
...
}
}
Another approach would be to create an anonymous class and register it with the form:
public class MyClass extends MIDlet
{
public void startApp()
{
Form form = new Form("My Test");
// an anonymous class
ItemStateListener listener = new ItemStateListener()
{
public void itemStateChanged(Item item)
{
// do something
}
};
// register for events
form.setItemStateListener(listener);
...
display.setCurrent(form);
}
}
This is just one of the concepts of J2ME I have been learning for the last few days. Will keep posting more...
You must use the ItemStateListener interface and register the listener to the form. The easiest way is to implement ItemStateListener on the form that contains your TextField and put your code into the itemStateChanged method.
class MyClass extends Form implements ItemStateListener
{
public MyClass()
{
setItemStateListener(this);
}
public void itemStateChanged(Item item)
{
...
}
}
Another approach would be to create an anonymous class and register it with the form:
public class MyClass extends MIDlet
{
public void startApp()
{
Form form = new Form("My Test");
// an anonymous class
ItemStateListener listener = new ItemStateListener()
{
public void itemStateChanged(Item item)
{
// do something
}
};
// register for events
form.setItemStateListener(listener);
...
display.setCurrent(form);
}
}
This is just one of the concepts of J2ME I have been learning for the last few days. Will keep posting more...
Sunday, February 24, 2008
J2ME Mobile Network Usage - Avoid deadlock
Avoid deadlock situations while connecting to network resources from mobiles. I used to get the following warning while trying to use network resources during a j2me application development:
Warning: To avoid potential deadlock, operations that may block, such as
networking, should be performed in a different thread than the
commandAction() handler.
Here is the way to counter this problem by using a separate thread in order to connect to the network. This ensures avoidance of deadlock situations in your application. In the run method I am calling the getConn() method which connects to the network resource. The next switchDisplayable method was a business requirement to goto the next screen.
new Thread(new Runnable() {
Comment with better approaches.
Warning: To avoid potential deadlock, operations that may block, such as
networking, should be performed in a different thread than the
commandAction() handler.
Here is the way to counter this problem by using a separate thread in order to connect to the network. This ensures avoidance of deadlock situations in your application. In the run method I am calling the getConn() method which connects to the network resource. The next switchDisplayable method was a business requirement to goto the next screen.
new Thread(new Runnable() {
public void run() {
try {
getConn();
switchDisplayable(null, getWaitScreenRegRoom());
} catch (Exception e) {
}
}
}).start();
try {
getConn();
switchDisplayable(null, getWaitScreenRegRoom());
} catch (Exception e) {
}
}
}).start();
Comment with better approaches.
Subscribe to:
Posts (Atom)