×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    84

    Need info on compatibility

    HTML Code:
    http://www.forum.nokia.com/forum/showthread.php?t=11133
    Ok so obviously just because a device has JVM doesn't mean that the program will work on it like it did with another. I learned about it when I tried moving my application to a blackberry device. I checked an IDE for it and looked at some sample codes. totally different >.>

    The app I'm working on has been tested on my phone and i had no problems so far. I contact a server, and download txt and images. That's it really. Oh and there's the RMS of course that organizes what I download. I'm using NetBeans 6.8 and when creating a midlet project, i choose CLDC 1.1 and MIDP 2.0. These are the default choices which I keep. I haven't downloaded anything in particular other than what NetBeans downloaded for me when I first installed it.
    Thats it.

    So why did it work on my mobile? Nokia 5800 Music Xpress. Why might it not work on N97? Are there any websites out there with more detailed information?

    Thank you

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: Need info on compatibility

    If your app works on 5800 it might work on N97 also. If the UI of your app is all in high level based on MIDP forms and you have not used Canvas then even the UI controls should look ok on N97.

    try to test your app on Nokia RDA on N97 to be double sure.

    thanks,
    ~Amitabh

  3. #3
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    84

    Re: Need info on compatibility

    Hi Amitabh, I don't know what RDA is but I'll find out after I google it Anyways, my main objective is to find websites that tell me the differences between devices explaining why an app would work on one phone but not the other. So if you could please point me to some I'd be grateful. And no, I haven't used canvas.
    Thanx for the reply

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Need info on compatibility

    There are three sources of incompatibility:

    1. Specification. For example, memory, screen size, processor performance, APIs, and so on.

    2. Implementation. It is possible for two devices to conform to the same specification, but behave differently. For example, API methods, event delivery or thread scheduling, may be different from device to device.

    3. Bugs! Sometimes (well... often!), the implementation will be buggy (by which, I mean it won't conform to the specification).

    Finding information for (1) is fairly easy. Manufacturer sites (like this one!) are a good start. Also, WURFL and JBenchmark.

    I also recommend you go to the Java Verified site, and download the "Table of Supported Devices". This shows you (for those devices supported by the JV programme) which devices are compatible according to the manufacturers.

    (2) & (3) are more difficult to get information about. Generally, it's a case of trial and discovery.

    Check this wiki article for information about how to avoid portability problems, and how to deal with them when they arise.

    Graham.

  5. #5
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    84

    Re: Need info on compatibility

    Thank you too Grahams. I'll do the reading today. What about RMS capabilities? I read in one of the topics here that it's better to have records with big sizes than to have many with smaller ones. Are there any articles or sites that talk about the number of records that an RMS can hold, sizes, types, and why?

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Need info on compatibility

    Information about heap and JAR limits are relatively easy to get, but RMS limitations are much harder to find.

    How much data do you want to store?

  7. #7
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    84

    Re: Need info on compatibility

    well to test my software ill probably store 30 records for txt and another 30 for pics. i want to maek it clear that im thankful for the help i got in the other topic regarding storing both types in the same array but id like to point out that i cant search WITH EASE for txt if i used data streams. ill have to keep reading x times to get to y field per record. where as using a string buffer, i set indexes for each of the 9 fields so all i need to do is get the byte record and say read starting from this offset this many characters. using this method doesnt allow me to save pics and and txts in the same byte record. i could just add them both a stream and then convert that stream to a byte. but its faster like this. but again, thnx. having several methods to handle data will be helpful in my future projects.

    Graham, pic sizes wont b bigger than 500k each. each record has 9 txt fields. iv sent a length of 30 chars for each.
    im just looking for one source that gives me RMS info regarding sizes, numbers, and performance. Just one source would be fine. I need to say 'i read in site x abt so and so'.

  8. #8
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Need info on compatibility

    OK, so you're talking only about devices that have no RMS limits. You'll never store this amount on Series 40 devices. I don't think any device with RMS limits will support record stores of this size (30 * 500k).

    You don't need to read the DataInputStream each time. Read it once, into a String[], then just index the array. Believe me, this is much more efficient than trying to manage multiple strings in a StringBuffer, not to mention more maintainable, more flexible, etc.

    If none of the sites I pointed you at have RMS size info, then I don't know where you'll find it.

    Graham.

  9. #9
    Registered User
    Join Date
    Nov 2009
    Posts
    188

    Re: Need info on compatibility

    Quote Originally Posted by grahamhughes View Post
    OK, so you're talking only about devices that have no RMS limits. You'll never store this amount on Series 40 devices. I don't think any device with RMS limits will support record stores of this size (30 * 500k).

    You don't need to read the DataInputStream each time. Read it once, into a String[], then just index the array. Believe me, this is much more efficient than trying to manage multiple strings in a StringBuffer, not to mention more maintainable, more flexible, etc.

    If none of the sites I pointed you at have RMS size info, then I don't know where you'll find it.

    Graham.
    If I am not wrong then you are looking the RMS size of the device.

    So just take the code below and run you will get the maximum RMS size of the device or emulator in which you are running the application.

    I have tried in Nokia 3110c and 6300 its running perfectly and giving me the size as 2MB for RMS.
    /*--------------------------------------------------
    * ReadWrite.java
    *
    * Read and write to the record store.
    *
    * No GUI interface, all output is to the console
    *
    * Example from the book: Core J2ME Technology
    * Copyright John W. Muchow http://www.CoreJ2ME.com
    * You may use/modify for any non-commercial purpose
    *-------------------------------------------------*/

    import javax.microedition.rms.*;

    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;

    public class Midlet extends MIDlet implements CommandListener {

    private RecordStore rs = null;
    static final String REC_STORE = "db_1";
    Command close = new Command("Close", Command.BACK, 0);

    public Midlet() {
    }

    public void destroyApp(boolean unconditional) {
    destroyApp(false);
    notifyDestroyed();
    }

    public void startApp() {
    // There is no user interface, go ahead and shutdown
    openRecStore(); // Create the record store
    if (isRMSSupported()) {
    Form form = new Form("RMS Size");
    form.append("RMS Maximum size for this device is: " + getMaxRMSSize() +" kb");
    form.addCommand(close);
    form.setCommandListener(this);
    Display.getDisplay(this).setCurrent(form);
    // Write a few records and read them back
    //writeRecord("J2ME and MIDP");
    //writeRecord("Wireless Technology");
    //readRecords();
    //closeRecStore(); // Close record store
    //deleteRecStore(); // Remove the record store
    }
    }

    public void pauseApp() {
    }

    public void commandAction(Command command, Displayable d) {
    if (command == close) {
    closeRecStore();
    notifyDestroyed();
    }
    }

    public void openRecStore() {
    try {
    // The second parameter indicates that the record store
    // should be created if it does not exist
    rs = RecordStore.openRecordStore(REC_STORE, true);
    } catch (Exception e) {
    db(e.toString());
    }
    }

    public void closeRecStore() {
    try {
    rs.closeRecordStore();
    } catch (Exception e) {
    db(e.toString());
    }
    }

    public void deleteRecStore() {
    if (RecordStore.listRecordStores() != null) {
    try {
    RecordStore.deleteRecordStore(REC_STORE);
    } catch (Exception e) {
    db(e.toString());
    }
    }
    }

    public void writeRecord(String str) {
    byte[] rec = str.getBytes();
    try {
    rs.addRecord(rec, 0, rec.length);
    } catch (Exception e) {
    db(e.toString());
    }
    }

    public void readRecords() {
    try {
    // Intentionally make this too small to test code below
    byte[] recData = new byte[5];
    int len;
    for (int i = 1; i <= rs.getNumRecords(); i++) {
    if (rs.getRecordSize(i) > recData.length) {
    recData = new byte[rs.getRecordSize(i)];
    }

    len = rs.getRecord(i, recData, 0);
    System.out.println("Record #" + i + ": " + new String(recData, 0, len));
    }
    } catch (Exception e) {
    db(e.toString());
    }
    }

    /*--------------------------------------------------
    * Simple message to console for debug/errors
    * When used with Exceptions we should handle the
    * error in a more appropriate manner.
    *-------------------------------------------------*/
    private void db(String str) {
    System.err.println("Msg: " + str);
    }

    private long getMaxRMSSize() {
    long size = 0;
    try {
    if (rs != null) {
    size = (rs.getSizeAvailable() + rs.getSize()) / 1024;
    }
    } catch (Exception ex) {
    }
    return size;
    }

    private static boolean isRMSSupported() {
    try {
    Class temp = Class.forName("javax.microedition.rms.RecordStore");
    return true;
    } catch (ClassNotFoundException ex) {
    return false;
    }
    }
    }

    Thanks & Regards,
    Ajit

  10. #10
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    84

    Re: Need info on compatibility

    Graham,
    Well i guess thts one limitation of an rms right there. the pic size is too much. which format would you suggest?
    as for the datastream, you're referring to toString() right? so if i had say 3 txt fields (20 chars each) and a pic. i toString: din.toString() Then i use charAtindex from 0 to 60 to get my chars but 61 onwards to bytes then read by stream to view the image?

    Ajitkumar,
    Hello, I'll run your code tomorrow when I get back home and see the results. Thank you for your post.
    Last edited by WildHeart; 2010-04-28 at 17:48.

Similar Threads

  1. Nokia 5800 XpressMusic accerated video decoders
    By Gingah in forum General Development Questions
    Replies: 4
    Last Post: 2009-07-06, 17:44
  2. JavaME SDK 3 EA, want start anymore on my system.
    By sblantipodi in forum Mobile Java General
    Replies: 7
    Last Post: 2009-03-16, 09:25
  3. Replies: 0
    Last Post: 2008-09-17, 13:16
  4. Problem with running SnapMobileSample
    By quanxpro in forum Mobile Java Games
    Replies: 7
    Last Post: 2008-04-25, 18:27
  5. Problem executing Maze Racer
    By IFtechsupport in forum Mobile Java Games
    Replies: 1
    Last Post: 2006-09-22, 17:18

Posting Permissions

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