views:

36

answers:

1

I took upon myself to create an App that allows the user to draw and as he draws the strokes would be sent to a server via a Socket connection. The app also needs to receive strokes and display them as well.

This would be just a demo app for our server, not a serious iPhone app.

Any ideas, suggestions would be AWESOME.

I started with this great tutorial: http://icodeblog.com/2008/07/30/iphone-programming-tutorial-connecting-code-to-an-interface-builder-view/ but it took me two days to just get the Hello World up and running :(

A: 

One simple solution would be to render the content in a UIWebView, and let it download the strokes and display them in e.g a HTML Canvas. Interaction could then be done in a relatively platform-independent manner using e.g. AJAX. The iPhone version of Safari is a very capable browser. If you are familiar with these technologies that would probably be the easiest solution.

If you want to roll your own component, maybe using a more high-level protocol like XML-RPC or plain HTTP would be easier than raw sockets?

Krumelur
No, I haven't :( mostly because I am a complete iPhone dev newbe and this is the first time I heard of UIWebView. But that sounds like the besto solution! When you say "download" the strokes, that sounds a bit static and not really interactive or am I missing something. I will read up on UIWebView but let me ask this: is it possible to open a Socket connection and control the Canvas based on the commands coming from the server? Also, is it possible to catch the events of the Canvas and send them to the server in real time?
DrCoPe
I looked at the UIWebView and it doesn't seem to do what I need... That seems to be just a browser view, nothing more... I need a Socket connection and dynamic real time drawing for two people.
DrCoPe
Sorry if my answer was unclear, I added some details :)
Krumelur
:))) I am quite familiar with all the communication choices you mentioned, my main area is WebApps development ;)So, in order to avoid any confusion, let's just say that I *MUST* use sockets ;) (believe me, it just is so in this case)
DrCoPe
Okay, reading your question again, I take it that the protocol is fixed, and that you are experimenting with an iPhone client, right? There exists Cocoa classes for it, check out e.g. NSStream getStreamsToHost
Krumelur
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Streams/Articles/NetworkStreams.html
Krumelur
awesome! that's why i always say people are better then google :) yesterday i went through 15 different tutorials and some of them were better then others but none were like the link you just posted... THANKS!
DrCoPe