New to Java. Want to write a simple applet for a mobile phone.

Hello,
I want to write a simple java applet for a mobile phone. currently I am in the stage of thinking about whether this is possible in a timeframe of about a month. I have very little java experience from a while back so I'm pretty much starting from scratch.
All I want is an applet that lets you send 2 or 3 variables to an online server. The server will then reposition telescopes.
All i'm concerned with is the mobile phone part, which doesn't have to be secure or impressive. Just a simple interface.
Ideally it should work on my nokia 6070, which occording to the official specs has the following java technology:
MIDP 2.0
CLDC 1.1
JSR 120 Wireless Messaging API
JSR 135 Mobile Media API
Nokia UI API
(I don't know what any of this means but am a good learner).
Can anyone offer me any advice? Is this possible in my timeframe? where should I start? I need a editor and compiler also (I'm using windows XP).
Many thanks and kind regards,
Jason

Actually it is working on my phone now.
I changed the target platform in the wireless toolkit settings to MIDP 1.0
Now to create the fields coordinate fields etc. I don't have much of a clue really.
Current I have:
import java.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class AtmosMIDlet extends MIDlet implements CommandListener
Form WelcomeForm = new Form("AtmosMIDlet");
StringItem WelcomeMes = new StringItem(null, "Please enter coordinates:");
TextField Longitude = new TextField("Longitude", "", 3, TextField.NUMERIC);
TextField Lattitude = new TextField("Lattitude", "", 3, TextField.NUMERIC);
public AtmosMIDlet()
try
ImageItem logo = new ImageItem(Image.createImage("/logo.png"));
WelcomeForm.append(logo);
catch (java.io.IOException x)
throw new RuntimeException ("Image not found");
WelcomeForm.append(WelcomeMes);
WelcomeForm.append(Longitude);
WelcomeForm.append(Lattitude);
WelcomeForm.addCommand(new Command("Exit", Command.EXIT, 0));
WelcomeForm.setCommandListener(this);
public void startApp()
Display.getDisplay(this).setCurrent(WelcomeForm);
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command c, Displayable s)
notifyDestroyed();
I'm trying to get the image logo.png to display at the top but I get the error:
C:\WTK25\apps\AtmosSpec\src\AtmosMIDlet.java:19: cannot find symbol
symbol : constructor ImageItem(javax.microedition.lcdui.Image)
location: class javax.microedition.lcdui.ImageItem
ImageItem logo = new ImageItem(Image.createImage("/logo.png"));
^
1 error
com.sun.kvem.ktools.ExecutionException
Build failed
When I try to build.. Any help would be great.
Ideally the image would be on a seperate screen for a couple of seconds.

Similar Messages

  • Reading PDF in large screen mobile phone is often the horizontal screen reading,but the new adobe reader for Android mobile phone needs to be set to automatically turn screen, this is very inconvenient.

    Reading PDF in large screen mobile phone is often the horizontal screen reading,but the new adobe reader for Android mobile phone needs to be set to automatically turn screen, this is very inconvenient.I strongly suggest that the adobe reader Android version add manually rotating screen function, the best is the default horizontal screen reading.

    Reading PDF in large screen mobile phone is often the horizontal screen reading,but the new adobe reader for Android mobile phone needs to be set to automatically turn screen, this is very inconvenient.I strongly suggest that the adobe reader Android version add manually rotating screen function, the best is the default horizontal screen reading.

  • Re: want to write  a test diver for a Jpanel

    I have a JPanel which is called new PersonalDataPanel which has GUI components and is part of a bigger application i.e
    myapplication extend JFrame {
    pdp = new PersonalDataPanel();
    ... etc
    I want to write a test driver just for the JPanel how can I do this?

    eg,
    public class PersonalDataPanel extends JPanel
      public static void main( String[] args ) {
         JFrame f = new JFrame();
         JPanel p = (JPanel) f.getContentPane();
         p.add( new PersonalDataPanel() );
         f.pack();
         f.show();
    }just invoke it with:
    java PersonalDataPanel

  • Everytime i click in something or i want to write its get stuck for 1 sec its what i can do to stop it?

    its like when i start write its get stuck for 1 sec and when i open new tab its get stuck everythink i clicke its get stuck for 1 sec

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the sessionstore.js [2] file and possible sessionstore-##.js [3] files with a number and sessionstore.bak in the Firefox Profile Folder.
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    See also:
    *[1] http://kb.mozillazine.org/Session_Restore
    *[2] http://kb.mozillazine.org/sessionstore.js
    *[3] http://kb.mozillazine.org/Multiple_profile_files_created

  • Unable to update apps since I have closed my Verizon e-mail account.  The old ID address pops up and I can not do updates.  I can not use the old password since the account is closed.  I have a new ID and password on my laptop but not for my I phone.

    My Verizon e-mail account is closed and I can not access the needed updates for my I phone apps.  Even if I knew the password I would have to access the old e-mail account which I can not do.  I have an ID and password for my new laptop but not for my I phone which is under a Verizon service contract....ugh!!!  Thanks

    kenfromsouth jordan wrote:
    My Verizon e-mail account is closed and I can not access the needed updates for my I phone apps.  Even if I knew the password I would have to access the old e-mail account which I can not do.
    You don't need to access the email account.
    Use the link provided by robdrage to update your old AppleID.

  • New to Java, want to create a game any help appreciated.

    I just downloaded java Studio. I would like to create Java games. Not sure where to start.. Do i need more programs? Any info would be of great help thanks....

    Hey,
    If you want to know which software you need to program java games (or any other java application for that matter), I'm guessing you don't have much experience using java.
    First, to answer your question, Studio will certainly do to create java. But even notepad will suffice. The only thing you really need to have is a SDK, you can get it from the Sun site.
    Second, You should ask yourself if java is the language to program in. Java is well suited for developing games. But it is also a very powerful general purpose language, so it can be very overwhelming. Maybe you should think of the alternatives?
    Flash: Has much better browser support than applets, so if you want to make an online game, this is probably a better choice. Don't be afraid of the possibilities in flash, unless you want to do 3d. You don't want do to 3d yet.
    PHP: if your game is text based, you might want to program it in PHP. It is mostly used for multi-user-"dungeons"(fill that in as you want).
    If you really want to learn how to program in java, I suggest you don't start on your game just yet. Try this PDF for starters: http://www.mindview.net/Books/TIJ/. The java tutorial is also pretty good, but cover the basics first: http://java.sun.com/docs/books/tutorial/ . I also suggest you don't start programming in an IDE(for you: Sun studio) until you start working with multiple classes. I suggest JEdit for "basic"(it has a million features, don't worry) programming. Later you can start to learn Sun Studio (Or Eclipse, if I can lodge in my preference), but be careful: these programs are excellent, and will spare you hours of work, but only if you spend (a lot) of time on how to use them properly.
    As a final thought: the web is your friend. There are tons of good resources on the web for developing games, and lots of them focus on java. A good place for info is http://www.gamedev.net/, lots of articles, and helpful hints on choosing language, tile games, etc... Another specific one is http://www.brackeen.com/javagamebook/. It has working code for a tile-based game, and it even has a software 3d engine. It also has good for for detecting mouse and keyboard actions. Get more experience before you start with these ones, though.
    Good luck!

  • How can I write a simple WINCGI for iPlanet?

    I have wrote a veri simple CGI program in Delphi. The code looks like this: writeln('CONTENT-TYPE: TEXT/HTML');
    writeln('<HTML>');
    writeln('<H3>Hello world</H3>');
    writeln('</HTML>');
    As you see it's very simple, but if I want to run like this:
    Click here
    I get this error from iPlanet:
    send-wincgi reports: Could not open pipe (The operation completed successfully.
    What's this? Can anybody help to me???

    Hi,
    Please look out the below link, I hope this help.
    http://knowledgebase.iplanet.com/ikb/kb/articles/3255.html
    If still an a issue, Please let know your iWS version with service pack. And last 10 lines of error log.
    Thanks,
    Dakshin.
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support.

  • If i want to write something that waits for more then one thing

    how do i do that?
    if it's for one thing i'll write:
    sinchronized(a){
    while (true){
    wait();
    my_code();
    }

    He's not saying he wants to wait for multiple
    conditions. Unless I just don't understand what he's
    saying (real possibility there.):) It sounded to me like he wanted to wait for multiple things to happen.
    CountDownLatch works fine for waiting on multiple
    threads. If one thread wants to force the await() to
    end, it can force the latch count to zero. Any thread
    can also call interrupt() on the waiting thread (as
    long as it has a reference to the thread object.)A CountdownLatch set to one can also be used to wait for one of a set of events to occur. Of course you'd need further information to determine which event it was.
    The kinds of "events" can influence the shape of the solution here. Eg if you're interested in muiltiple I/O events then you need to use an I/O framework that supports a select-style operation.

  • My $20 to the person who can write this simple script for Fission

    Here is what I need to automate. I don't care if it's an Apple Script, or an Automator work flow - whatever - just so it will work with my present setup. Once I test it and it works, I'll send $20 to the first person who can help me.
    Script needs to apply to each (and every) MP3 file in a selected folder:
    Open the first file with Fission v1.6.6 (from: www.rogueamoeba.com)
    Select all
    Normalize
    Save audio (in same folder)
    A warning dialog pops up: "File already exists..." -- answer with "Replace"
    Close file
    Repeat for next file in the folder, until every file has been Normalized
    End script when the last file in folder has been Normalized
    I don't mind finding the folder (which will be in my iTunes Library), and then starting the set of actions on the folder but I definitely don't want to be required to take any additional action on each and every file.
    I'm presently running Fission v1.6.6 under MacOS 10.4.11 on a PPC desktop, so it needs to work in that environment.
    Note that the latest version of Fission requires MacOS 10.5 - I can't use any script that requires that version. Rogue Amoeba's Legacy software page (http://www.rogueamoeba.com/legacy/) shows Fission v1.6.8 as working with 10.4, but that contradicts the Version History for Fission which shows 1.6.6 as the last one for 10.4 - still investigating.

    Pierre L.
    Thanks for the effort!
    First, I can clarify this: Rogue Amoeba confirms that I can use the version 1.6.8 of Fission located on their Legacy page with my OS version 10.4.11, so I've upgraded from 1.6.6 to 1.6.8. Seems to be working OK.
    Next, let me apologize for being mostly ignorant about all things AppleScript. I'm really in over my head, here, because I've not used the ScriptEditor for more than a few minutes before today.
    What I've done so far:
    I checked the box in the Universal Access preferences pane to enable access for assistive devices.
    I copied your script from this forum and pasted it into Script Editor.
    I've Compiled your script, then "Saved As" an "Application" on my Desktop.
    When I double click the icon for the saved script (which ends in xyz.app), a navigation window appears, which I used to select a test folder on my desktop.
    When I Choose the test folder, Fission launched, and selected the whole file, as expected. Then I get an error:
    "NSReceiverEvaluationScriptError: 4" - with buttons to "Edit" or "OK"
    Thinking it might be a timing error, I edited the delays:
    set theFolder to choose folder
    tell application "Fission" to activate
    tell application "Finder"
    set theApp to POSIX path of (get file of process "Fission")
    set theFiles to document files of theFolder
    repeat with thisFile in theFiles
    open thisFile using POSIX file theApp
    tell application "System Events" to tell process "Fission"
    delay 18 -- adjust if necessary
    keystroke "a" using command down -- Select All
    delay 2 -- adjust if necessary
    click menu item "Normalize Selection" of menu 1 of menu bar item 7 of menu bar 1
    delay 4 -- adjust if necessary
    keystroke "s" using {shift down, command down} -- Save Audio…
    delay 3 -- adjust if necessary
    keystroke return -- Save
    delay 2 -- adjust if necessary
    click button "Replace" of sheet 1 of window "Save Audio"
    end tell
    end repeat
    end tell
    tell application "Fission" to quit -- optional
    ... Compiled, and Saved again.
    Now, the script runs up to the point where it should answer the Save pop-up window: "File already exists..." with the keystroke to "Replace" - but the script stops there, with the same error: "NSReceiverEvaluationScriptError: 4"
    Bottom line: so far, I've been able to get the first mp3 file in my test folder Normalized, but not Saved. Any suggestions?

  • Necessities for a mobile phone to run a Java game

    Hello, everybody,
    I'm from a Brazilian company which provides content for mobile cell phones.
    I'm creating a document where we'll ask the manufacturers (as Nokia, Motorola, etc) infos about the handsets. The idea is getting the maximum number possible of infos to know if the handset model can run a Java application and what Java application it can run.
    So, in order to do that, I discovered until now that it's essencial to know:
    - MIDP versions supported by the handset model
    - CLDC versions supported by the handset model
    - Max Jar size supported by the handset model
    - Max Rip (how is it spelled?) Memory
    Well, I don't know if it's enough.
    Does someone can help me?
    Thank you very much,
    �tila Cavalcante

    Well, most of the information you need van be found on their internet sites.
    About the needed information. I guess that's about it. You might want to ask about screen resolutions and colours, but if you make your application right, you'll be able to run it on any resolution and colourdepth. If you need performance, you could also ask for the vm speed...
    maybe a list of extra supported api's can be nice... but since only some phones will have those it might not be interesting for you.

  • How to write a simple query.

    I have a table where I have data shown below. Now, I want to write a simple query which lists me the project and the count of the distinct effective dates for which data is existant there.
    Sample data:
    Project Task Effective Date (xx_proj_task_data)
    101 T1 01-Jan-2008
    101 T1 01-Feb-2008
    101 T1 01-Mar-2008
    101 T2 01-Jan-2008
    101 T2 01-Apr-2008
    101 T3 01-Apr-2008
    102 T1 01-Jan-2008
    102 T1 01-Feb-2008
    102 T2 01-Apr-2008
    103 T1 01-Jan-2008
    103 T1 01-Feb-2008
    103 T1 01-Mar-2008
    103 T1 01-Apr-2008
    103 T2 01-May-2008
    103 T3 01-Jun-2008
    103 T1 01-Jan-2008
    103 T1 01-Aug-2008
    103 T2 01-Apr-2008
    Output Reqd:
    Project Count(Distinct Effective Dates)
    101 4
    102 3
    103 7
    I can write a query that says:
    select project_id, count(1)
    from (select distinct project_id, effective_date
    from xx_proj_task_data) x
    group by project_id;
    But, is there a way I can achieve the same by avoiding the inner Query (x) and just by a simple query ?
    Thanks!

    Try below query:
    select project_id
    , count(distinct effective_date)
    from xx_proj_task_data
    group by project_id;
    --venkata                                                                                                                                                                                                                                                                                       

  • New to Java and need help with this program..please!

    I'd really appreciate any helpful comments about this program assignment that I have to turn in a week from Friday. I'm taking a class one night a week and completely new to Java. I'd ask my professor for help, but we can't call him during the week and he never answers e-mails. He didn't tell us how to call from other classes yet, and I just can't get the darn thing to do what I want it to do!
    The assignment requirements are:
    1. Change a card game application that draws two cards
    and the higher card wins, to a Blackjack application
    2. Include a new class called Hand
    3. The Hand class should record the number of draws
    4. The application should prompt for a number of draws
    5. The game is played against the Dealer
    6. The dealer always draws a card if the dealer's hand total is <= 17
    7. Prompt the player after each hand if he wants to quit
    8. Display the total games won by the dealer and total and the total games wond by the player after each hand
    9. Display all of the dealer's and player's cards at the
    end of each hand
    10. Player has the option of drawing an additional card after the first two cards
    11. The Ace can have a value of 11 or 1
    (Even though it's not called for in the requirements, I would like to be able to let the Ace have a value of 1 or an 11)
    The following is my code with some comments about a few things that are driving me nuts:
    import java.util.*;
    import javax.swing.*;
    import java.text.*;
    public class CardDeck
    public CardDeck()
    deck = new Card[52];
    fill();
    shuffle();
    public void fill()
    int i;
    int j;
    for (i = 1; i <= 13; i++)
    for (j = 1; j <= 4; j++)
    deck[4 * (i - 1) + j - 1] = new Card(i, j);
    cards = 52;
    public void shuffle()
    int next;
    for (next = 0; next < cards - 1; next++)
    int rand = (int)(Math.random()*(next+1));
    Card temp = deck[next];
    deck[next] = deck[rand];
    deck[rand] = temp;
    public final Card draw()
    if (cards == 0)
    return null;
    cards--;
    return deck[cards];
    public int changeValue()
    int val = 0;
    boolean ace = false;
    int cds;
    for (int i = 0; i < cards; i++)
    if (cardValue > 10)
    cardValue = 10;
    if (cardValue ==1)     {
    ace = true;
    val = val + cardValue;
    if ( ace = true && val + 10 <= 21 )
    val = val + 10;
    return val;
    public static void main(String[] args)
    CardDeck d = new CardDeck();
    int x = 3;
    int i;
    int wins = 1;
    int playerTotal = 1;
    do {
    Card dealer = (d.draw());
    /**I've tried everything I can think of to call the ChangeValue() method after I draw the card, but nothing is working for me.**/
    System.out.println("Dealer draws: " + dealer);
    do {
    dealer = (d.draw());
    System.out.println(" " + dealer);
    }while (dealer.rank() <= 17);
    Card mine = d.draw();
    System.out.println("\t\t\t\t Player draws: "
    + mine);
    mine = d.draw();
    System.out.println("\t\t\t\t\t\t" + mine);
    do{
    String input = JOptionPane.showInputDialog
    ("Would you like a card? ");
    if(input.equalsIgnoreCase("yes"))
         mine = d.draw();
    System.out.println("\t\t\t\t\t\t" + mine);
         playerTotal++;
         else if(input.equalsIgnoreCase("no"))
    System.out.println("\t\t\t\t Player stands");
         else
    System.out.println("\t\tInvalid input.
    Please try again.");
    I don't know how to go about making and calling a method or class that will combine the total cards delt to the player and the total cards delt to the dealer. The rank() method only seems to give me the last cards drawn to compare with when I try to do the tests.**/
    if ((dealer.rank() > mine.rank())
    && (dealer.rank() <= 21)
    || (mine.rank() > 21)
    && (dealer.rank() < 22)
    || ((dealer.rank() == 21)
    && (mine.rank() == 21))
    || ((mine.rank() > 21)
    && (dealer.rank() <= 21)))
    System.out.println("Dealer wins");
    wins++;
         else
    System.out.println("I win!");
    break;
    } while (playerTotal <= 1);
    String stop = JOptionPane.showInputDialog
    ("Would you like to play again? ");
    if (stop.equalsIgnoreCase("no"))
    break;
    if (rounds == 5)
    System.out.println("Player wins " +
    (CardDeck.rounds - wins) + "rounds");
    } while (rounds <= 5);
    private Card[] deck;
    private int cards;
    public static int rounds = 1;
    public int cardValue;
    /**When I try to compile this nested class, I get an error message saying I need a brace here and at the end of the program. I don't know if any of this code would work because I've tried adding braces and still can't compile it.**/
    class Hand()
    static int r = 1;
    public Hand() { CardDeck.rounds = r; }
    public int getRounds() { return r++; }
    final class Card
    public static final int ACE = 1;
    public static final int JACK = 11;
    public static final int QUEEN = 12;
    public static final int KING = 13;
    public static final int CLUBS = 1;
    public static final int DIAMONDS = 2;
    public static final int HEARTS = 3;
    public static final int SPADES = 4;
    public Card(int v, int s)
    value = v;
    suit = s;
    public int getValue() { return value; }
    public int getSuit() { return suit;  }
    public int rank()
    if (value == 1)
    return 4 * 13 + suit;
    else
    return 4 * (value - 1) + suit;
    /**This works, but I'm confused. How is this method called? Does it call itself?**/
    public String toString()
    String v;
    String s;
    if (value == ACE)
    v = "Ace";
    else if (value == JACK)
    v = "Jack";
    else if (value == QUEEN)
    v = "Queen";
    else if (value == KING)
    v = "King";
    else
    v = String.valueOf(value);
    if (suit == DIAMONDS)
    s = "Diamonds";
    else if (suit == HEARTS)
    s = "Hearts";
    else if (suit == SPADES)
    s = "Spades";
    else
    s = "Clubs";
    return v + " of " + s;
    private int value; //Value is an integer, so how can a
    private int suit; //string be assigned to an integer?
    }

    Thank you so much for offering to help me with this Jamie! When I tried to call change value using:
    Card dealer = (d.changeValue());
    I get an error message saying:
    Incompatible types found: int
    required: Card
    I had my weekly class last night and the professor cleared up a few things for me, but I've not had time to make all of the necessary changes. I did find out how toString worked, so that's one question out of the way, and he gave us a lot of information for adding another class to generate random numbers.
    Again, thank you so much. I really want to learn this but I'm feeling so stupid right now. Any help you can give me about the above error message would be appreciated.

  • New to java  -especially linked lists

    I�m trying to work with linked lists but not having much luck�
    Overall, the program must create a datastructure that will hold titles of articles. Up to 10 keywords can be added to each article and it must then be possible to search all of the titles for matches to the keyword.
    Currently I�m stuck in a for-loop � my linked list (articleList) is not accepted. Any help would be much appreciated. The following error occurs when I attempt to compile:
    SearchMachine.java:30: cannot resolve symbol
    symbol : variable articleList
    location: class SearchMachine
              for(ListIterator listiter = articleList.listIterator(); listiter.hasNext();)
    ^
    import java.util.*;
    class Document
         private String title;
         private String keywords [] = new String [10];
         private int last = 0;
         public Document (String _title)
              String title = _title;
         public void addKeyword(String kw)
              if(last < 9)
                   keywords [last]= kw;
                   last ++;
                   System.out.println("The keyword " + kw + " has now been added");
              else if (last == 9)
                   keywords [last]= kw;
                   System.out.println ("The document now has 10 keywords. No more can be added");
    class SearchMachine
         SearchMachine()
              LinkedList articleList = new LinkedList ();
              articleList.add (new Document ("Oracle 8 the new SQL programming"));
              articleList.add (new Document ("Java programming made easy"));
         public void print()
              for(ListIterator listiter = articleList.listIterator(); listiter.hasNext();)
                   System.out.println(listiter.next());
         public static void main (String [] args)
              SearchMachine search;     
              search = new SearchMachine();
              search.print();

    This is a basic scope issue. You declare the variable articleList inside the constructor block and thus it's visible only in the constructor block. The variable doesn't exist anywhere else but in SearchMachine() {...} The solution is to move the line "LinkedList articleList = new LinkedList();" three lines up, outside the constructor but inside the class definition, so that articleList becomes a member of the SearchMachine class.

  • Need help coding simple applet program

    Hello I'm attempting to learn applet programming in either swing or awt. Whichever is best for current applications. I want to begin by creating my first hello world application. I want to create a simple applet that has two buttons, press button number one and the text "hello world 1" comes up somewhere on the applet, press two and "hello world 2" comes up. can anyone help me with this simple applet? Thnx in advance

    http://java.sun.com/docs/books/tutorial/applet/

  • How to write a web service for uploading a file

    Hi all,
    I want to write a web service for uploading a file to some specified folder under application server, how to do that? Thanks

    I believe the "difference" that you're seeing is that one web service is "RPC" style (The Hello World example) and one web service is "Document" style (The WSDL you have downloaded).
    Document-style web service methods always have one element as a parameter, and this parameter manifests itself as a SOAPElement in the service interface.
    RPC-style web services are true "remote procedure calls", and are more functional in nature, in that they accept multiple parameters. JAX-RPC will bind these parameters to generated Java types.

Maybe you are looking for