Index: trunk/src/locale/SR.java =================================================================== --- trunk.orig/src/locale/SR.java 2008-07-18 22:57:06.000000000 +0300 +++ trunk/src/locale/SR.java 2008-07-18 23:00:44.000000000 +0300 @@ -197,6 +197,7 @@ public static String MS_CLOCK_OFFSET = loadString( "Clock offset" ); public static String MS_YES = loadString( "Yes" ); public static String MS_FLASHBACKLIGHT = loadString( "flash backlight" ); + public static String MS_UDPSOCKET = loadString( "Notify via UDP socket" ); public static String MS_SUSPEND = loadString( "Suspend" ); public static String MS_ALERT_PROFILE_CMD = loadString( "Alert Profile >" ); public static String MS_MY_VCARD = loadString( "My vCard" ); Index: trunk/src/ui/EventNotify.java =================================================================== --- trunk.orig/src/ui/EventNotify.java 2008-05-08 22:29:30.000000000 +0300 +++ trunk/src/ui/EventNotify.java 2008-07-18 23:00:44.000000000 +0300 @@ -28,6 +28,7 @@ package ui; import javax.microedition.lcdui.*; import java.io.InputStream; +import smartio.SmartIO; //#if !(MIDP1) import javax.microedition.media.*; @@ -88,6 +89,7 @@ public void startNotify (){ release(); + SmartIO.sendMessage("Alert"); if (soundName!=null) try { //#if !(MIDP1) Index: trunk/src/Client/Config.java =================================================================== --- trunk.orig/src/Client/Config.java 2008-07-18 22:59:14.000000000 +0300 +++ trunk/src/Client/Config.java 2008-07-18 23:00:44.000000000 +0300 @@ -135,6 +135,7 @@ public boolean popupFromMinimized=true; public boolean memMonitor; + public boolean udpSocket=false; public int font1=0; public int font2=0; @@ -314,6 +315,8 @@ autoIrcAuth=inputStream.readBoolean(); + udpSocket=inputStream.readBoolean(); + inputStream.close(); } catch (Exception e) { e.printStackTrace(); @@ -424,6 +427,8 @@ outputStream.writeBoolean(autoIrcAuth); + outputStream.writeBoolean(udpSocket); + } catch (Exception e) { e.printStackTrace(); } NvStorage.writeFileRecord(outputStream, "config", 0, true); Index: trunk/src/Client/ConfigForm.java =================================================================== --- trunk.orig/src/Client/ConfigForm.java 2008-07-18 22:57:06.000000000 +0300 +++ trunk/src/Client/ConfigForm.java 2008-07-18 23:00:44.000000000 +0300 @@ -204,14 +204,18 @@ su[2]=cf.autoIrcAuth; startup.setSelectedFlags(su); - ap=new boolean[5]; + ap=new boolean[6]; int apctr=0; application=new ChoiceGroup(SR.MS_APPLICATION, Choice.MULTIPLE); //#if !(MIDP1) ap[apctr++]=cf.fullscreen; application.append(SR.MS_FULLSCREEN,null); //#endif - application.append(SR.MS_HEAP_MONITOR,null); + + application.append(SR.MS_UDPSOCKET,null); + ap[apctr++]=cf.udpSocket; + + application.append(SR.MS_HEAP_MONITOR,null); application.append(SR.MS_SHOW_HARDWARE,null); if (!cf.ghostMotor) application.append(SR.MS_FLASHBACKLIGHT,null); @@ -373,6 +377,7 @@ VirtualList.fullscreen=cf.fullscreen=ap[apctr++]; StaticData.getInstance().roster.setFullScreenMode(cf.fullscreen); //#endif + cf.udpSocket=ap[apctr++]; VirtualList.memMonitor=cf.memMonitor=ap[apctr++]; cf.enableVersionOs=ap[apctr++]; cf.blFlash=ap[apctr++]; Index: trunk/src/smartio/SmartIO.java =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ trunk/src/smartio/SmartIO.java 2008-07-18 23:00:44.000000000 +0300 @@ -0,0 +1,41 @@ +/* + * SmartIO.java + * + * Created on September 10, 2006, 1:38 AM + * + * UDP socket for smartphones + * + */ + +package smartio; + +import javax.microedition.io.*; +import Client.Config; + +public class SmartIO { + + /** Creates a new instance of SmartIO */ + public SmartIO() { + } + public static void sendMessage(String msg) + { + if (!Config.getInstance().udpSocket) + return; + String url="datagram://localhost:9000"; + int length=msg.length(); + DatagramConnection dc = null; + try { + dc = (DatagramConnection)Connector.open(url); + Datagram dg=dc.newDatagram(msg.getBytes(),length,url); + dc.send(dg); + dc.close(); + } catch(Exception e){ + if (dc!=null) { + try { + dc.close(); + } catch(Exception f) { + } + } + } + } +}