Go Back   Science Forums > Physical Sciences Forums > Astronomy and Cosmology
Reply
 
LinkBack Thread Tools
Old 01-05-2008   #1 (permalink)
snoopy's Avatar
Understanding


Location:
scotland
 
snoopy is a jewel in the roughsnoopy is a jewel in the roughsnoopy is a jewel in the rough
 



Not Ranked  0 score     
Eclipse question

I am running Eclipse Mobile Java and am having problems creating a package it creates the .jad file but not the .jar file although I can create this manually through the wizard.

The problem is also I can run my program in eclipse through J2ME emulation but not when I export the jad and jar files ie they dont work as they should.

I realise that eclipse cannot be configured properly for the mobile plug in but for the life of me cannot figure out what I am doing wrong anyone with experience of eclipse, mobile programming, java or anything like that ... help would be greatly appreciated.


Peace
Reply With Quote
Old 01-05-2008   #2 (permalink)
snoopy's Avatar
Understanding


Location:
scotland
 
snoopy is a jewel in the roughsnoopy is a jewel in the roughsnoopy is a jewel in the rough
 



Not Ranked  0 score     
Re: Eclipse question

Ok I have figured out the jad and jar file thing now.

But I have another problem in that every program I wirte raises a java.lang exception, null pointer exception.

Dont know why yet again the programs run inside eclipse just when I create the package it wont run outside eclipse like it should.

Any help much appreciated.
Reply With Quote
Old 01-05-2008   #3 (permalink)
snoopy's Avatar
Understanding


Location:
scotland
 
snoopy is a jewel in the roughsnoopy is a jewel in the roughsnoopy is a jewel in the rough
 



Not Ranked  0 score     
Re: Eclipse question

Ok figured it out Panic over...

Not one reply chortle never mind ....
Reply With Quote
Old 01-08-2008   #4 (permalink)
alexander's Avatar
Dedicated Smart-ass

Senior Moderator
Gallery Curator
Dev Team Member

Location:
Just before 0xAA55
 
alexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond repute
Send a message via AIM to alexander
 



Not Ranked  0 score     
Re: Eclipse question

i guess no big java people.... sry snoopy


----------------
Microsoft, the leader in using innovative tactics to promote irksome experience, coupled with antiquated technology that's held together by a pyramid of makeshift afterthoughts.

Apple, the leader in using irksome tactics to promote innovative experience, coupled with an antiquated core that's enhanced by state-of-the-art afterthoughts.

Linux, the leader in not using any tactics to promote user-defined experience, coupled with state-of-the-art core enhanced by innovative afterthoughts.

Reply With Quote
Old 01-26-2008   #5 (permalink)
snoopy's Avatar
Understanding


Location:
scotland
 
snoopy is a jewel in the roughsnoopy is a jewel in the roughsnoopy is a jewel in the rough
 



Not Ranked  0 score     
Re: Eclipse question

Quote:
Originally Posted by alexander View Post
i guess no big java people.... sry snoopy

First of all thanks for replying.

Second I am now fully up to speed with eclipse and producing top quality software for my mobile phone (I write engineering programs).

and I was disappointed no one knew java too....

I feel like such a geek being the only one that knows java

Oh well Im a geek...sigh....

Peace
Reply With Quote
Old 01-28-2008   #6 (permalink)
alexander's Avatar
Dedicated Smart-ass

Senior Moderator
Gallery Curator
Dev Team Member

Location:
Just before 0xAA55
 
alexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond repute
Send a message via AIM to alexander
 



Not Ranked  0 score     
Re: Eclipse question

lol you are no more geek then any other person who commonly joins in discussions on this thread.... shoot did i just narrow it down to myslef....? eeeh, whatever, you know what i mean

You are a brave geek, I'll give you that, if you admit to your knowledge of Java, though it's not as bad as admitting to C# or VB or something horrific like that...

I know 20+ languages, Java is only an acquaintance of mine, i just don't care for it, and would rather code in python and use the Jython cross-compiler.

I know other people know Java here, they just didn't see the thread probably.

Also whenever you post a coding question, please provide the code in question, because the fact that i dont know Java does not constitute that i will not be able to point out a flaw in your code, same is true for most developers here, notably Buffy and i think Craig. After about 5-6 languages synthax matters little... trust me.

So yeah, no need to feel like "such a geek", thread's just a little dormant that's all...


----------------
Microsoft, the leader in using innovative tactics to promote irksome experience, coupled with antiquated technology that's held together by a pyramid of makeshift afterthoughts.

Apple, the leader in using irksome tactics to promote innovative experience, coupled with an antiquated core that's enhanced by state-of-the-art afterthoughts.

Linux, the leader in not using any tactics to promote user-defined experience, coupled with state-of-the-art core enhanced by innovative afterthoughts.

Reply With Quote
Old 01-29-2008   #7 (permalink)
sanctus's Avatar
Resident Diabolist

Administrator

Location:
Geneva-Bern-Zürich, Switzerland;Oslo,Norway
 
sanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant future
 



Not Ranked  0 score     
Re: Eclipse question

I want to be geek and so I join this discussion.

Seriously snoopy what don't you like about being a geek?


----------------
Administrator

A COUNTRY WITHOUT AN ARMY IS LIKE A FISH WITHOUT A BIKE!!!


I don't believe in god, but I do believe in what others call utopies.
Reply With Quote
Old 01-29-2008   #8 (permalink)
alexander's Avatar
Dedicated Smart-ass

Senior Moderator
Gallery Curator
Dev Team Member

Location:
Just before 0xAA55
 
alexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond repute
Send a message via AIM to alexander
 



Not Ranked  0 score     
Re: Eclipse question

sanctus, how about posting in you know you are a geek thread, if you want to achieve true geekdom.


----------------
Microsoft, the leader in using innovative tactics to promote irksome experience, coupled with antiquated technology that's held together by a pyramid of makeshift afterthoughts.

Apple, the leader in using irksome tactics to promote innovative experience, coupled with an antiquated core that's enhanced by state-of-the-art afterthoughts.

Linux, the leader in not using any tactics to promote user-defined experience, coupled with state-of-the-art core enhanced by innovative afterthoughts.

Reply With Quote
Old 01-29-2008   #9 (permalink)
sanctus's Avatar
Resident Diabolist

Administrator

Location:
Geneva-Bern-Zürich, Switzerland;Oslo,Norway
 
sanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant future
 



Not Ranked  0 score     
Re: Eclipse question

Alex, how about making a code which searches the entries in the geek thread, which amongst other things gives you the names of people that joined that discussion? This would be very geeky compared to browse through the thread and find my contributions


----------------
Administrator

A COUNTRY WITHOUT AN ARMY IS LIKE A FISH WITHOUT A BIKE!!!


I don't believe in god, but I do believe in what others call utopies.
Reply With Quote
Old 02-01-2008   #10 (permalink)
snoopy's Avatar
Understanding


Location:
scotland
 
snoopy is a jewel in the roughsnoopy is a jewel in the roughsnoopy is a jewel in the rough
 



Not Ranked  0 score     
Re: Eclipse question

Quote:
Originally Posted by alexander View Post

Also whenever you post a coding question, please provide the code in question, because the fact that i dont know Java does not constitute that i will not be able to point out a flaw in your code, same is true for most developers here, notably Buffy and i think Craig. After about 5-6 languages synthax matters little... trust me.

So yeah, no need to feel like "such a geek", thread's just a little dormant that's all...

Sorry here is the code but I dont think u can code in python for mobile phones can you ??

After all you need the microedition sdk
heres some code sorry never posted it....
Code:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.lang.*;
 
/** Program for calculating Gas Rates
 *  Calorific Value of Gas taken as 1040
 * @author Keith Madden
 *
 */
public class GasRates extends MIDlet
       implements CommandListener {

 // The commands
 private Command exitCommand = new Command("Exit", Command.EXIT, 2);
  private Command calcCommand = new Command ("Calculate",Command.SCREEN, 1);
  private Command backCommand= new Command ("Back",Command.SCREEN, 1);
  private Command startCommand = new Command("Start", Command.SCREEN, 1);
  private Display myDisplay = null;
  // The display for this MIDlet
  // create a ticker
  private Ticker hi = new Ticker("Gas Rate Calculator Program By Keith Madden");
  TextField volume;
  TextField time;
  private StringItem label;
  private StringItem label2;
  private String Times;
  private String Volumes;
  private double Rate = 0;
  private double Input = 0;
  private double V = 0;
  private double T = 0;
  private double VALUE1 = 3412;
  public final int CV = 1040;
  public int pow;
  HelloCanvas myCanvas;

  public GasRates() {
   myCanvas = new HelloCanvas(Display.getDisplay(this));
     myCanvas.addCommand(exitCommand);
     myCanvas.addCommand(startCommand);
     myCanvas.setCommandListener(this);
    
  }
 

  public void startApp()throws MIDletStateChangeException {
    myCanvas.start();
  }
  /**
   * If the MIDlet was using resources, it should release
   * them in this method.
   */
  public void destroyApp(boolean unconditional)
   {
  }
  public void pauseApp() {
  }
public void New () {
    Form t = new Form("Gas Rate Calculator");
    myDisplay = Display.getDisplay(this);
    myDisplay.setCurrent(t);
    t.setTicker(hi); // set the ticker
    t.addCommand(exitCommand);
    t.addCommand(calcCommand);
    t.setCommandListener(this);
    volume = new TextField
    ("Enter Volume in cu/ft   :","", 10, TextField.DECIMAL);
    t.append(volume);
    time = new TextField
    ("Enter Time in Seconds:","",10,TextField.DECIMAL);
    t.append(time);
    myDisplay.setCurrent(t);
  }

  public void commandAction(Command c, Displayable s) {
    if (c == exitCommand) {
      destroyApp(false);
      notifyDestroyed();
    }
    if (c == startCommand) {
        New();
        }
    if (c == calcCommand) {
     Form g = new Form("Gas Rate Calculator");
     myDisplay = Display.getDisplay(this);
        myDisplay.setCurrent(g);
        Times = time.getString();
        Volumes = volume.getString();
        g.setCommandListener(this);
        g.addCommand(exitCommand);
     g.addCommand(backCommand);
     g.setCommandListener(this);
     g.setTicker(hi); // set the ticker
     label = new StringItem("Result in Kw's ","");
     label2 = new StringItem("Result in BTU's ","");
     g.append(label);
     g.append(label2);
        if (Times ==""){
         New();
        }
        if (Volumes ==""){
         New();
        }
     try{
 
        V = Double.parseDouble(volume.getString());
        T = Double.parseDouble(time.getString());}
    catch (NullPointerException e)
 {
  New();
return;
 }
    catch (NumberFormatException e)
 {
  New();
return;
 }

        if (T == 0) {
            New();}
            else{
        Rate = T/V;
        Input = (3600*CV)/(VALUE1*Rate);}
        Input = round(Input,3);

        label.setLabel("Result in Kw's " + Double.toString(Input));
        Input = round((Input*VALUE1),1);
        
        label2.setLabel("Result in BTU's " + Double.toString(Input));
        myDisplay.setCurrent(g);}
    if (c == backCommand) {
    New();
    }
 
}
  public static double round(double arg, int places) {
   double tmp = (double) arg * (pow(10,places));
   int tmp1 = (int)Math.floor( tmp + 0.5 );
   double tmp2 = (double) tmp1 / (pow(10,places));
   return tmp2;
   }
 
  public static int pow(int arg, int times){
   int ret = 1;
   for ( int i = 1 ; i <= times ; i++ ) {
   ret = ret * arg;
   }
   return ret;
  }
}
It doesnt include the HelloCanvas MidLet but this just displays the logo screen and isnt that important unless you try and run this code in which case it is but either delete the hellocanvas parts or write your own splash screen and call it HelloCanvas.

If it becomes really important I will post it.

To Sanctus I dont mind being a geek... just sometimes I dont realise I am then something like this happens which forces me to face the truth of my geekiness.

Peace

Last edited by alexander; 02-04-2008 at 05:55 AM..
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dreamy Lunar Eclipse C1ay Science News 0 08-03-2007 05:02 AM
Lunar Eclipse C1ay Science News 14 03-03-2007 02:00 PM
lunar eclipse deamonstar Astronomy and Cosmology 5 11-10-2003 07:38 PM
Solar Eclipse Tormod Astronomy and Cosmology 1 06-01-2003 02:25 PM
Today's solar eclipse Noah Astronomy and Cosmology 0 06-11-2002 02:30 AM

» Advertisement
» Current Poll
Who's the sexiest man alive? Johnny Depp or Robert Pattinson?
Johnny Depp - 30.00%
3 Votes
Robert Pattinson - 0%
0 Votes
Someone else (please specify) - 40.00%
4 Votes
I'm too macho to think a guy is sexy - 30.00%
3 Votes
Total Votes: 10
You may not vote on this poll.


All times are GMT -8. The time now is 03:30 AM.

Hypography?

Hypography [n.]: A combination of "hyperlink" and "bibliography" - ie, a list of links to electronic documents. Comparable to discography and bibliography, but not cartography.

We have been online since May 2000, and aim to be the best place to find and share science-related content of all kinds.

Share the love!

Please add more science to your life. Use our RSS feeds on your blog, your portal, or your favorite feedreader!


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
Copyright © 2000-2009 Hypography
Part of the Hypography - Science for Everyone Network