Symbian OS error

Forum for J2ME mobile games related topics including programming doubts, books and other resources for J2ME game development

Postby DevelopmentTeam » Mon Apr 02, 2007 5:09 am

First of all, no problem. Being a developer I can understand that it is not easy sending the cade to others. Now as you said 6600, I have come across some related bugs. 6600 strictly doesnt allow 2 connections at a time. Now just try to have a boolean which will be set true when the thread create a httpconnection and only makes it false when the object is made null. now in the thread make a infinite while untill the boolean becomes false before doing the actualy job. The boolean should be static. Now this will avoid 2 thread problem. On doing this we can ensure if the problem is with threading. Or else increase the delay before the each thread so that we can ensure it.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby hemavarthini » Mon Apr 02, 2007 5:14 am

Hi hari
I will try these two ways and reply u shortly.
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Postby hemavarthini » Tue Apr 03, 2007 5:11 am

I have tried with those 2 ways.Still I am getting those errors.I think it is not connected to thread problem. :roll:
Last edited by hemavarthini on Tue Apr 03, 2007 8:43 am, edited 1 time in total.
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Postby DevelopmentTeam » Tue Apr 03, 2007 6:08 am

This is our standard class which we use in our applications, and we have heavy threading in our application which will not give any error with this code.


Code: Select all
import java.io.IOException;
import java.io.InputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;

public class HttpConnect implements Runnable {
    private Thread thread;
    private String URL;
   
    public HttpConnect(String url) {
   thread = new Thread(this);
   thread.start();
   this.URL = url;
    }
   
    synchronized private void connectUrl() {
   String message = "";
   try {
       HttpConnection hc = null;
       InputStream in = null;
       hc = (HttpConnection)Connector.open(this.URL);
       in = hc.openInputStream();
       int ch;
      
       while((ch = in.read()) != -1)
      message = message + (char) ch;
      
       Store.resultantMessage = message.trim();
       in.close();
       hc.close();
       hc = null;
       in = null;
       thread = null;
   } catch (IOException ex) {
       System.out.println("Unable to create " + URL + ": "+ex.getMessage());
   }
    }
   
    public void run() {
        connectUrl();
    }
}
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby hemavarthini » Tue Apr 03, 2007 8:46 am

Thanx.
But I think it is not connected to the thread problem.Do u think it may be because of device problem or GPRS service.
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Postby DevelopmentTeam » Tue Apr 03, 2007 9:00 am

Might be, coz 6600 has a lot of Httpconnection related issues. So try it in other devices now. So that we can confirm the bug...
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby hemavarthini » Tue Apr 03, 2007 10:26 am

Yes,I think that may be because of device only.Because we checked in N70 and also in 6230i.We dont get that problem.So I think it may be due to firmware.
Last edited by hemavarthini on Tue Apr 03, 2007 10:36 am, edited 1 time in total.
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Postby DevelopmentTeam » Tue Apr 03, 2007 10:33 am

yes, 6600 has 3 firmware versions, On the first version which comes with the new devices in India has a big bug which frequently blocks GPRS service. even on the phone's browser this happends, if you call customer care and tell your mobile model as 6600, their first reply would be "please take your phone to nokia care and upgrade your firmware for your GPRS to work properly" I have come across such problems. When it works fine on N70 then we dont have to worry about the code for S60 devices regarding platform. So carry on with your development work. Dont worry if the bug only appears on 6600. It should be the one which I mensioned.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby hemavarthini » Tue Apr 03, 2007 10:44 am

Thank for your information.
I think i can give a fullstop to this bug.So that i can concentrate on launching our game.
If I have any more doubts i will surely disturb u.
Once again Thanx for your help.
hemavarthini
 
Posts: 28
Joined: Fri Mar 23, 2007 7:07 am

Previous

Return to J2ME Games

Who is online

Users browsing this forum: No registered users and 1 guest

cron