среда, 18 января 2012 г.

Introduction

Ever wanted to "just rebuild" your iOS app for Android?

Itoa project is just about that. It is a cluster of open-source projects hosted on Github that implement compiler, build scripts and various libraries to allow building Android's apk from Objective-C source files.

Two main features of Itoa are:
  1. Itoa uses Android UI and graphics classes to implement iOS counterparts, so ported applications look and feel native. For example, UIButton wraps android.widged.Button and CGContext wraps android.graphics.Canvas.
  2. Itoa uses Apple's open-source code (GCC patches for Objective-C 2.0, objc4 runtime and CoreFoundation library) for maximum compatibility with iOS.
Here is a short overview of Itoa projects with their licenses:
  • itoa-main :: ItoaCore, UIKit, CoreGraphics and QuartzCore libraries (GPL).
  • itoa-foundation :: Foundation implementation based on Cocotron (MIT).
  • itoa-cleancf :: Refactored Apple's CoreFoundation; supports bridging (APSL, Apache).
  • itoa-objc :: Apple's objc4 runtime ported to Android (APSL, Apache).
  • itoa-jnipp :: General purpose C++ JNI wrappers (Apache).
  • itoa-macemu :: Emulation of malloc_zone_t functions and OSAtomics (Apache).
  • itoa-dropins :: Various utilities (notably, a C++ wrappers for pthread) used in projects (Apache).
  • itoa-toolchain :: GCC 4.2.1 with Objective-C 2.0 patches (GPL).
  • itoa-ndk :: Scripts to build, install and run Android applications from Objective-C source files (Apache).


Current status of Itoa is best described as "first step on a journey of thousands miles": something is working (you can even build simple applications), but anything serious is not possible, due to missing libraries, incomplete API, insufficient Android integration, etc.

Project statuses at a glance:
  • GCC 4.2.1 compiler (3/5): supports most of Objective-C 2.0, but is outdated, and some features are missing (@optional directive, blocks).
  • Objective-C runtime (4/5): supports all features (except for GC), though some cleanup and refactoring is needed.
  • CoreFoundation library (2/5): all basic classes are there (CFString, CFArray, CFSet, etc.), but several essential classes are not (CFBundle, CFSocket, etc.). Besides, there is no Android integration.
  • Foundation library (2/5): while most of the classes are there (since implementation is based on Cocotron), only two classes are bridged to CF (NSString, NSData). Some classes are not working properly (NSRunLoop, NSInvocation). No integration with Android.
  • QuartzCore library (0/5): only CALayer class is implemented.
  • UIKit library (1/5): only basic classes are implemented (UIApplication, UIResponder, UIView, etc.). Multitouch is not supported. Nibs not supported.
  • CoreGraphics library (0/5): GCColor, GCRect plus minimal implementation of CGContext.

That's it for the introductory post. In the next posts I will cover status of each project in more detail and propose tasks to do. I will also describe hacks currently employed (like running Android's loop inside CFRunLoop and using Android's ICU).

Give Itoa a try and let me know what you think (here or in itoa-dev group). Links:

Комментариев нет:

Отправить комментарий