12-15-2011 02:05 PM
12-16-2011 12:54 AM - edited 12-16-2011 02:25 AM
Yesterday I left the app in open state (By pressing red end key) @ 8PM and today after 14 hours (in this time no one touch the device), around 10 AM open my app and press an item and I got the network exception error, but this is for the first hit only. After that i dint change any settings or anything jus try one more time but everything works fine.
When I check the log file:
Around 9:58AM: d podcassts - coverageStatusChanged: newCoverage: 0
and the url in the log file http://10.0.1.5:6070/middletier-web/news.do?
Java Exception - IOException - Detail - APN is not specified
d podcassts - coverageStatusChanged: newCoverage: 1
and the url in the log file http://10.0.1.5:6070/middletier-web/news.do;interf
for the first hit only device was not able to open the tcp socket but after that it was able to open the tcp socket over wifi
and from the log for the first hit the appended strings are not get printed (i.e., either ;interface=wifi or ;deviceside=true) etc.,
12-16-2011 01:29 AM - edited 12-16-2011 02:11 AM
After a very long hours of keeping the phone idle the network not get refreshed or is it the device behavior?
Since I've written in my code using RIM's transport detective to detect the coverage availability either wifi or wap2 but the connectionstring parameter is not get appended for the first time means there is no coverage availability in my device (eventhough i've connected with wifi) right?
I ll do a retry in my code, but how can I refresh the wifi network each & every time? is there any possibility for that?
12-16-2011 04:56 AM
I'm guessing that your phone went into idle and to save battery, it shutdown the WiFi network, so the code chose direct TCP but you don't have the APN parameters set to actually use that method, even though it is available.
Later the WiFi kicked back in and your mechanism went back to WiFi.
This is working correctly. It is not doing what you want I guess, so you need to think about how you handle this.
Because if this sort of confusion, I generally recommend that you try to find a connection method that works, and stick to it. If there is a problem, try to find another one, but don't swap to it until you are sure it works. Also give the user the option to re-test. I think this is more complicated to implement but simpler for the users. In this case when they retried and WiFi was not available, you would just say " WiFi not available, do you want me to try to connect another way?"
I don't use ConnectionFactory for this reason.
12-16-2011 05:14 AM
What else are you using instead of connection factory?
find a connection method that works, and stick to it. If there is a problem, try to find another one - What do you mean here - In that class itself am looking for wap2 if that is not available then looking for wifi?
Please explain me in detail how to handle this or an alternate solution for this problem
Normally I thought the developers would use this Connector.open(url) for connection creations?
Facing a lot of connection related issues everyday
Also am developing in OS 4.5
12-16-2011 05:27 AM
ConnectionFactory is OS 5.0. So doesn't apply.
There is nothing wrong with your code.
I was suggesting that you only test the options available at set-up time, or when the connection tried fails. Once you have found a connection method that works, record that somewhere and use it by default in future rather than checking the options again. I just find this easier to manage. How you change your class to manage this is up to you - if in fact, you think it is a good idea.
The real issue you have had with this problem is that you did not know what connection was being used, nor did you know what the actual exception was. You need these bits of information (and the carrier and sometimes the user's plan details, and sometimes the header fields on the http response - see here: http://supportforums.blackberry.com/t5/Java-Develo
12-16-2011 05:28 AM
Also if wifi is not available then how browser is working, Are they using the direct tcp?
Do I have to check out for TRANSPORT_TCP_CELLULAR and append the connectionstring with ;deviceside=true
12-16-2011 05:43 AM
The questions you are asking are commonly asked on this forum.
The short answers are:
a) The Browser is using BIS-B, which you probably do not have access to
b) Making direct TCP carrier agnostic is a dream at the moment, the best you can do is ask the user to input the APN settings for their carrier or have some special built-in conversion that will create the connection APN parameters for direct TCP.
I suggest some further reading to get more detailed answers youself including:
1) Type network on the search button and review the videos
I'm still learning. Recently I had connection code that has been working for years break because of a parental lock that some mobile network put on.....
12-16-2011 06:30 AM