Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Blackberry http连接到服务器地址_Http_Url_Blackberry_Connection - Fatal编程技术网

Blackberry http连接到服务器地址

Blackberry http连接到服务器地址,http,url,blackberry,connection,Http,Url,Blackberry,Connection,所以我有一个HTTP连接类,它打开一个URL并返回该页面的内容 例如,它在网站URL上工作得非常好 但是,我需要使用一个作为服务器的URL,例如http://[server]/[records] URL中没有.com或类似的内容 当我尝试连接到服务器URL时,我只在调试消息中得到一个空指针异常 我必须格式化服务器URL吗?我在某个地方读到有人将URL与端口号或类似的东西连接起来我这周在我的博客上发表了一篇网络帖子,不过我这里有一些应该对你有帮助的东西。我还没有完成评论,但我希望能有所帮助。下面是

所以我有一个HTTP连接类,它打开一个URL并返回该页面的内容

例如,它在网站URL上工作得非常好

但是,我需要使用一个作为服务器的URL,例如http://[server]/[records]

URL中没有.com或类似的内容

当我尝试连接到服务器URL时,我只在调试消息中得到一个空指针异常


我必须格式化服务器URL吗?我在某个地方读到有人将URL与端口号或类似的东西连接起来

我这周在我的博客上发表了一篇网络帖子,不过我这里有一些应该对你有帮助的东西。我还没有完成评论,但我希望能有所帮助。下面是一个使用示例

//Other networking stuff I can add here if you need it
//connDesc is a ConnectionDescriptor 
int transportType = connDesc.getTransportDescriptor().getTransportType();
String encodedAddress = URLFactory.EncodeUrl(transportType, _address);  

这是在模拟机上运行还是在实际设备上运行?