Professional Documents
Culture Documents
I Phone
I Phone
MAD-IP
artesis 2008 | 3
Features
Screen size: 3.5 in (89 mm) Screen resolution: 480320 pixels at 163 ppi, with 3:2 aspect ratio Input devices: Multi-touch screen interface plus a "Home" button and "Sleep/Wake" located on the top of the iPhone. Built-in rechargeable, non-removable battery 2 megapixel camera Location finding by detection of cell towers and Wi-Fi networks Samsung S5L8900 (412 MHz ARM 1176 processor, PowerVR MBX 3D graphics co-processor) Memory: 128 MB DRAM Storage: 8 GB or 16 GB flash memory Operating System: iPhone OS Quad band GSM / GPRS / EDGE: GSM 850 / 900 / 1800 / 1900 Wi-Fi (802.11b/g) Bluetooth 2.0 with EDR 20Hz to 20kHz frequency response (both internal and headset)
artesis 2008 | 4
Color: Black (8 GB or 16 GB) or white (16 GB) Size: 4.5 inches (115.5 mm) (h) 2.4 inches (62.1 mm) (w) 0.48 inch (12.3 mm) (d) Weight: 133 g Headphone jack (non-recessed) Battery has up to 10 hours of 2G talk, 5 hours of 3G talk, 5 (3G) or 6 (Wi-Fi) hours of Internet use, 7 hours of video playback, and up to 24 hours of audio playback, lasting over 300 hours on standby. 3G for broadband data speeds Assisted GPS Digital SAR Rating: 1.38 W/kg
artesis 2008 | 5
Popularity
iPhone Stats October, 2008 10 Million iPhones App store stats July, 2008 (launch) : 552 Apps December 5, 2008 : 300M downloads February, 2009 : 20.000 Apps / 500M downloads
artesis 2008 | 6
Openness
iPhone Open Source Write anything you want Device Homogeneity
NO NO YES
Android
YES YES NO
Closed source with open source components. Given Apples history, this is likely to stay this way. (Benevolent) Vertically Integrated Dictatorship vs. Open Source, Loosely-Controlled Ecosystem
artesis 2008 | 7
Where to start?
http://developer.apple.com/iphone/ Download iPhone SDK, if you are a Registered iPhone Developer or enrolled in the iPhone Developer Program SDK includes : Xcode IPhone simulator Monitoring instruments Interface builder
Web apps
http://www.apple.com/webapps/
http://www.shockwise.com/iphone/draw.php Developers are free to set any price for their applications to be distributed through the App Store, of which they will receive a 70 percent share
artesis 2008 | 9
Web Apps
Applications are downloaded directly to iPhone or iPod Touch App Store is also available within iTunes Applications are subject to approval by Apple, as outlined in the SDK agreement, for basic reliability testing and other analysis Applications may be rejected if they are of only "limited utility" Toolbars must be placed at the bottom of the screen, and the vibration function should only be used for alerts
artesis 2008 | 10
artesis 2008 | 11
Objective C
1980S : Objective-C language designed by Brad J. Cox: Object-oriented extension of C. Inspired by Smalltalk. Strict superset of C. 1988 : NeXT Software licenses the Objective-C language and develops NEXTSTEP 1992 : FSF adds Objective-C to GNU compiler suite 1994 : NeXT Computer and Sun Microsystems release a standardized OPENSTEP specification 1996 : Apple acquires NeXT Software. Use for OS X. OPENSTEP now called Cocoa.
artesis 2008 | 12
Objective C
Interface (.h)
#import <Foundation/NSObject.h> @interface Fraction: NSObject{ intnumerator; intdenominator; }-(void) print; -(void)setNumerator: (int) d; -(void)setDenominator: (int) d; -(int) numerator; -(int) denomin@end
artesis 2008 | 13
Objective C
Implementation (.m)
#import "Fraction.h #import <stdio.h> @implementation Fraction -(void) print { printf("%i/%i", numerator, denominator); } -(void) setNumerator: (int) n { numerator = n; } -(void) setDenominator: (int) d { denominator = d; } -(int) denominator { return denominator; } -(int) numerator { return numerator; }@end
artesis 2008 | 14
artesis 2008 | 15
artesis 2008 | 17
artesis 2008 | 18
artesis 2008 | 19
http://www.innaworks.com/alcheMo-for-iPhone.html alcheMo for iPhone is capable of converting J2ME applications utilizing an extensive subset of Java ME CLDC 1.1 (http://java.sun.com/products/cldc/) and MIDP 2.0 (including touch screen support) and supports several JSR extension APIs (http://jcp.org/en/jsr/detail?id=198) including the JSR-256 mobile sensor API. Additional APIs support multi-touch and native iPhone look and feel. This automatic translation process is instantaneous, repeatable, and available 24/7 while requiring no iPhone specific experience.
artesis 2008 | 20
No official support
It is however possible to run Java on the iPhone We have to pull some tricks, jailbreaking, installing... Apple has stated it will not design software updates specifically to break native applications other than applications that perform SIM
unlocking
artesis 2008 | 21
A jailbreak is the act of breaking out of a jail in UNIX-like operating systems or bypassing digital rights management (DRM). It is a specific form of privilege escalation. In the context of the iPhone, it allows the user to run arbitrarily defined code or applications, bypassing Apple's code distribution mechanism (the iTunes App Store and the iTunes Application).
Tools : PwnageTool, from the iPhone Dev Team (http://blog.iphone-dev.org/) QuickPwn, from the iPhone Dev Team (http://blog.iphone-dev.org/) Yellowsn0w, redsn0w (http://blog.iphone-dev.org/) Pusher, from RiP Dev (http://ripdev.com/pusher/) Linux on iPhone (http://www.iphonelinux.org/index.php/Main_Page) ZIPhone (http://www.ziphone.org/)
artesis 2008 | 22
IPhone in Finder
Install AFP (Apple Filing Protocol) on your iPhone Get your iPhone's IP address Connect to server from MacOSX Finder afp://ip-address-of-your-iphone User : 'root' / pwd : 'alpine'
artesis 2008 | 23
Cydia
Cydia is a package manager for installing unofficial 3rd-party applications on the iPhone Among other things, this allows iPhone users to bypass Apple's restrictions on certain kinds of applications, such as launchers, custom wallpapers (themes) and battery status apps The applications are downloaded directly to iPhone or iPod Touch and are located in the /Applications/ directory , in the same place where 'Apple' native applications are located. App Store applications are located in /var/mobile/Applications/ Cydia is a front end/graphical interface for a port of APT created by Jay Freeman Cydia allows users to add custom sources, so people can choose where to download software from
artesis 2008 | 24
Installer
Installer is another package installer, created and maintained by the Russian Rip-Dev company alongside other tools. The former maintainer of Installer, on pre 2.0 firmwares, was Nullriver, Inc.
artesis 2008 | 25
Run Cydia Installer, go to Java section and select iPhone/Java which will install the virtual machine, libraries etc. Then install Jikes (java compiler). Also, install Terminal. Now restart iPhone. You can upload Java files to iPhone using iPhone Browser => demo Run Terminal (installed above) and use java (jikes) compiler to compile your program. For example: jikes -cp /usr/lib/rt.jar MyFirstJavaProgramForIPhone.java You can run the class file as usual: java MyFirstJavaProgramForIPhone
artesis 2008 | 26
XMLVM
http://www.xmlvm.org/overview/ XMLVM translates a Java class file (or a .NET executable) to an XMLdocument. This allows manipulation and translation of XMLVM-based programs using advanced XML technologies such as XSLT, XQuery, and XPath. Based on the XML-document generated by the front-end, various transformations are possible : Cross-compilation from .NET to JVM byte code Java or .NET applications to JavaScript so that they can run as AJAX applications in any browser Cross-compilation of Java programs to Objective-C to create native iPhone applications Cross-compilation of Android applications to run on the iPhone
artesis 2008 | 27
XMLVM
artesis 2008 | 28
XMLVM
artesis 2008 | 29
HelloWorld in Java
import org.xmlvm.iphone.*;
public class HelloWorld extendsUIApplication { public voidapplicationDidFinishLaunching(NSNotification n) { CGRect rect = UIHardware.fullScreenApplicationContentRect(); UIWindow window = newUIWindow(rect); window.orderFront(this); window.makeKey(this); window._setHidden(false); rect.origin.x = rect.origin.y = 0; UIView mainView= newUIView(rect); window.setContentView(mainView); UITextLabel _title = new UITextLabel(rect); _title.setText("Hello World!"); _title.setCentersHorizontally(true); mainView.addSubview(_title); } }
artesis 2008 | 30
HelloWorld in Objective C
@interface helloWorld : UIApplication -(void) applicationDidFinishLaunching: (NSNotification) n; @end @implementation helloWorld -(void) applicationDidFinishLaunching: (NSNotification) n {CGRect rect = [UIHardware fullScreenApplicationContentRect]; UIWindow* window = [[UIWindow alloc]initWithContentRect: rect]; [window orderFront: self]; [window makeKey: self]; [window _setHidden: false]; rect.origin.x = rect.origin.y = 0; UIView* mainView = [[UIView alloc] initWithFrame: rect]; [window setContentView: mainView]; UITextLabel *_title = [[UITextLabel alloc]initWithFrame: rect]; [_title setText: @"Hello World!"]; [_title setCentersHorizontally: true]; [mainView addSubview: _title]; }@end
artesis 2008 | 31
artesis 2008 | 33
Questions?
Remarks?
artesis 2008 | 34