黑莓应用程序建立http连接
我一直致力于开发黑莓应用程序。现在,我希望应用程序连接到网络上的本地服务器并从该计算机获取文件。我一直在使用由一位名叫彼得·奇怪的黑莓开发人员提供的库....这里是相同的链接 通过 BIS-B 的 Http 连接
我的要求是使用任何传输方式设置与本地服务器的连接模式,但它应该能够渲染下载的文本。
我尝试使用blackberry示例提供的演示,因为它附带了eclipse插件,这些示例中的http演示仅显示尝试设置http连接字符串,而当根据需要输入url时,networkapidemo示例显示不同的http代码。我是在模拟器上运行所有应用程序。我还没有尝试在硬件上运行我的任何应用程序,
我可能知道为什么这个问题是由http代码引起的....我还想知道如何设置简单的http连接只是为了从a下载文件(文本文件)的指南本地服务器。
我也尝试过很多论坛。如果有人愿意看一下,我会将其发布在这里。 仅仅简单的连接就变得令人头疼!
无论如何...等待回复..
提前感谢大家:)
i have been working on developing an blackberry application. as per now i want the application to connect to a local server on my network and fetch a file from that machine. i have been using the library given by a named blackberry developer Mr.peter strange....here is the link for the same Http connection through BIS-B
my requirement would be setting up connection to the local server using any transport mode but it should be able to render the text downloaded.
i tried using the demos provided by blackberry samples as it comes with the plugin for eclipse the http demo from those samples shows only trying to setup an http connection string and the networkapidemo sample shows diffrent http codes when the url is entered as desired.i am running all the applications on the simulator. i havent tried running any of my apps on the hardware
may i know why this problem arises of http codes....ill also want to know guidelines about how to set a simple http connection just to download a file(text file) from a local server.
I have tried many forums too. if anybody would have a look at it i would post it here.
Only a simple connection is becoming a headache!
anyways...waiting for replies..
thanx in advance guys :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无论您想与本地服务器还是远程服务器通信并不重要。
1) 请参阅 HttpConnection。里面有示例代码。
2) 不幸的是,在 BB 上您应该了解网络传输。检查 此线程 获取您需要的有关网络传输的所有信息。
更新:
第二点解释了一种适用于任何操作系统的方法。如果您需要仅 OS 5+ 的方法,请检查 ConnectionFactory API。 ConnectionFactory 使用 sapmles 。
It does not matter whether you want to communicate with local or remote server.
1) See the API docs on HttpConnection. There are sample code in there.
2) Unfortunatelly, on BB you should be aware of Network Transports. Check this thread to get all info you need on Network Transports.
UPDATE:
The second point explains an approach that will work on any OS. If you need an OS 5+ only approach, then check the ConnectionFactory API. ConnectionFactory usage sapmles.