Click to See Complete Forum and Search --> : Gettign started with mobile apps
Dopple
04-19-2007, 10:40 AM
i. I have been learning java at college for the last 3 or 4 months and although I'm in no way proficient in it (I can string a basic program together quite happily) I was wondering if someone could let me know how I would go about making a small program which just outputs "hello world" to the screen of my mobile.
Does this depend on what type of mobile I have? (sony ericsson k610i).
Any gentle nudge in the right direction would b appreciated.
Ta
Graham
Khalid Ali
04-19-2007, 08:47 PM
any j2me compliant phone will let you do that. I am sure phone u have does this.
Go to java.sun.com and look for j2me...
Dopple
04-20-2007, 03:44 AM
Thanks. Last night I downloaded the sony ericsson java develpment suite of tools from http://developer.sonyericsson.com/site/global/docstools/java/p_java.jsp (over 70 meg). I haven't looked at it but I'll take a look at j2me on the sun site also.
agent_x91
04-21-2007, 06:03 PM
Maybe someone should compile a list of fast links to various API downloads such as mobile phone APIs and put it on sticky on this forum. It'd be infinitely useful.
Khalid Ali
04-22-2007, 03:03 PM
good idea...
Dopple
04-23-2007, 03:59 AM
I didn't actually install the sony ericsson software. I used (as Kahlid Ali advised) the java se platform from http://java.sun.com/javase/index.jsp.
Within this there are quite a few Projects to get you started but apart from that most of the tutorials out there weren't fantastic and when I tried to download the jar file that I created, it wouldn't work.
I'll post any useful APIs that I find in my searches. Hopefully it'll take the le work out for others.
Khalid Ali
04-24-2007, 01:40 AM
what do you mean "I tried to download the jar file that I created, it wouldn't work."
Can you explain, because this could simpley mean the jar file + jad file have descrepencies...I shall be able to walk you through this.
Second, java 2me is the standard that all devices follow to its core, however every manufacturere have their own specific API's on top of J2ME that they use. meaning if you write your program in standard j2me it has chance that it will work with most of the j2me compatible devices only that it may lack some custom functionality that you will see in some devices because of the additional API for that manufacturer
Dopple
04-24-2007, 03:37 AM
Thanks. Ok well step by step.
1. open Wireless toolkit 2.5
2. Open project - Hello Suite - which contains HelloMIDlet.java as follows
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class HelloMIDlet extends MIDlet implements CommandListener {
private Form mMainForm;
public HelloMIDlet() {
mMainForm = new Form("HelloMIDlet");
mMainForm.append(new StringItem(null, "Hello Suckas!"));
mMainForm.addCommand(new Command("Exit", Command.EXIT, 0));
mMainForm.setCommandListener(this);
}
public void startApp() {
Display.getDisplay(this).setCurrent(mMainForm);
}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command c, Displayable s) {
notifyDestroyed();
}
}
3. select "Build"
4. Select project -> package-> create package.
5. Once I had done this I uploaded the jar file to my server and then try downloading it on my mobiles browser. I get Operation failed. I usually have no problem downloading jar files (Shozu, Gmail, Games etc).
Am I missing a step (or seven) above?
Khalid Ali
04-24-2007, 02:05 PM
well typically you should have a jad file on the webside, this jad file contains the location of the jar file. And the application management system on the phone determines and downloads the jar from jad...
Dopple
04-25-2007, 03:17 AM
Ahhh. I see. That sounds like where I'm going wrong then. I will try again today and test. Thanks for your help
:)
Dopple
05-22-2007, 09:56 AM
I uploaded the jad and the jar file to my webserver. I tried to download the jad but it's coming up with operation failed. Usually I have no problem (I just updated my opera mini today).
Is it justa case of linking to the jad file and attempting to download it?
Khalid Ali
05-23-2007, 03:34 AM
There may be multiple issues here...make sure your webserver is can handle jad type files.
Second. make sure that jad file is created correctly(typically a size difference between a jad and jar could cause strange problems)
Dopple
05-23-2007, 03:51 AM
Cheers Khalid Ali, I'll check with the web host and (although using Java wireless toolkit's package feature I will check sizes and make sure it's configured properly.
Thanks
Graham