| Reply | « Previous Thread | Next Thread » |
|
please help me...
why this MIDlet don't work? It is simple HTTP connection but it don't work with Nokia 3650... import java.io.*; import javax.microedition.io.*; import javax.microedition.lcdui.*; import javax.microedition.midlet.*; public class SimpleConnetcion extends MIDlet { private Display display; String url = "http://141.108.248.148/tesi/prova.php"; public SimpleConnection() { display = Display.getDisplay(this); } public void startApp() { try { getViaStreamConnection(url); } catch (IOException e) { //Handle Exceptions any other way you like. System.out.println("IOException " + e); e.printStackTrace(); } } public void pauseApp() { } public void destroyApp(boolean unconditional) { } void getViaStreamConnection(String url) throws IOException { StreamConnection streamConnection = null; InputStream inputStream = null; StringBuffer b = new StringBuffer(); TextBox textBox = null; try { streamConnection = (StreamConnection)Connector.open(url); inputStream = streamConnection.openInputStream(); int ch; while((ch = inputStream.read()) != -1) { b.append((char) ch); } textBox = new TextBox("Simple URL Fetch", b.toString(), 1024, 0); } finally { if(inputStream != null) { inputStream.close(); } if(streamConnection != null) { streamConnection.close(); } } display.setCurrent(textBox); } } Thanks |
|
what is the data at server side? video, audio, textfile?
|
|
it is a simple php file:
<?php $data = date('H:i:s'); echo $data; ?> |
|
well ur coding seems ok.
is it giving some error or message if yes then what is that dotc |
|
nothing...
no message error... it is worrisome? :) I think that the 3650 is not adapted to the development with Java. |
|
I have no problem getting http connection to work on my 3650. Try changing your php file to maybe set something in a MySQL database. That way you'll know if it actually connects to the site.
|
|
IT will work with MIDP 2.0 device
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|