Home Answers Viewqa JavaScriptQuestions J2ME application not working on n79

 
 


lalit
J2ME application not working on n79
0 Answer(s)      a year and 10 months ago
Posted in : JavaScript Questions

Hi, i had developed assignment on sun sdk and its running fine on emulator but not showing results in two text fields on my mobile phone i.e.nokia -n79.please Help

import java.util.Calendar; import java.util.Date; import java.lang.Math; import javax.microedition.lcdui.Alert; import javax.microedition.lcdui.AlertType; import javax.microedition.lcdui.Command; import javax.microedition.lcdui.CommandListener; import javax.microedition.lcdui.DateField; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.Displayable; import javax.microedition.lcdui.Form; import javax.microedition.lcdui.TextField; import javax.microedition.lcdui.Ticker; import javax.microedition.midlet.MIDlet;

public class MoneyL extends MIDlet
  implements CommandListener
{
  private static final Command CMD_EXIT = new Command("Exit", 7, 1);
  private boolean firstTime = true;
  private Date today=new Date();;
  private Date td1;
  public long l;
  public long l1;
  public long l2;
  public long temp1;
  public long temp2;
  public Integer temp3,ref1,y;
  public float flt;
  float flt1;
  int reso;
  public double amount;
  public double intrate,interest,amt;
  public double ref;
  public double dd2,yy2,dm2,dd1,yy1,dm1,d1,d2,tempo1,result;
  public double total = 0.0D;
  String str,mm1,mm2;
 public char[] temp = new char[10];
 public char[] temp11 = new char[10];
 public char[] temp12 = new char[10];
 public char[] temp13 = new char[10];
 public char[] temp14 = new char[10];
 public char[] temp15 = new char[10];
 public char test;
  String str1,str5,str6,str7,str8,str9,str10,str11,str12,str13,str14,str15,str16,str17,str18,str19,str20,str21,str22,str23;
  Calendar rightNow = Calendar.getInstance();
  private final Command exitCmd = new Command("Exit", 7, 1);
  private final Command calcCmd = new Command("Calc", 1, 2);
  private final DateField dt1 = new DateField("Start Date", 1);
  private final TextField t1 = new TextField("Amount", "", 7, 2);
  private final TextField t2 = new TextField("Interest Rate", "", 4, 5);
  private final DateField dt2 = new DateField("End Date", 1);
  private final TextField tr1 = new TextField("Interest", "", 100, 131072);
  private final TextField tr2 = new TextField("Total", "", 100, 131072);
  private final Alert alert = new Alert("Error", "", null, AlertType.ERROR);
  private Ticker t;
  private static final String TICKER_TEXT = "Tirupati Money Lending Application Developed By Lalit N. Jadiya...";
  private Form mainForm = new Form("Tirupati Jewellers");

  protected void startApp()
  {
    if (this.firstTime)
    {
      this.mainForm.append(this.dt1);
      this.today = new Date(System.currentTimeMillis());
      this.dt2.setDate(this.today);
      this.mainForm.append(this.t1);
      this.mainForm.append(this.t2);
      this.mainForm.append(this.tr1);
      this.mainForm.append(this.tr2);
      this.mainForm.addCommand(this.calcCmd);
      this.mainForm.addCommand(this.exitCmd);
      this.t = new Ticker("Tirupati Money Lending Application Developed By Lalit N. Jadiya...");
      this.mainForm.setTicker(this.t);
      this.alert.addCommand(new Command("Back", 1, 1));
      this.mainForm.setCommandListener(this);
      this.firstTime = false;
    }
    Display.getDisplay(this).setCurrent(this.mainForm);
  }

  protected void destroyApp(boolean paramBoolean)
  {
  }

  protected void pauseApp()
  {
  }

  public void commandAction(Command paramCommand, Displayable paramDisplayable)
  {
    if (paramCommand == this.exitCmd)
    {
      destroyApp(false);
      notifyDestroyed();
      return;
    }
    double d1 = 0.0D;
    try
    {
     str5=today.toString();
      str5.getChars(8,10,temp,0);
      str6=new String(temp);
      dd2=Double.parseDouble(str6);


      str5=today.toString();
      str5.getChars(24,28,temp15,0);
      str7=new String(temp15);
      yy2=Double.parseDouble(str7);

      str5=today.toString();
      str5.getChars(4,7,temp11,0);

      str9=new String(temp11);

      str9=str9.substring(0,3);

      if(str9.equals("Jan"))
        {mm2="1";}
      if(str9.equals("Feb"))
        {mm2="2";}
      if(str9.equals("Mar"))
        {mm2="3";}
      if(str9.equals("Apr"))
        {mm2="4";}      
      if(str9.equals("May"))
        {mm2="5";}
      if(str9.equals("Jun"))
        {mm2="6";}     
      if(str9.equals("Jul"))
        {mm2="7";}
      if(str9.equals("Aug"))
        {mm2="8";}
      if(str9.equals("Sep"))
        {mm2="9";}
      if(str9.equals("Oct"))
        {mm2="10";}
      if(str9.equals("Nov"))
        {mm2="11";}
      if(str9.equals("Dec"))
        {mm2="12";}

dm2=Double.parseDouble(mm2);




      str5="";
      str6="";
     str7="";
str10="";
      this.td1 = this.dt1.getDate();
      str5=td1.toString();
      str5.getChars(8,10,temp13,0);
      str6=new String(temp13);
      dd1=Double.parseDouble(str6);



      str5=td1.toString();
      str5.getChars(24,28,temp14,0);
      str7=new String(temp14);
      yy1=Double.parseDouble(str7);


      str5=td1.toString();
      str5.getChars(4,7,temp12,0);

      str10=new String(temp12);

      str10=str10.substring(0,3);

      if(str10.equals("Jan"))
        {mm1="1";}
      if(str10.equals("Feb"))
        {mm1="2";}
      if(str10.equals("Mar"))
        {mm1="3";}
      if(str10.equals("Apr"))
        {mm1="4";}      
      if(str10.equals("May"))
        {mm1="5";}
      if(str10.equals("Jun"))
        {mm1="6";}     
      if(str10.equals("Jul"))
        {mm1="7";}
      if(str10.equals("Aug"))
        {mm1="8";}
      if(str10.equals("Sep"))
        {mm1="9";}
      if(str10.equals("Oct"))
        {mm1="10";}
      if(str10.equals("Nov"))
        {mm1="11";}
      if(str10.equals("Dec"))
        {mm1="12";}

dm1=Double.parseDouble(mm1);

intrate=0.0;
amount=0.0;
interest=0.0;
amt=0.0;
ref=0.0;
d2=0.0;d1=0.0;result=0.0;
tempo1=0.0;
str8="";
      this.intrate = getNumber(this.t2, "Interest Rate");      
      this.amount = getNumber(this.t1, "Amount");




interest=intrate;
amt=amount;
interest=interest/30/100;
ref=yy2;
d2=(dm2-1)*30;
d2=(d2+dd2+(yy2-ref)*360);
str8=Double.toString(d2);
d1=(dm1-1)*30;
d1=(d1+dd1+(yy1-ref)*360);
tempo1=(d2-d1);
if(tempo1<30) 
  { tempo1=30;}
result=interest*amt*tempo1;
reso=(int)result;
str8=Integer.toString(reso);
result=result+amt;
reso=(int)result;
str10=Integer.toString(reso);
str12=Double.toString(yy2);
tr1.setString(str8);
tr2.setString(str10);

    }
    catch (NumberFormatException localNumberFormatException)
    {
      return;
    }
    catch (ArithmeticException localArithmeticException)
    {
      this.alert.setString("Divide by zero.");
      Display.getDisplay(this).setCurrent(this.alert);
      return;
    }
  }


  private double getNumber(TextField paramTextField, String paramString)
    throws NumberFormatException
  {
    String str2 = paramTextField.getString();
    if (str2.length() == 0)
    {
      this.alert.setString(" Please Enter:" + paramString);
      Display.getDisplay(this).setCurrent(this.alert);
      throw new NumberFormatException();
    }
    double d;
    try
    {
      d = Double.parseDouble(str2);
    }
    catch (NumberFormatException localNumberFormatException)
    {
      this.alert.setString(paramString + " argument is out of range.");
      Display.getDisplay(this).setCurrent(this.alert);
      throw localNumberFormatException;
    }
    return d;
  }
}
View Answers









Related Pages:
J2ME application not working on n79
J2ME application not working on n79  Hi, i had developed... TICKER_TEXT = "Tirupati Money Lending Application Developed By Lalit N. Jadiya...(this.exitCmd); this.t = new Ticker("Tirupati Money Lending Application
J2ME application not working on n79
J2ME application not working on n79  Hi, i had developed assignment... Lending Application Developed By Lalit N. Jadiya..."; private Form mainForm = new... Ticker("Tirupati Money Lending Application Developed By Lalit N. Jadiya
J2ME application not working on n79
J2ME application not working on n79  Hi, i had developed assignment... Lending Application Developed By Lalit N. Jadiya..."; private Form mainForm = new... Ticker("Tirupati Money Lending Application Developed By Lalit N. Jadiya
J2ME application not working on n79
J2ME application not working on n79  Hi, i had developed assignment... Lending Application Developed By Lalit N. Jadiya..."; private Form mainForm = new... Ticker("Tirupati Money Lending Application Developed By Lalit N. Jadiya
j2me
j2me  hi, i'm working emulator in j2me language, for Symbian OS (Nokia) development. then, what are the click events in this for developing the application.? Thank you
J2ME
J2ME  i am working in j2ME language on Symbian OS S60 (Nokia)application in this application i am adding buttons for designing in MIDlet application. so how to add button in dynamically. and how can place lancher icon also
Calendar's native alarm not working in j2me
Calendar's native alarm not working in j2me  Hi friend, I am developing an application to set Reminders in the phones calendar using PIM api on j2me.I am able to set reminders successfully but the problem is that when alarm
j2me
j2me  why we extends class MIDlet in j2me application
j2me application
j2me application  code for mobile tracking system using j2me
J2ME
J2ME  Hi sir, i need a source code for simple calculator along with buttons in mobile application
J2ME
J2ME  Hi friends, i have display the bar code image from Mysql database to web page i need to display that image in my J2ME application,how
J2ME
J2ME -i want to execute j2me program using sun wireless tool kit 2.5.2 pls... windows 7 64 bit in my laptop...,i want to execute j2me program using sun wireless tool kit 2.5.2...,it is not working in my laptop..,so can u pls suggest me
j2me
j2me  Hi, i'm working eclipse j2me for Symbian development. i want a combo box use like a scroll bar type. when we are using combo box to a column it acts as one combobox for all cells in a column but i nedd separate combobox
j2me
j2me  i want code in which when we input same data in midlet page ... than on ok button it will show in servlet page.. code that pass information to mobile application page to servlet page
j2me
j2me  i want code in which when we input same data in midlet page ... than on ok button it will show in servlet page.. code that pass information to mobile application page to servlet page
j2me
j2me   Hi, In my j2me application I have used canvas to display an image in fullscreen.In the image there are four points( rectangular areas ). Now I have to add events to these points. It looks like that those areas will be used
j2me - MobileApplications
j2me   I have created a application . on the first page there is radio button which will take language as input. e.g. English/French. for English no doubt about is working. System.getProperty("microedition.locale
j2me
j2me  Hi,i create a project using lwuit in netbeans 6.9 for motorola MC75 device i want to know how can i connect this application with remote server,should i use servlets.actually i have to send data in xml format and also
j2me with xml - Java Beginners
j2me with xml   shahzad.aziz1@gmail.com i am working in j2me and i want to read and display data using xml file. In j2me application KXML PARSER is use to read and display data. When i run my application in ?Wireless
Struts application not working in LINUX - Struts
Struts application not working in LINUX  Hi ALL, I have a struts... in LINUX prodution system. The application is not recoginsed the web server is Tomcat5. I tryed with a sample servlet on linux tomcat its also not working
j2me image application
j2me image application  i can not get the image in my MIDlet .........please tell me the detailed process for creating immutable image without Canvas class
send mail from j2me application
send mail from j2me application  how to send mail from j2me application? i need some example code related
send mail from j2me application
send mail from j2me application  how to send mail from j2me application? i need some example code related
Datagrid not working
Datagrid not working  The code here is working fine, apart from... Application 2.3//EN" "http://java.sun.com/dtd/web-app23.dtd" " in my web.xml.... working. please help me out
j2me mobile chat application for multichat
j2me mobile chat application for multichat  plz help me for creating wap based mobile chat application in neatbean....or simply multi client mobile chat application thanx
j2me mobile chat application for multichat
j2me mobile chat application  plz help me for creating wap based mobile chat application in neatbean. or simply multi client mobile chat application. thanx
Working Of An Application
Working Of An Application Admin Working Process 1. Login to the application 2. Add Products 3. View Products 4. View Product Details... Working Process 1. Register User 2. Login To The Site 3. User Home
Handling key events in J2ME MIDP application?
Handling key events in J2ME MIDP application?  How should i handle the mobile key events in the MIDP application of J2ME
j2me beginner
j2me beginner  how to create an application for sending files via bluetooth please i want full codings
J2ME HELP - Java Server Faces Questions
J2ME HELP  hi Sir, I am working in J2ME environment using net beans Actually My task is to developing mobile application that is, 1. Reading.... Displaying the content of the xml file into the mobile Device. So I Need j2me Source
J2ME - MobileApplications
J2ME  Have to develop a tracking system as a project have to track... year project can anyone tell me is it ok? If not then suggest some another J2ME application. thank you.   Hi Friend, Please visit the following
J2ME
; EclipseME EclipseME is an Eclipse plugin to help develop J2ME MIDlets... development environment, allowing you to focus on developing your application...;    J2ME Java Editor Extends Eclipse Java Editor support ing
j2me - MobileApplications
j2me  Dear all... Can you plz tell what is the distribution based security of mobile application,wat should be criteria for stoping the illegal copieng of software. Thanks Regards Rashan Abid
how to create a databaseconnectvity using SQLSERVER2005 in J2ME - JDBC
using sqlserver through J2ME. Currently we are working on a Mobile Applicayion. In that application I would need to connect my midlet with the sqlserver2005...how to create a databaseconnectvity using SQLSERVER2005 in J2ME  hi
j2me - MobileApplications
j2me  Hi, I have developed a midlet application in j2me now i want... site. It is not signed application file actually so if you click on that link..., For more information on J2me visit to : http://www.roseindia.net
why jsp pages are not working on linux but java application is working in windows - JSP-Servlet
why jsp pages are not working on linux but java application is working in windows  java web application jsp pages are not showing the fileds corectly on linux server but same application is working on windows.why
J2ME Tutorial
application development, CLDC, CDC What is J2ME J2ME is an acronym for Java 2... requirements for J2ME application development Minimum requirements for hardware...J2ME Tutorial In this section we will discuss about J2ME in Java
j2me - MobileApplications
j2me  Hey.... I am developing a mobile application which stores the important datas, can you plz suggest how to take back up of datas in phone gallery which I am storing in rms, Thanks and regards Rashan Abid 9990978757
J2ME - MobileApplications
J2ME  Hi, I wanted to ask that if i want to add Select Language option in my mobile application, can i do that and if yes how? Also if its possible then will my text change in to the language i have selected or i have to write
how to delete a jar from mobile in j2me application
the code how to do that in my application in j2me for lwuit applications. Thanks...how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile
how to delete a jar from mobile in j2me application
the code how to do that in my application in j2me for lwuit applications. Thanks...how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile
how to delete a jar from mobile in j2me application
the code how to do that in my application in j2me for lwuit applications. Thanks...how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile
how to delete a jar from mobile in j2me application
the code how to do that in my application in j2me for lwuit applications. Thanks...how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile
how to delete a jar from mobile in j2me application
the code how to do that in my application in j2me for lwuit applications. Thanks...how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile
how to delete a jar from mobile in j2me application
the code how to do that in my application in j2me for lwuit applications. Thanks...how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile
how to delete a jar from mobile in j2me application
the code how to do that in my application in j2me for lwuit applications. Thanks...how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile
how to delete a jar from mobile in j2me application
the code how to do that in my application in j2me for lwuit applications. Thanks...how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile
how to delete a jar from mobile in j2me application
the code how to do that in my application in j2me for lwuit applications. Thanks...how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile
how to delete a jar from mobile in j2me application
the code how to do that in my application in j2me for lwuit applications. Thanks...how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile
how to delete a jar from mobile in j2me application
the code how to do that in my application in j2me for lwuit applications. Thanks...how to delete a jar from mobile in j2me application  After auto updating a new version of jar from server. I want to delete the old jar from mobile

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.