diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7ca0be6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +env.mk +build/ diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF new file mode 100644 index 0000000..15d9cd3 --- /dev/null +++ b/META-INF/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +MIDlet-Vendor: bedohswe +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-Name: Hello +MIDlet-Description: Test MIDlet +MicroEdition-Profile: MIDP-2.0 +MIDlet-1: Hello,/icon.png,com.Hello + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2c428de --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +include env.mk + +SRC = src +JCFLAGS = -target 1.1 -source 1.2 -sourcepath $(SRC) -cp $(HEADERS) -Xlint:-options -d build -g:none + +SRC_DIR := src + +OUT_DIR := build + +SRCS := $(wildcard $(SRC_DIR)/*/*.java) + +CLS := $(SRCS:$(SRC_DIR)/%.java=$(OUT_DIR)/%.class) + +.SUFFIXES: .java + +.PHONY: all clean + +all: $(CLS) + +$(CLS): $(OUT_DIR)/%.class: $(SRC_DIR)/%.java + mkdir -p build + $(JC) $(JCFLAGS) $< + +clean: + rm -rf build/ + rm -f result.jar + +pack: + jar -cmf META-INF/MANIFEST.MF result.jar -C build . -C res . + +run: + $(EMULATOR) result.jar diff --git a/default.mk b/default.mk new file mode 100644 index 0000000..4f2402f --- /dev/null +++ b/default.mk @@ -0,0 +1,4 @@ +JC = /usr/lib/jvm/java-1.8-openjdk/bin/javac +HEADERS = +EMULATOR = java -jar + diff --git a/res/icon.png b/res/icon.png new file mode 100644 index 0000000..d1405a4 Binary files /dev/null and b/res/icon.png differ diff --git a/src/com/Hello.java b/src/com/Hello.java new file mode 100644 index 0000000..bbe63d1 --- /dev/null +++ b/src/com/Hello.java @@ -0,0 +1,16 @@ +package com; + +import javax.microedition.midlet.MIDlet; +import javax.microedition.lcdui.TextBox; +import javax.microedition.lcdui.Display; + +public class Hello extends MIDlet { + public Hello() { + Display display = Display.getDisplay(this); + TextBox hello = new TextBox("Hello!", "Hello World!", 256, 0); + display.setCurrent(hello); + } + public void startApp() {} + public void destroyApp(boolean unconditional) {} + public void pauseApp() {} +}