Wondering how to connect blackberry to desktop or the other around via tcp/ip? I assume both the desktop and the blackberry are connecting to the same router.
If I read your question correctly and you want a TCP connection over a WiFi router on the same LAN as your desktop, then from your BlackBerry app you simply do:
javax.microedition.io.Connector.open("socket://<your desktop's IP/hostname>:<port>;interface=wifi");
(you can replace socket:// with tls:// ssl:// for a TLS or SSL3 socket connection)
If you're going over the cell network the situation is a bit more complex - you'll only be able to connect to your desktop if your device is attached to a BES on the same LAN as your desktop, or if your desktop has a public IP, but the basic syntax is the same (minus the interface=wifi obviously).
Related
I have an iOS application with a tableview which I would like to send text strings via USB to my Windows computer indicating which cell was selected by the user.Anyone have experience with this type of interface?
I've written a blog post detailing how to achieve this here.
http://thecodewash.blogspot.com/2017/05/communicating-with-your-ios-app-over.html
To answer your question (so this answer isn't just a link), yes it definitely is possible to achieve this utilizing the USB Multiplexing Daemon (usbmuxd) program that is usually installed as part of iTunes. This program can create a socket connection to your iOS device through the USB cable, and allow you to communicate via that socket connection like you would any other socket. The link goes into much more detail.
Hope this helps!
(In short) Yes, you can communicate with ios application via normal socket communication by using ITunes which acts like proxy. In this model your ios app acts like server listening for connection. Windows app must connect to iTunes on port 27015 and estabilish connection to specific port (used by ios app) on connected via usb device. This is done by using a special MUX protocol described here
I have my OS X development laptop hooked up to the net via an iPhone 5 connected with USB (Personal Hotspot). With a web server running locally for my development work, can I load pages from this server on my iPhone and then inspect them with Safari's Web Inspector? I have tried 127.0.0.1 and my connected IP public address but no success.
It is possible to do this - it just required a bit of investigation as to how the networking is arranged when using an iPhone via USB with Personal Hotspot. There are two steps:
Firstly, using USB, the USB port is setup as a network interface. The precise (and technical) details can be seen with ifconfig however what you need to know is what IP address is used for the USB interface.
Go to Network Preferences and select the iPhone USB on the left hand side. You will see a message like iPhone USB is currently active and has the IP address 172.20.10.2. Note that this is not the publicly available IP address, it is the network interface on the Mac. This is the ip address you need to type into the browser on your iPhone to see your local development server.
Secondly, you need to make sure that your local development server is serving the USB interface. This will obviously vary depending on your server but typically there will be a HOST parameter that directs the server to bind to that IP address. Again, use the IP address you found above to instruct the web server to serve pages on that IP.
I am developing jQuery mobile app using vs2010 in PC, I want to access localhost on my phone's browser. But I don't want to use the wifi since the connection is very slow.
Can I do it via USB?
Probably not.
However if you bring device in network then you can access via PC ip.
I'm trying to write an app that uses TCP/IP to communicate to and from an iPhone. To test the basic calls, I was trying to open port 7 (which supposedly is set up to echo any input back to the receiver), write to it, and read the results.
My code works after a fashion. I can, for example, open a site using "www.xxx.com" for a host name and port 80, write an http address, and get back a response.
The problem is that I get an error, "The operation couldn't be completed. Connection refused" error when trying to access port 7, and presumably any other port that isn't opened by Apple for a specific purpose. I've opened port 7 on the AirPort WiFi router using the AirPort Utility app, and tried opening and writing to port 7 both on my Mac and on the iPad using their respective IP addresses from iOS, and always get the same error.
What needs to be done to open ports so I can use TCP/IP to communicate using iOS, either to other iOS devices or with a desktop computer? Or is using port 7 as a test simply not the way to go?
This question was answered by some kind folks on the Apple Developer forms. To summarize:
There is no supported way to use an echo service on iOS. The only way to test TCP/IP turns out to be to create a connection to an actual server. The development Mac can be used for that using, for example, netcat.
I want to know how connection is established between my BB phone and BES?
Is connection based on my mobile service provider or some other thing?
Can u tell me ,how is this?
Usually a Blackberry is used in a corporate environment. Using the Blackberry MDS Dataservice a connection looks like this. The datastream is encrypted and compressed.
(source: blackberry.com)
For a quick overview I recommend this video by Research in Motion.
Network Transports
The connection between a Blackberry and the BES can be carried over the wireless carrier network, to the internet, to the RIM operations centre then by the internet to the BES; or by Wi-Fi to the internet to RIM to the internet to the BES; or by Wi-Fi directly to the BES (if the BES is local to the Wi-Fi connection); or by USB to a PC with Desktop Manager via the local area network to the BES.