12-02-2011 10:13 AM
Hi,
I could successfully connect to the server and get data when there is WIFI. But when wifi is not available it fails. Using
ConnectionFactory factory = new ConnectionFactory();
factory.setPreferredTransportTypes(new int[]{
TransportInfo.TRANSPORT_TCP_WIFI,
TransportInfo.TRANSPORT_TCP_CELLULAR,
TransportInfo.TRANSPORT_WAP,
TransportInfo.TRANSPORT_WAP2,
TransportInfo.TRANSPORT_MDS,
TransportInfo.TRANSPORT_BIS_B
});
ConnectionDescriptor conDescriptor = factory.getConnection("url");
int test5= conDescriptor.getTransportDescriptor().getTranspor
int[] test =TransportInfo.getAvailableTransportTypes();
boolean test1 = TransportInfo.hasSufficientCoverage(6);
boolean test2 = TransportInfo.hasSufficientCoverage(1);
boolean test3 = TransportInfo.isTransportTypeAvailable(1);
String t = (TransportInfo.getTransportTypeName(1));
When I debug Test1 = false but test2 and test3 both returns true. Still the conDescriptor is null
Please help,
Janaka
Solved! Go to Solution.
12-05-2011 03:45 PM
Hi Janaka,
Did you set the APN for the TCP Cellular connection?
ConnectionFactory#setTransportTypeOptions(int transPortType, TcpCellularOptions)
If not already set on your device, this would be required to make the connection for most carriers.
Regards,
12-06-2011 05:34 AM
Hi Garett,
Thank you very much for your response. Yes it was APN issue. Working fine now.