Initial commit.

This commit is contained in:
Bedohswe 2024-02-16 00:22:42 +05:00
parent 5e6a173210
commit b3f52ba73b
6 changed files with 63 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
env.mk
build/

9
META-INF/MANIFEST.MF Normal file
View File

@ -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

32
Makefile Normal file
View File

@ -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

4
default.mk Normal file
View File

@ -0,0 +1,4 @@
JC = /usr/lib/jvm/java-1.8-openjdk/bin/javac
HEADERS =
EMULATOR = java -jar

BIN
res/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

16
src/com/Hello.java Normal file
View File

@ -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() {}
}