I am trying to make a calculator that will add two numbers and then will display the result.
I have added a Form and on that form there are two TextFields. There are also two buttons OK and CANCEL.
What I want is when the user presses the OK button then it should call the function AddNumber() but I don't know how to do that because when I presses it, it goes back to the previous screen like CANCEL button. How can I do that?
One more thing. When I ran the program it created a .jad file and one MANIFEST file. I transferred them in my friend's Samsung mobile (it supports java but don't know which version) but it didn't work there! Is there anything else that I need to do to install the program on mobile!? How do I know on which mobile my program will work!?
Take a look at source code which may give you some idea.
[ September 16, 2005: Message edited by: Ali Kiyani ]
posted 13 years ago
Ok I managed to run it on mobile. The solution is, create a JAR file of your project and install it rather than installing JAD file on mobile.
But my other questions still remains the same and that is:
How do I know that my application will work on certain models? As you can see I have not defined anything in the code so I guess it picks up the default settings. What are those default settings and how can I define my own that this application will target some specific models?
Well, that's the trick. J2ME CLDC, MIDP are just specification for the device manufacturer to implement if it wants to call the phone a J2ME enabled phone for whatever version if MIDP CLDC. Some devices has proprietary APIs that you can add on top of J2ME, but then your code is locked to that device.
If you want to create specific jars for specific devices based on features that one phone implements that another does not. You either have to have spereate projects for each type of device and have special code in each for that particular device.
Or you can make it "easier" on yourself by using J2ME Polish. Now "easier" in that you will have only one baseline of code, but you would still have to learn J2ME Polish to use it to its fullest potential.