Showing posts with label JAVA. Show all posts
Showing posts with label JAVA. Show all posts

Monday, October 20, 2008

No need to flash your high beams - just use you Trapster


Trapster® users share the location of police speed traps just by interacting with their mobile phones. The system uses the phone's GPS capabilities and wireless location, voice transcription, geocoding, reverse geocoding, and SMS, with a central database server. It communicates in real time, using the Internet to instantly alert other users as they approach the reported trap.

The Trapster® software and service is totally free and you can signup on there website for a free account and download this great piece of software.

Free Download: tms.jad and tmu.jad

Friday, September 29, 2006

New S60 and UIQ Application Site


Symtopia.com is a new site that from Simon Judge which lists S60 3rd Edition and UIQ 3.0 (Symbian 9.1) applications. All applications are native C++ with no Java listings.
If you are a developer you can have your application listed on the website with an easy one click Add Link button located on the site.
There are a whole lot of freeware applications all searchable by category.

In Simon's words these are the main reasons he put up Symtopia:

Here are my general impressions having visited the various developer web sites, forums and existing (mainly Handango-based) directories…

The 80/20 principle seems to apply. There are a few developers producing large numbers of titles. Prior to Symbian 9.1 there were many more developers each producing fewer titles. Maybe the developers producing the large number of titles were those who previously made a good profit pre- Symbian 9.1.

There is approximately three times as many S60 applications as UIQ applications. This might be explained by the fact that UIQ 3.0 devices and SDKs trailed S60 by about a month. However, I still can’t envisage the number of UIQ 3.0 reaching the same as S60 (now) in a months time.

There’s evidence of developers stalling during development (e.g. FExplorer, Papyrus, Blackballer) due to complexities of platform security.

There are some instances of end-users automatically assuming older (pre-Symbian 9.1) software will run on Symbian 9.1 devices leading to consumer frustration.

Wednesday, August 16, 2006

Use your Nokia as a Mouse


Written in Java and an accompanying Windows driver, utilizing the phones BT(bluetooth) capability and camera, a fellow hacker has come up with a great way to add a new funtionality to the Nokia phone in creating a BT mouse.

All is required is a BT-enabled pc or notebook/laptop and Windows OS. There's also a possibilty of a GPRS connection and an interface for mirroring the PC's screen on the Nokia's display.

The possibilties are endless and I believe this application/project will take off since everyone carries their mobile phone with them and people aren't so keen about notebooks/laptops input devices and this is a perfect match.

Monday, July 17, 2006

UrlEncoder for J2ME

A poor mans UrlEncoder for MIDP(J2ME) which can easily be extended by adding
more items to switch statement in the urlEncode method.

/*
* (C) Serkan Azmi. 2001
* All rights reserved
* The material(s) may be used and/or copied only with the written permission
* of Serkan Azmi. or in accordance with the terms and
* conditions stipulated in any agreement/contract under which
* the material(s) have been supplied.
*/




public class UrlParamEncoder {

String szUrlParam = null;

public UrlParamEncoder() {
}

private void prepAdd() {
if (szUrlParam == null) {
szUrlParam = new String();
}
else {
szUrlParam += "&";
}
}

public void addParam(String szName, String szValue) {
prepAdd();
szUrlParam += urlEncode(szName) + "=" + urlEncode(szValue);
}

public void addParam(String szName, int nValue) {
prepAdd();
szUrlParam += urlEncode(szName) + "=" + urlEncode(Integer.toString(nValue));
}

public void addParam(String szName, long lValue) {
prepAdd();
szUrlParam += urlEncode(szName) + "=" + urlEncode(Long.toString(lValue));
}

public void addParam(String szName, boolean bValue) {
prepAdd();
Boolean boolValue = new Boolean(bValue);
szUrlParam += urlEncode(szName) + "=" + urlEncode(boolValue.toString());
}

private String urlEncode(String s) {
StringBuffer sb = new StringBuffer();

for (int i = 0; i <>
switch (s.charAt(i)) {
case ' ':
sb.append("%20");
break;
case '+':
sb.append("%2b");
break;
case '\'':
sb.append("%27");
break;
case '<':
sb.append("%3c");
break;
case '>':
sb.append("%3e");
break;
case '#':
sb.append("%23");
break;
case '%':
sb.append("%25");
break;
case '{':
sb.append("%7b");
break;
case '}':
sb.append("%7d");
break;
case '\\':
sb.append("%5c");
break;
case '^':
sb.append("%5e");
break;
case '~':
sb.append("%73");
break;
case '[':
sb.append("%5b");
break;
case ']':
sb.append("%5d");
break;
default:
sb.append(s.charAt(i));
break;
}
}
return sb.toString();
}

public String toString() {
return szUrlParam;
}

}

Saturday, July 15, 2006

Java to be Open Source

Sun's new CEO Jonathan Schwartz ended years of speculation last month when he announced that the company plans to open source Java. Tony Baer reports from Sun's annual JavaOne conference in San Francisco.

The waiting is over: Sun Microsystems will open source Java, but it has not figured out how to do it yet.
During the opening keynote of JavaOne 2006, Sun's incoming CEO Jonathan Schwartz wasted little time in cutting to the chase about the question on everybody's minds: Will Sun open source Java?

Schwartz passed the ball to Rich Green, who rejoined Sun just 10 days earlier to retake his old role as head of Sun's software business. "It's not a question of whether, it's a question of how," said Green.

Wednesday, July 12, 2006

MIDlet About Command Button Example

Here is some code I wrote back in 2002 which will display a copyright character \251 , specified image located in the resoures, checkes for device capabilitities ie. if it is able to render in color or black and white.

You can modify the About class to have parameters for the copyright string and icon variables.

public class X extends javax.microedition.midlet.MIDlet implements CommandListener, Runnable {



...
/** command about */
private Command cmdAbout = null;

...


...
cmdAbout = new Command("About", Command.HELP, 30);
anyForm.addCommand(cmdAbout);
...


public void commandAction(Command cmd, Displayable d) {
...

if (cmd == cmdAbout) {
About.showAbout(display);
}
....


/*
* @(#)About.java
* (C) Copyright Serkan Azmi. 2001
* All rights reserved
* The material(s) may be used and/or copied only with the written permission
* of Serkan Azmi. or in accordance with the terms and
* conditions stipulated in any agreement/contract under which
* the material(s) have been supplied.
*
* Created on 18 September 2001, 08:44
*/

import javax.microedition.lcdui.*;

/**
* Typical about box with a string and an image.
*/

public class About {

private static String copyright =
"\251 Serkan Azmi 2002";

private Displayable previous; // the previous screen to go back to

private About() {}; // no instances

/**
* Put up the About box and when the use click ok return
* to the previous screen.
*/
public static void showAbout(Display display) {

Alert alert = new Alert("About");
alert.setTimeout(Alert.FOREVER);

if (display.numColors() > 2) {
String icon = (display.isColor()) ?
"/icons/NAME_OF_APPLICATION_ICON.png" : "/icons/NAME_OF_APPLICATION_ICON_IN_GREYSCALE.png";

try {
Image image = Image.createImage(icon);
alert.setImage(image);
} catch (java.io.IOException x) {
// just don't append the image.
}
}
Runtime runtime = Runtime.getRuntime();

runtime.gc();
alert.setString(copyright);

display.setCurrent(alert);
}

}

Tuesday, July 11, 2006

VNC Viewer on your mobile


VNC2Go is a VNC client (viewer) that runs on MIDP-enabled devices. It lets you control any desktop server running a VNC service, from any mobile device that supports Java Midlets, such as mobile phones and PDAs.

Needless to say, a mobile phone is not the friendliest interface to remote control a desktop computer. However, when you need it, you need it. You can use VNC2Go to send yourself a document you forgot at home, restart a service that crashed, check for an expected mail message, look up a phone number you have at home, etc.

Hopefully, within a couple of years the mobile phone interface will be more mature for such advanced applications, with bigger and better resolution screens and simpler input mechanisms. VNC2Go has several input modes, to try and compensate for the not-so-friendly phone interfaces.

VNC2Go 1.1 (MIDP 1.0 Midlet) (21K)
VNC2Go 1.1 (JAD installation file) (1K)

Azure - a free blog client for your phone and PDA


Azure is a free blog client. It allows you to create and edit posts for your weblog. It runs on your phone, so you can can now blog from wherever your mobile phone can get usable signal reception.

Azure can also run on PDAs like Palms and Handsprings, or any other device with a Java J2ME runtime.

Monday, July 10, 2006

MIDlet Splash Screen Example

package display;

import java.io.IOException;

import javax.microedition.lcdui.*;

/**
* A simple splash screen.
*
*/
public class SplashScreen
extends Canvas
implements Runnable {
private Image mImage;
private Display mDisplay;
private Displayable mNextDisplayable;

/**
* Create a new SplashScreen. The constructor
* attempts to load the named image and begins a timeout
* thread. The splash screen can be dismissed with a key
* press, a pointer press, or a timeout (hardcoded at
* three seconds).
*
* @param name the path of the image resource to load
* @param display the application's Display
* @param next the screen to be shown after the splash
*/
public SplashScreen(String name,
Display display, Displayable next) throws IOException {
mImage = Image.createImage(name);
mDisplay = display;
mNextDisplayable = next;
Thread t = new Thread(this);
t.start();
}

/**
* Paints the image centered on the screen.
*/
public void paint(Graphics g) {
int width = getWidth();
int height = getHeight();

g.drawImage(mImage, width / 2, height / 2,
Graphics.HCENTER | Graphics.VCENTER);
}

/**
* Dismisses the splash screen.
*/
public void dismiss() {
if (isShown())
mDisplay.setCurrent(mNextDisplayable);
}

/**
* This method is used internally with a timeout thread.
*/
public void run() {
try { Thread.sleep(3000); }
catch (InterruptedException ie) {}
dismiss();
}

/**
* A key release event causes the dismiss()
* method to be called.
*/
public void keyReleased(int keyCode) { dismiss(); }
/**
* A pointer release event causes the dismiss()
* method to be called.
*/
public void pointerReleased(int x, int y) { dismiss(); }
}

Sunday, July 09, 2006

Mobility Device Matrix Update


The Mobility Center on the Sun Developer Network has updated the Device Matrix, a database tracking the Java characteristics of mobile devices. The new version includes a re-designed user interface and will serve as a robust platform for future enhancements. The new release adds several new devices, bringing the total number of devices to over 250. See The Java ME Device Table at sun.com.

Friday, July 07, 2006

Mobile phones to detect adolescent depression

The Murdoch Children's Research Institute is trialling a Java-based mobile application that helps with early warning-sign detection and monitoring of adolescent depression.

The product -- developed by Object Consulting -- is believed to be the first mobile phone application used in healthcare field research in Australia. A focus group of 40 adolescents supplied with Nokia 6260 smart phones pre-loaded with the application is presently testing its effectiveness. A larger study -- involving 400 young people -- is scheduled for next year.

Saturday, July 01, 2006

Linux and Wireless Programming Resources

TuxMobil is dedicated to Linux and Mobile Computers. It leads you to a lot of useful hands-on information, HOWTOs, and FAQs about installing and running Linux, BSD, Solaris and other unixlike operating systems on laptops, notebooks, PDAs, mobile cellular phones, portable music and video players, wearables and other mobile computer devices.
Free JAVA Applications for (Linux)s and Mobile Cell Phones