views:

1507

answers:

3

I am considering using MonoTouch for some iPhone development, but payload size is an important factor.

For a user who has never installed Mono on their iPhone before, what would the size of an Objective-C "Hello World" app be compared to a MonoTouch "Hello World" app?

More specifically, what is the approx. number of bytes that need to be downloaded, and what is the approx. number of bytes used once installed?

+8  A: 

A "Hello world" program in Objective C occupies 50KB (whole .app folder). With Mono Touch, a similar "Hello World" app occupies 5MB (whole .app folder), which is not bad at all considering it has a runtime with garbage collection in it.

Zoran Simic
Apps are sent zipped to the app store, so count a 30 to 50% or so reduction in size for the download size. Once installed on the device, the app will take the same amount as the .app folder you built.
Zoran Simic
Not correct Zoran. The zipped executable size is NOT what the appstore lists for size. One of our applications was under 10mb when zipped and uploaded, however it now shows as 14.7 in the store. This unfortunately puts us over the limit for 3g downloads.
Lounges
Yes indeed, I mistakenly stated 70% when I meant 30... Deleted the comment, but now I realize I shouldn't have because someone followed up on it :) So, disregard the percentage statements. The download size is whatever the zipped file size is.
Zoran Simic
Oh, and I didn't know that. I thought the download size was the size of the zipped .app folder. One learns every day :) So, disregard my comments entirely then :)
Zoran Simic
@Zoran: Thanks, that's really helpful. It would be nice if the full MonoTouch code didn't have to be deployed each time, if there was already a MonoTouch app on the device...
RedFilter
5MB is HUGE! objc + GC on Mac OS X occupy less than 1.25MB. I'd bet most of that 5MB is the gluey goop between the Mono APIs and the Cocoa Touch APIs.
bbum
bbum: Yes, that is definitely the case. Just like Cocoa, Java and the .NET frameworks before it, Mono is 99% libraries, 1% runtime (if you measure in disk usage that is)
rpetrich
I think it would be very smart for Apple to give some support to Mono Touch just like they did to Bootcamp: yes, people can easily install Windows on a Mac now, but that's the reason I got started on Mac! I bought one thinking I would probably drop it and just install Windows on it... I thought I wouldn't like OS X as much as I loved the hardware. 6 months later, I dropped Windows completely! Supporting Mono Touch could have similar benefits for Apple. I don't plan to use Mono Touch, but it's a fantastic thing to have. They should bundle the Mono runtime with each iPhone, starting at v4.0
Zoran Simic
@OrbMan Apple does not allow the use of a virtual machine such as mono, hence the need for MonoTouch to embed part of the VM that are required by the application.
Julien
Ok, so you get GC at the cost of five megs. If I had a five meg leak, I'd consider that a pretty major bug.
NSResponder
The apps are not that big, I'm not sure where "5meg" comes from. Unless you include the entire monotouch API set, but most apps use an area only. I produce more apps and sell more apps and make more money now that I switched from XCode to Monotouch and in the end, that's the best benchmark for a commercial developer. Happy, paying customers and lots of them.
BahaiResearch.com
A: 

Don't do it. If you want to ship an app on the iPhone, learn the native development environment.

NSResponder
Can you qualify that statement?
RedFilter
I can; using MonoTouch means you sacrifice a visual debugger to get to use a language you already know C#. Learning Objective-C can be done in days, so you will save days, and loose weeks struggling with learning Cocoa Touch with little documentation and no debugger.
PeyloW
I'm one of those .NET'ers who added Obj-C to my toolbelt. I switched back to .NET and Monotouch after I got a few apps under my Obj-C belt. I am more productive in Monotouch now than I was in Obj-C, but that is probably because I know .NETWhen porting an app over to Monotouch the # of lines I had to write was about 1/3 so I can make apps faster. I have 6 apps now up in the App Store in Monotouch and they all sell just as good and people are just as happy.If you know .NET use Monotouch ; your learning curve is must less.
BahaiResearch.com
@BahaiResearch.com: how difficult do you find debugging in Monotouch vs. Obj-C?
RedFilter
Much better than I found it in XCode, but I do originally come from VS.Net so have a high expectation level for debugging support. Watches, tracing, stack etc etc When I get an exception I get the exact line and it jumps there for me. Hover values with sub types are displayed nicely. I have 21 apps now on the App Store in MonoTouch. All going fine, great comments from users and lots of sales.
BahaiResearch.com
MonoTouch's debugger is world class. As good as Visual Studio. The only exception is that I'd like to see a data visualizer to dig into hierarchical data sets like VS.Net has. Having written many apps in both Xcode and MonoTouch I can now say without hesitation that MonoTouch is significantly faster. I'm roughly 3x as production if counting # of apps of similar size is an accepted measure.
BahaiResearch.com
Apple adding Monotouch support to iPhone will never happen, it originates from Microsoft and is aimed at selling Windows licenses.
Chris S
FWIW, the restriction on third-party libraries like MonoTouch only applies to App store submissions. If you want to use it for in-house applications, you still can.
NSResponder
A: 

In 1.5 Monotouch

A release build - that is a an application built with a distribution license - and with nothing but the default project settings, is 5mb. Of that 4.3mb is the binary executable.

They often rise to up to 10mb in my experience, and the forums paint the same picture. The appstore reports the unzipped size, however they are downloaded zipped. Zipped is around 3mb which even on a 3G is fine.

In my view, most people won't look at the filesize before downloading an app, nor particularly care. The appstore limit for 3G downloads is now 20mb which is well within the Monotouch size.

To play devil's advocate, yes it is many orders bigger than the objective-c equivalent and could scare off a few people worried about occupying 4-10mb more of their 16gb space. However there is also time to market and the existing tools available for .NET. I develop and build all my Monotouch apps in Visual Studio 2010 then test them on the Mac, and I don't think even Apple would argue their IDE is close to the industry leader.

Chris S