×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    4

    Question Nokia 6120c (S60 v3 v3.70) - J2ME app running from memory card works first then fails

    Hi All,

    I've written a relatively small midlet (25Kb when obfuscated), and installed it to a Nokia 6120c, and also a 6230i.

    On the 6230i, everything just works, perfectly, no issues at all.

    On the 6120c, there are some issues, which are very hard to pin down.

    First, some details:
    App is installed via USB cable or Bluetooth
    Installed using Nokia application Installer v3.0 (PC suite 6.86.9.3)
    App installed on the memory card (Sandisk 2Gb MicroSD)

    App installs properly, initialises, loads and works fine. I am using "RecordStore" records, and the application "self-checks" this is working properly.

    After a while, the application fails to start up. There are no errors output to the screen, nothing that I can find "logged", no discernible "problem" with J2ME, as other Java apps work fine, but my application absolutely will not load. Tried rebooting the phone, "moving the application" from one folder to another, still refuses to load.

    If I then re-install the application, overwriting the original, it then loads again, and all the properties from the RecordStore are present still!

    The ways I've been able to "repeat" the failure are as follows:

    Loading "Skype", then trying to load my app
    Turning phone off, then on, then loading my app
    Waiting a day or so, with some general usage of the handset

    None of these, however, are consistent. Sometimes it would be ok, others it would fail, with the same conditions. I have tried always exiting the application using the "exit" menu button, but this doesn't stop the problem occuring at some point.

    I added a load of error handling into the midlet, so whenever an Exception was caught, I re-threw it as a RuntimeException, to ensure that if the app was starting then failing for some reason, I should see this (NullPointerExceptions always inform the user e.g.) - all to no avail. As far as I can tell, the phone is actually refusing to even START the J2ME application!!

    I then decided, I would install the app to the Internal Memory, instead of the memory card, and so far, I've not been able to make the application "fail". I've tried turning on and off, starting other apps, exiting ungracefully from my app, all is working nicely (so far).

    Has anyone experienced something along these lines? I wonder if there is a bug in Symbian, meaning loading J2ME apps from memory cards is flaky?

    Any help or suggestions would be greatly appreciated.

    Regards,
    Mark

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Nokia 6120c (S60 v3 v3.70) - J2ME app running from memory card works first then f

    Hello Mark,

    some questions:

    1) What kind of application is it?

    2) Is it signed with some certificate?

    3) Is this reproduceable when installing the app to phone memory?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    4

    Re: Nokia 6120c (S60 v3 v3.70) - J2ME app running from memory card works first then f

    Quote Originally Posted by r2j7 View Post
    Hello Mark,

    some questions:

    1) What kind of application is it?
    It's a Java (J2ME) application, which requires no phone privileges other than reading/writing to the RecordStore API.

    2) Is it signed with some certificate?
    No, there was no need to sign it, and when I did (using my company's own CA) it created more issues due to trust settings.

    3) Is this reproduceable when installing the app to phone memory?
    I have been testing it for a few weeks now by installing to the Phone's internal memory, and have never had a repeat of the same issue. I've put in the docs that users should install to the phone memory only as a "workaround".

    Regards,

    Mark

  4. #4
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Singapore
    Posts
    167

    Re: Nokia 6120c (S60 v3 v3.70) - J2ME app running from memory card works first then f

    Hi,

    When u start the app (second time), did any exception prompt?

    If yes, most likely, the record store is corrupted. Maybe because the data access is interrupted when the application is running in the first time.
    ---Knowledge sharing is power---

    Hans

  5. #5
    Registered User
    Join Date
    May 2008
    Posts
    4

    Re: Nokia 6120c (S60 v3 v3.70) - J2ME app running from memory card works first then f

    Quote Originally Posted by tieutue View Post
    Hi,

    When u start the app (second time), did any exception prompt?

    If yes, most likely, the record store is corrupted. Maybe because the data access is interrupted when the application is running in the first time.
    No exceptions are displayed on the screen. I also tried adding an outer try { } catch (RuntimeException e) .. and then re-threw it as a NullPointerException, because in my experience NPEs are always logged to the screen, still didn't see any errors.

    The record store was my first thoughts on this too actually, to the extent I refactored chunks of it to make it clearer, and added some finally blocks to ensure the record store was ALWAYS closed (including a try catch within the finally).

    My old 6230i requires the app to be deleted before re-installing, thus removing the RS records, but on the 6120, it's possibly to "upgrade" the application. Installing a new version does not trash the RecordStore, so at some point in the future I might try to re-create the problem then "upgrade" to a new release of the app, and see if that resolves the problem.

    Cheers,
    Mark

  6. #6
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Singapore
    Posts
    167

    Re: Nokia 6120c (S60 v3 v3.70) - J2ME app running from memory card works first then f

    Hi,

    That's the way. If you still need to keep data, when u try to access data, try to catch any exception, if yes, the remove these corrupted record stores.

    Actually, I myself have bad experience with RS. Because the data access is very slow, and during this process, if user performs other activities (maybe exit, fire some actions), the data is surely corrupted.
    ---Knowledge sharing is power---

    Hans

  7. #7
    Registered User
    Join Date
    May 2008
    Posts
    4

    Re: Nokia 6120c (S60 v3 v3.70) - J2ME app running from memory card works first then f

    Quote Originally Posted by tieutue View Post
    Actually, I myself have bad experience with RS. Because the data access is very slow, and during this process, if user performs other activities (maybe exit, fire some actions), the data is surely corrupted.
    That's interesting to hear, originally I was storing 3 records, but I've expanded the functionality and am now storing 7. The app is noticeably slower to load, although it still loads faster on the old faithful 6230i!!

    Are there any alternatives that you've discovered, I really need to store the data, and it's write-once read many (or at least write very infrequently). The data stored is:

    1) 32-chars of HEX (a shared encryption key, split into 3 records of 16, and 2x8)
    2) 12 digits as String (time of initialisation as epoch)
    3) integer for the timezone
    4) 1 char as a boolean
    5) 2 chars for storing language/locale settings

    I think RecordStore is my only option if I want it to work reliably (ish) on ALL handsets and not require any file permissions (and therefore signing)?

    If you have any other suggestions, please let me know.

    Mark

Similar Threads

  1. What is going on with Vibration on S60?
    By amd_rikus in forum Mobile Java General
    Replies: 3
    Last Post: 2006-06-16, 00:29
  2. Nokia Mobile VPN Client
    By marcyl in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2003-12-01, 14:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×