This is my First Post to the forum.
I have been playing around with the Basi4Android,- which I think is a fine product - to see how things work and what I might use to solve a problem.
The problem I am working on is this:
I need a permanently connected GPRS connection so I can send randomly timed messages to android devices.
To keep the connection open,I send keepalive mesages from the android.
The problem occurs when I do not get an acknowledgment back within
30 secs - the timeframe for deciding the connection is broken.
To check for the 30 second timeframe I start a startserviceAT
At the moment I put the message IDs in a list and when the service fires
after about 30 seconds, I assume I am working with the first one in the list
What would be nice is if I could pass a parameter with the startserviceAT command to say which message ID I am working with. So that when it fires in 30 seconds I have the ID that will have failed, rather than making an assumption.
I could probably make the assumption valid but it would be good just to have the ID ready to hand.
So far I have not found a way of doing this.
So my question is:
Have I gone about this completeley the wrong way..
Or have I overlooked some obvious method of making a deferred call and passing a parameter
So I am wondering if anyone can give me some pointers to a better way of solving the problem
Some further background for anyone that may not already know this:--
The nature of GPRS is that the connection could disappear at any time and be
reconnected at any time.
However, the mobile network routers along the way will not immediately drop
the connection on the basis that GPRS will always be dropping and reconnecting.
So they will keep the connection up for a determined period of time. Some will do 15 mins,others 30, others 1/2 mins.
When GPRS reconnects it could come back with the same connection.
If the router has really dropped the connection then a new connection will have to be made
So the only way I have of telling if a connection is down is to send an acknowledgment back for every keepalive message sent from the android.
Thanks for any help or info
Regards
John Aherne
I have been playing around with the Basi4Android,- which I think is a fine product - to see how things work and what I might use to solve a problem.
The problem I am working on is this:
I need a permanently connected GPRS connection so I can send randomly timed messages to android devices.
To keep the connection open,I send keepalive mesages from the android.
The problem occurs when I do not get an acknowledgment back within
30 secs - the timeframe for deciding the connection is broken.
To check for the 30 second timeframe I start a startserviceAT
At the moment I put the message IDs in a list and when the service fires
after about 30 seconds, I assume I am working with the first one in the list
What would be nice is if I could pass a parameter with the startserviceAT command to say which message ID I am working with. So that when it fires in 30 seconds I have the ID that will have failed, rather than making an assumption.
I could probably make the assumption valid but it would be good just to have the ID ready to hand.
So far I have not found a way of doing this.
So my question is:
Have I gone about this completeley the wrong way..
Or have I overlooked some obvious method of making a deferred call and passing a parameter
So I am wondering if anyone can give me some pointers to a better way of solving the problem
Some further background for anyone that may not already know this:--
The nature of GPRS is that the connection could disappear at any time and be
reconnected at any time.
However, the mobile network routers along the way will not immediately drop
the connection on the basis that GPRS will always be dropping and reconnecting.
So they will keep the connection up for a determined period of time. Some will do 15 mins,others 30, others 1/2 mins.
When GPRS reconnects it could come back with the same connection.
If the router has really dropped the connection then a new connection will have to be made
So the only way I have of telling if a connection is down is to send an acknowledgment back for every keepalive message sent from the android.
Thanks for any help or info
Regards
John Aherne