Question

Hey Hi Friends I am created one j2me app. it runs perfectly in Emulator but in Mobile it showing error like java.lang.nosuchfielderror:No such field HEADERS.[[Ljava/lang/String;. Why this happening with mobile, it runs good in emulator...... Please help me to remove this error......

public String connectPhoneName() throws Exception{
    String url = "http://122.170.122.186/Magic/getPhonetype.jsp";
    String phoneType;
        if ((conn = connectHttp.connect(url, HEADERS)) != null) {
            if ((in = connectHttp.getDataInputStream(conn)) != null) {
                byte[] data = connectHttp.readDATA(in, 100);
                phoneType = new String(data);
                System.out.println("DATA : " + phoneType);
            } else {
                throw new Exception("ERROR WHILE OPENING INPUTSTREAM");
            }
        } else {
            throw new Exception("COULD NOT ESTABLISH CONNECTION TO THE SERVER");
        }
    return phoneType;

}

In this code i have used HEADERS.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top