Category: Frameworks


Recently I have been working on a small example game for my friend Alex. The game is a version of traditional PONG, two bats and a ball. The difference between my PONG and other PONG’s, is that it’s played on two phones, each player uses their own phone, one player could be in Bangkok and the other in Stockholm, anyway, here’s what happened.

Step 1 – Writing the pong game, this went very well, I had it working in about 2 hours, scores and all. (If your reading this Nolan, I won’t sell the game and I promise, I’ll buy you a beer:)

Step 2 – I had already written an IRC class in MoSync, I’d noticed that IRC was essentially bomb proof and pretty quick. So I implemented the multi-player part of the game, using (don’t laugh) IRC. This worked pretty well, the only problem was flow control, sometimes you get 20 messages a second, other times nothing for a second, then 40 messages.

Step 3 – So I decided to write my own server. I based this on a java server I wrote in 1998, there were some horrific deprecation problems, so I thought I’d try a few other routes.

Step 4 – I wrote a server from scratch in C, this was even more troublesome that Java, I just hate the socket/communications API’s in C, they are just horrible mystical bits of unreadability.

Step 5 – I went back to Java, started at 6am one morning and was finished by 12am, so the moral is, I should have just stuck with step 2 and fixed my deprecated code.

The Point

Finally I had a server that was:

1. Quick.

2. Multi-channel (like IRC but binary)

3. Could handle vast amounts of connection over many channels simultaneously.

4. It’s simple just a 10k  jar file (and growing).

5. It’s easy to run on any computer, regardless of OS.

6. It can be used in conjunction with the JavaScript web sockets API.

7. Its thoroughly generic and multipurpose.

Conclusion

There are so many instances where people create servers, just to connect two (or more) devices together, who would have thought this could be such a problem. Most people will write their own cloud service service, when it really isn’t necessary, all because there isn’t a simple generic server that does just that. So GenServ was born.

Being something of an open source advocate, I fully intend to solve this problem by releasing my server in the next few weeks.

If you would like to help me out write writing some example code or have opinions about my server just comment or drop me a mail.

P.S. IRC can be a good way for devices to communicate, so long as latency and flow control aren’t a problem.

Remy Sharp has written a great blog article, where you can find more info about cross-browser communications methods:

http://html5doctor.com/methods-of-communication/

 

 

The new version of MoSync 3.0 is due for release in the beginning of febuary. Now I’m quite excited about MoSync 3.0, the reason for this is the new features and capabilities
that are I think really interesting. As you may know , I work at MoSync, so I’ll try to be unbiased.

Here’s dome of MoSync 3,0′s new features :

W3C compliant Mobile JavaScript API

This is a new set of native bindings that follow the JavaScript Native API specification set by w3c, it’s based on the PhoneGap API, although its has been vastly improved. This API and all its capabilities can be edited directly within the MoSync base package, there no need to rebuild it independently. So accessibility is now king and nobody is ever dependent on other developers to build this API for you. There’s a big up-side here for existing PhoneGap developers, since they now have the freedom to do whatever they want!

Native UI in JavaScript

Most of the capabilities of both the Android UI & iPhone UI have been included into a rather nice cross-platform JavaScript library, it’s called the JSNativeUI library, it gives you access to a large selection of the native UI widgets and even handles the differences between the devices. Whats more it even has its own HTML mark up, I think this is very cool, because you can be a web app developer and get Native UI at no cost.

Thats all for the moment, I’ll come back later with more.

For more information go to www.mosync.com and read the product road-map or the blogs.

Great article by Brian O’Conner of Universal Mind, its well written and to the point,
the only downside is that is doesn’t mension MoSync anywhere (No self publicity allowed, well not much anyway:).

Mobile HTML5: PhoneGap vs Appcelerator Titanium

If I remember rightly jQuery is 26K and growing, still I like the ideal of people optimizing
their libraries, I wonder if there are any drawbacks to this library.

You can read more about the Zepto JavaScript framework at Thomas Fuchs (I’m a bit of a fan) website:

http://mir.aculo.us/2010/10/28/zepto-js-a-jquery-compatible-mobile-javascript-framework-in-2k-presentation/

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: