0

For my master's thesis I want to write an application that can send files (images, pdfs, notes,...) from an iOS device to a java-application running on a tabletop and vice versa.

I already implemented working bonjour discovery and resolve routines in objective C and java, but I have no idea how to send/receive the actual data. And how do I know which type of file I am dealing with on the receiving end?

FransGuelinckx
  • 147
  • 2
  • 7
  • Xcode vs Java... IDE vs a programming language. Guess it's time to learn the difference, especially since you're writing a thesis. – Macmade Dec 12 '11 at 17:06
  • I know perfectly what the difference is. Objective-C vs Java, hope that's better for you? – FransGuelinckx Dec 12 '11 at 19:22
  • Then tag your question correctly, and add a proper title. Xcode is not dedicated to Objective-C. You can code with C, C++, ObjC, Python, ... And so one, as a normal IDE. I personally think a better title and tags will attract more users, if you want a good answer. – Macmade Dec 12 '11 at 19:26

1 Answers1

1

You need to do some socket programming. How do you know file types, sizes, whatever else? Depends what protocol you choose to implement. If your iOS device only needs to send data, probably the quickest win would be to use an HTTP client to upload stuff to a Java-based server.

Have a look at this Apple guide for making basic HTTP requests or check out a third-party library like ASI. YMMV.

If all you need in the Java app is a minimal upload handler, check out Netty. You can get a simple server going with very little effort.

HTTP's just a suggestion, although the quantity of good client & server libraries makes it a reasonable choice unless you have a special requirement it can't satisfy. If you want to roll your own protocol to push files back & forth, that's cool too. You'll need to familiarize yourself with socket programming on the respective platforms though.

Chris Mowforth
  • 6,689
  • 2
  • 26
  • 36
  • Thank you, that is very helpful. I need to send back and forth, so I think I will set up an ftp server on the java side and use GET and PUT commands etc on the iOS devices. Apple has some FTP sample code to get me started. – FransGuelinckx Dec 12 '11 at 19:27