5

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:

  1. "[MIDlet name] is untrusted. Continue anyway?" > Ok (this was expected)
  2. "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 from MIDP-2.1 to MIDP-2.0
  • Tried the other configs MediaControlSkin and QwertyDevice

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

  • NB: The apps worked with the emulator, so it's not the source code that is faulty. –  Feb 26 '19 at 23:13
  • Can you post the full source? – mr_lou Feb 27 '19 at 11:33
  • 1
    @mr_lou: I included the whole project structure and relevant (omitting contents of bytecodes) code. –  Feb 27 '19 at 17:50
  • Thanks. The only thing that stands out to me, is that the methods are `protected`. Never seen this before. Does anything change if you make them `public` instead? – mr_lou Feb 27 '19 at 17:57
  • Oh, and also try removing the `throws MIDletStateChangeException` from `destroyApp` and `startApp` – mr_lou Feb 27 '19 at 17:59
  • 1
    @mr_lou: I haven't thought about that yet, but unfortunately it didn't help: Just tried with the same code changing `protected` to `public` and removing the `throws ...` but it gave the same error "*Can't compile the file*" :( Thanks for looking into it! –  Feb 27 '19 at 18:03
  • Just tried the other possibilities, `protected` with `throws` and `public` without `throws`, but still the same. –  Feb 27 '19 at 18:07
  • Alright. Well nothing is wrong with the source. Which version of the SDK did you get? You should try v3.4 instead of v8. – mr_lou Feb 27 '19 at 18:18
  • Does your Nokia 3310 run this? http://www.ukkosjourney.com/NokiaTester.jar – mr_lou Feb 27 '19 at 18:20
  • @mr_lou: Yes, got the 8.3 one. Will try that later, need to go just now. Thanks again! –  Feb 27 '19 at 18:39
  • Also, is that url safe? I'm a bit hesitant (read paranoid) to download a .jar from the internet without knowing the source well. –  Feb 27 '19 at 18:41
  • 1
    Oracle messed up. SDK 3.4 is the last one that handles MIDlets, while v8.x handles Xlets. You shouldn't even be able to compile a MIDlet using v8.x though... But it's a mess. You're far from the first one to fall into that. – mr_lou Feb 27 '19 at 18:41
  • 1
    Sounds promising, I'm looking forward to try that out! Got my hopes up again :) –  Feb 27 '19 at 18:43
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/189215/discussion-between-kvn-and-mr-lou). –  Feb 28 '19 at 16:19

0 Answers0