After reading this comment proving that it's possible to write custom apps for the new Nokia 3310 3G (TA-1006), I'm trying to get my own app running.
After doing a lot of reading about what MIDP, CLDC etc. are, I installed the Java ME SDK (on a fresh Ubuntu installation since Oracle only supports that or Windows), Eclipse and the Sun Wireless toolkit.
First of, I couldn't find any information on which version of MIDP and CLDC are supported by the device, so I went ahead and tried a few possible permutations, these are my results:
CLDC \ MIDP | 1.0 | 2.0 | 2.1 |
1.0 | * | * | X |
1.1 | * | * | ? |
1.8 | X | X | ? |
The ?
ones I have not tried since MIDP 2.1 does not work and there is nothing to be gained and the X
ones give an error "Can't install [MIDlet name] because it doesn't work with this phone".
So it seems like the phone supports the MIDP 2.0 profile and CLDC 1.1 configurations, however when I try to install my app (with any of the configurations of *
) it always goes like this:
- "[MIDlet name] is untrusted. Continue anyway?" > Ok (this was expected)
- "Can't compile the file" (here is where I'm stuck)
What I tried so far (besides the various version permutations)
- Initially I tried with a very basic MIDlet subtype:
public void startApp()
{
Form form = new Form("Hello");
form.append(new StringItem("Hello", "World!");
Display.getDisplay(this).setCurrent(form);
}
- Next, I tried using these templates provided by the Eclipse plugin:
- Splash MIDlet Template
- Hello World Midlet Template
- When selecting the runtime configuration (always picked
DefaultColorPhone
) I adjusted the version profile fromMIDP-2.1
toMIDP-2.0
- Tried the other configs
MediaControlSkin
andQwertyDevice
I always produced the *.jar
and .jad
files by clicking the "Packaging > Create Package" button in the "Application Descriptor" view.
At some point it became experimenting with various settings which I didn't have much confidence that it'll work, reading up and rinse-repeat. When looking for alternatives, the whole journey became quite frustrating since a lot of links are either on dodgy websites, 404s or for the old 3310 phone.
TL;DR
What configuration and build steps are necessary to get a simple (unsigned) application compiled for the new Nokia 3310?
Here are the full contents of the simplest failing example which imo should work:
$ tree
.
├── Application Descriptor
├── bin
│ └── com
│ └── stackoverflow
│ └── kvn
│ └── test
│ └── SOExample.class
├── build.properties
├── deployed
│ └── DefaultColorPhoneM2.0
│ ├── SOTest.jad
│ └── SOTest.jar
├── res
└── src
└── com
└── stackoverflow
└── kvn
└── test
└── SOExample.java
13 directories, 6 files
$ cat Application\ Descriptor
MIDlet-1: SOExample,,com.stackoverflow.kvn.test.SOExample
MIDlet-Jar-URL: SOTest.jar
MIDlet-Name: SOTest MIDlet Suite
MIDlet-Vendor: MIDlet Suite Vendor
MIDlet-Version: 1.0.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0
$ cat build.properties
# MTJ Build Properties
DefaultColorPhoneM2.0.includes=src/com/stackoverflow/kvn/test/SOExample.java\
DefaultColorPhoneM2.0.excludes=\
$ cat src/com/stackoverflow/kvn/test/SOExample.java
package com.stackoverflow.kvn.test;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class SOExample extends MIDlet {
private Form form;
protected void destroyApp(boolean unconditional)
throws MIDletStateChangeException { /* nop */ }
protected void pauseApp() { /* nop */ }
protected void startApp() throws MIDletStateChangeException {
form = new Form("Hello");
form.append(new StringItem("Hello", "World!"));
Display.getDisplay(this).setCurrent(form);
}
}
Software info of the device: Model: TA-1006; Software: 15.0.0.17.00; OS version: MOCOR_W17.44.3_Release; Firmware number: sc7701_barphone