×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    33

    xml quiz in j2me

    hi folks,

    i want to develop a Quiz game in j2me. I ve one xml file spinsports.xml where
    there are 8 categories tag. In each category there are 100 Questions tag with 4 answers tag each .


    - <CATEGORY ID="1">
    <QUESTION ID="1" Q="How often is the Ryder Cup Match held?" A1="EVERY TWO YEARS" A2="EVERY YEAR" A3="EVERY FOUR YEARS" A4="EVERY THREE YEARS" CORRECT="A1" TYPE="1" />
    <QUESTION ID="2" Q="Who is the nephew of the legendary Sam Snead?" A1="TIGER WOODS" A2="J.C. SNEAD" A3="MILLER BARBER" A4="JOHN BLAND" CORRECT="A2" TYPE="1" /> ...
    </CATEGORY>
    -<CATEGORY ID="2"><....>

    Im using Netbeans 5.0.In my game i want to parse this xml file and for every click of "play button" in
    a question from selected category should be displayed.

    Plz suggest me, waht r all the basic steps i have to follow since im a beginner in xml parsing.also i have gone thru many eg with kxml parsing.Plz give me all kind of sample codings.

    thanks in advance
    yafy

  2. #2
    Regular Contributor
    Join Date
    Jul 2005
    Location
    Omaha, US
    Posts
    129

    Re: xml quiz in j2me

    You can go thriugh the document in SDN in link http://developers.sun.com/techtopics...es/parsingxml/. This has an example as well. This might help you.

  3. #3
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: xml quiz in j2me

    Hi yafi,

    I've found the article below very interesting. It discusses XML parsing and lightweight parsers in JME context.

    XML in J2ME
    http://trix2.cellmania.com/downloads...E_20060301.pdf

    BR,

    Juarez Jr

  4. #4
    Registered User
    Join Date
    Nov 2005
    Posts
    33

    Re: xml quiz in j2me

    thanks a lot prashant332 and juarezjunior,

    I run that example program RSSMidlet given in the article of prashant332.
    It compiles successfully. but while running it shows
    java.lang.IllegalArgumentException: Null URL.

    Plz suggest how to solve this issue.

    thanks
    yafy

  5. #5
    Regular Contributor
    Join Date
    Jul 2005
    Location
    Omaha, US
    Posts
    129

    Re: xml quiz in j2me

    Check out the line, String url = getAppProperty("RSSMIDlet.URL"); in your code. Here if you are not setting the URL as property, it will get null and throws an exception as the one you are getting.
    Add the url of the xml file u are using as user defined key value pair in the project. Make sure to give the key as "RSSMIDlet.URL".

    Regds,
    Prashant

  6. #6
    Registered User
    Join Date
    Nov 2005
    Posts
    33

    Re: xml quiz in j2me

    hi
    im using netbeans5.0 . In the manifest and jad file i set
    RSSMIDlet.URL : E:\spinsports.xml . followed by MIDlet-name ,MIDlet-vendor...etc .But still getting the same error.Am i right?

    otherwise ,as you said how to set the user defined key value pair in the project.
    plz suggest the steps to be followed.


    thanks in advance
    yafy

Similar Threads

  1. xml with j2me
    By yafy in forum Mobile Java Games
    Replies: 9
    Last Post: 2009-06-12, 14:06
  2. XML quiz game
    By yafy in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2006-05-03, 02:49
  3. integrating xml with J2ME
    By yafy in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2006-04-30, 08:58
  4. XML Schema parser for J2ME???
    By Pepper_91 in forum Mobile Java General
    Replies: 1
    Last Post: 2005-10-11, 00:37
  5. download/upload xml from-to server in j2me
    By freezenik in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-01-26, 05:00

Posting Permissions

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