Archive for the 'j2me networking' Category

Playing Video

MMAPI(Mobile Media API) provides a framework for playing media content on J2ME devices.There are protocols defined for real-time streaming of Internet radio content, streaming other RTP (Real-time Transport Protocol) content, capturing audio, and taking pictures.
The method below plays a video file the on mobile device:public void run(){ try { String […]

J2ME Networking:Interacting Server PHP(Image Fetch)

You can even retrieve binary data such as images. If the mobile device is capable of view documents like word or PDF then you should be able to send those by HTTP as well.
J2ME Source Code:
import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import javax.microedition.io.*;import java.io.*;
public class SimpleImageFetch extends MIDlet{ private Display display; private String URL = “http://127.0.0.1/midlet/image/test.php”; […]

J2ME Networking:Connect Server PHP(HTTP GET)

Here is an example invoking PHP with GET parameters:
J2ME Source Code:
import java.io.*;import javax.microedition.io.*;import javax.microedition.lcdui.*;import javax.microedition.midlet.*;
public class SimpleGETExample extends MIDlet {
private Display display;
String url = “http://127.0.0.1/midlet/testGET.php?type=2″;
public SimpleGETExample() { display = Display.getDisplay(this); }
[…]