Cross-platform Objective-C
At Apportable, we believe:
Rewriting your app to support other platforms is a waste of a developer's time and creativity.
Developers should be able to use the best tools and languages to develop mobile apps that work on multiple platforms without compromising performance or quality.
About Apportable
-
Founded Winter 2011 in YCombinator
- First app, Osmos, shipped January, 2012
- In July 2013, raised $2.4M lead by Google Ventures
- Raised $5m as of two days ago
- Today powers hundreds of best sellers on Android
What exactly is the Apportable SDK?
The Apportable SDK compiles your Objective-C (iOS) source code into a native application that runs on Android.
( warning: technical description. )
Apportable bridges the gap between iOS and Android.
Use the same tools you use to build for iOS to make Android apps!
Xcode!
Ship using the same code!
Apportable works great to integrate early on in the development lifecycle to ship simultaneously or use it port your game after you have shipped.
(It's entirely up to you.)
Who uses it?
to name just a few...
10,000 SDK downloads!
and hundreds of apps shipped.
How does Apportable work exactly?
(What trickery is this?)
What Apportable is NOT
-
It is NOT source code translation
-
It does NOT generate Java
-
It is NOT an iOS emulator on Android (i.e. WINE)
How do I use it?
-
Visit www.apportable.com and sign up
-
Install the SDK and toolchain
-
Open a terminal window and navigate to your source code
-
Plug in your Android device (or start an emulator)
-
Run apportable load and answer a few questions about your app
-
Thats it!
(well almost)
(this part is going to get a little more technical)
The Apportable SDK includes...
Frameworks
& Libraries
UIKit
Boost
ICU
libpng, libgif, libtiff, libjpeg
CoreGraphics
OpenAL
CoreAnimation
libobjc
C++11 (libc++)
libc
libdispatch
Core Foundation
Foundation
The same clang compiler used in Xcode
Our own fork of clang with added support for Android
Debugging and tools
-
Latest GDB
- Our own Apportable profiler suite
- memory, network, performance
- resembles a mini instruments
3rd party libraries
- Flurry, AdMob, Chartboost, and many more work out of the box
- Most source libraries work out of the box (Facebook, DropBox, etc.)
- Adding new 3rd party library support is easy.
The Best Features
-
ARC
- C++11
- Assembly
- Objective-C literals
- Objective-C Runtime API (swizzling, etc)
No bloat.
Only 6mb of dependencies.
We have done the hard work of supporting the fragmentation in Android
Customizing For Android
A little optimization goes a long way towards presenting a native experience on Android.
Customizing your Android build
- Edit the .approj directory generated next to xcode project
- In the <project>.approj/configuration.json file you can:
- Add and remove source files
- Tweak the APKs features and permissions on Android
- Change defines, icons, and other settings
Support More Screen Resolutions
- Handling the native resolution is best and will always look the better
- If you made assumptions about iOS screen sizes, you can emulate them on Android and scale your UI up with UIScreenModes
#ifdef ANDROID
[UIScreen mainScreen].currentMode =
[UIScreenMode emulatedMode:UIScreenBestEmulatedMode];
#endif
Add Hardware Button Support
- (void)buttonUpWithEvent:(UIEvent *)event { switch (event.buttonCode) { case UIEventButtonCodeBack: // handle back button if possible,
// otherwise exit(0) break; case UIEventButtonCodeMenu: // show menu if possible. break; default: break; } } - (BOOL)canBecomeFirstResponder { return YES; }
Use different device information
UIDevice+Apportable.h
@property (nonatomic, readonly) NSString *nativeCPUABI; // e.g. "armeabi-v7a"
@property (nonatomic, readonly) NSString *nativeModel; // e.g. @"Xoom" @property (nonatomic, readonly) NSString *nativeManufacturer; // e.g. @"Motorola"
@property (nonatomic, readonly) NSString *nativeSystemVersion; // e.g. @"4.2" @property (nonatomic, readonly) NSUInteger nativeSDKVersion; // e.g. Froyo is 8 @property (nonatomic, readonly) NSString *macAddress; // requires access_wifi_state @property (nonatomic, readonly) NSString *odin; // open device identifier number @property (nonatomic, readonly) NSString *nativeSecureIdentifier; @property (nonatomic, readonly) NSString *telephonyIdentifier; // read_phone_state
@property (nonatomic, readonly) NSString *carrierBranding; // e.g. @"Verizon"
BridgeKit
- BridgeKit is a fully Objective-C API for bridging to Java and calling Android APIs or custom Java code
- Used to back much of UIKit and system APIs
Bridging Application Lifecycle
- Apportable backs iOS lifecycle events with their Android counterparts
- application:didFinishLaunchingWithOptions: --> Activity.onCreate
- applicationDidBecomeActive: --> Activity.onResume
- applicationDidEnterBackground: --> Activity.onStop
-
When apps are in the background, Apportable emulates iOS behavior by suspending them
Push Notifications and Local Notifications
- Push notifications are handled by Google Cloud Messaging on Google Play Apps
- Other push notification services such as Parse and Urban Airship are supported as well
- Local notifications translate to a custom alarm service
In App Purchasing (StoreKit)
- Apportable's StoreKit bridges to:
- Google In App Billing on Google Play
- Amazon Payments on Amazon App Store
Framework Support
Foundation - 100% coverage.
CoreFoundation - 100% coverage
CoreAnimation - Limited. New version in development backed by OpenGL
UIKit - Current shipping version is limited to simple UIKit apps. Full UIKit support backed by new CoreAnimation in development
CoreData - Working. Limited to automatic migration support only
AVFoundation - Audio but no video support
MediaPlayer - Video and audio supported (codecs depend on device, ogg is the most universal)
- OpenGL and OpenAL - Full coverage of latest versions
iOS 7 Features
-
SpriteKit - currently 20% faster than iOS (even on iOS)
-
GameController API - makes it easy to support Android game consoles like GameStick and Ouya
OpenGL based UIKit preview
Cocos2D
- The most popular open source iOS game engine, cocos2d, is maintained by Apportable engineers.
- SpriteBuilder (formerly CocosBuilder), an animation editor for cocos2d, is developed by Apportable engineers.
- Chipmunk Obj-C physics engine (included in cocos2d) is sponsored by Apportable.
- cocos3d also sponsored by Apportable
- And more! http://github.com/apportable
Russian Resources
Great tutorials from our users in Russian:
http://habrahabr.ru/company/beetleplay/blog/186636/
Apportable can answer any support questions in Russian!
About me
- My name is Zac Bowling
- Platform Engineer at Apportable
- I love hackathons - 117+ hackathons in the last 4+ years
- Email: zac@apportable.com