Within a short time, all phones will support Java MIDP. However, silly Sun fixed it so that a phone application cannot run on a PC and a PC application cannot run on a phone. The M scripting environment fixes that problem and provides a very very simple language that 1) results in very compact programs, 2) exposes all the power of Java, 3) is extensible by the user, 4) is configurable, and 5) uses the same classes on the PC and on phones.
| Downloads | |
|
Phone |
Everywhere Else |
|
How to Run? |
|
| Just select GO | java -cp t.jar t |
| How to add your own
classes? (just add to jar files. also you can delete ones you don't need) (for phones, be sure to adjust size in jad file) |
|
|
ex: XXDate.java |
ex: XXCalendar.java |
SYNTAX
low-level
identifier ::= a..z
interface-ref ::= A..Z
member-name ::= same as Java
integer ::= same as Java
double ::= same as Java
string ::= same as Java
vector ::= [ <expression> [, <expression]... ]
expression ::= same as Java (type safe e.g. 3+7.8 is illegal)
static-member ::= <interface-ref >.<member-name>
| <interface-ref >.<member-name> (
<expression-list> )
print-statement ::= print( <expression> )
more to come...
Example: a="Math"; print(A.sqrt(6.7)); //capital indicates
static ref; lower-case an object instance
t.java For Everywhere Else
import java.io.*;
public class t{
public static void main(String args[])
{String s;
DataInput d =
new DataInputStream(System.in);
for (;;) {
System.out.print("input?");
System.out.flush();
try {
s = d.readLine();
if (s.charAt(0)=='.') break;
System.out.println(parse.parse(s)); //will parse/execute any number of lines; message is returned on error
} catch (Exception e) {
System.out.println(e.toString());
break;
}
}
} //main
} //class
Classes, Member variables, and Methods
|
Math |
|
| E PI abs ceil cos: floor max min sin sqrt tan toDegrees toRadians |
|
| String | |
| length indexOf charAt endsWith equalsIgnoreCase :toLowerCase toUpperCase trim startsWith substring replace lastIndexOf: regionMatches: |
|
| Vector | |
| size setSize capacity ensureCapacity indexOf isEmpty trimToSize toString removeAllElements removeElementAt lastIndexOf |
|
|
System |
|
| getProperty currentTimeMillis |
|
| Random | |
| nextDouble nextInt setSeed |
|
| Integer | |
| MAX_VALUE MIN_VALUE doubleValue parseInt toString toBinaryString toHexString toOctalString |
|
| Double | |
| MAX_VALUE MIN_VALUE NaN NEGATIVE_INFINITY POSITIVE_INFINITY intValue isInfinite isNaN parseDouble toString |
|
| JOptionPane | |
| showMessageDialog showConfirmDialog showInputDialog showOptionDialog ERROR_MESSAGE INFORMATION_MESSAGE WARNING_MESSAGE QUESTION_MESSAGE PLAIN_MESSAGE CANCEL_OPTION NO_OPTION OK_CANCEL_OPTION OK_OPTION YES_NO_CANCEL_OPTION YES_NO_OPTION YES_OPTION CLOSED_OPTION |
|
| Date (Object) | |
| new getTime equals compareTo setTime before after parse |
|
|
Calendar |
|
| getInstance get getTime getTimeZone set setTime: setTimeZone AM AM_PM APRIL AUGUST DATE DAY_OF_MONTH DAY_OF_WEEK DECEMBER FEBRUARY FRIDAY HOUR HOUR_OF_DAY JANUARY JULY JUNE MARCH MAY MILLISECOND MINUTE MONDAY MONTH NOVEMBER OCTOBER PM SATURDAY SECOND SEPTEMBER SUNDAY THURSDAY TUESDAY WEDNESDAY YEAR |
|
| DateChooser | |
| tired of typing for today | |
| BufferedImage | |
| ClassLoader | |
| Font | |
| Graphics | |
| ImageIO | |
| InputStream | |
| JFrame | |
| TimeZone | |
| MDialog | |