Mobile development initiation
Outline Mobile development: o Why? o How? o New issues Android ios 2
Mobile growth ¼ Internet access Sales of smartphones and tablets increase o + 70% tab Community 3
Why develop native app? One alternative: Hybrid HTML 5/Javascript o FirefoxOS o PhoneGap Issues o Not supported on every device o Poorer user interaction o Different look and feel o Performance 4
How develop native app? Two main choices: o Android : 75% (smartphone), 55% (tablet) o ios: 20% (smartphone), 40% (tablet) o Other: Windows Mobile, Blackberry 5
New issues Architecture / Security Life cycle Resources access o E.g. augmented user experience by customization Tools o Development o Testing 6
Outline Mobile development Android ios 7
Android 1st mobile OS Open source Linux kernel Java (C, C++) Current version 4.2 (API 17) 8
Android architecture Dalvik (JVM) Multitasking Isolation: sandbox Priviledges 9
Android app life cycle Memory and pover management Suspended app consumes no resources and responds quickly 10
Android components Activity = Screen Service = Background processing Broadcast Receiver Content Provider = Sharing/saving complex data 11
Android communication Intent Start components and share data Explicit/implicit o Explicit: component name -> application internal message o Implicit: blank name -> activate components in other app Intent filter o Intent the component is willing to receive o action/category/data 12
Android security Manifest file o Components o User permission (Internet access, read/write contacts, camera ) o App requirements Platform version Device features (camera, bluetooth ) If interaction with others app: o Intent filter o Permission 13
Android resource access User agreement at install time API: o Sensor: motion, environmental, position o Location: Google Maps o Multimedia: sound, video, Camera o Connectivity: Bluetooth, WiFi, SIP API o Phone capabilities: dial, address book 14
Android tools: Android Studio IDE based on IntelliJ IDEA 15
Android tools: SDK Android API + simulator + debugger Used with Android Developer Tools on Eclipse 16
Android tools: Layout 17
Android tools: Fragment 18
Android tools: Testing On real devices 19
Android tools: Testing Android simulator 20
Hello World! 21
Hello World! Android Src Gen o R.java Res: o Drawable o Layout o Values Manifest.xml 22
Hello World! Android Manifest.xml: 2 Screens -> 2 Activities 23
Hello World! Android Layout 24
Hello World! Android Add action when button clicked 25
Hello World! Android Get information and display 26
Hello World! 27
Outline Mobile development Android ios 28
ios Apple OS Proprietary Based on Darwin Objective C (C, C++) Version 7 (fall 2013) Few devices: 6 different screens/densities (phones + tablets) 29
ios architecture Isolation: Sandbox o API to interact with other app Mostly single tasking Exceptions: Background audio, voice over IP, background location, push notification 30
ios app life cycle 31
ios components (M)VC o View:.xib o Controller and Model:.h,.m Communication between View and Controller: o Target action: Link graphical control to an action 32
ios resource access Access to hardware/software by framework Information at install time User agreement at runtime 33
Apple IDE ios tools: Xcode Breakpoint and debugger console: o po for printing var o «po $eax» prints error and «po $ecx» the method which causes failure 34
ios tools: Layout 35
ios tools: Testing 36
ios tools: Testing 37
ios tools: Testing Loading an application onto the devices is only possible after paying an annual iphone Developer Program fee. Provisioning profile links App ID, Developer Certificates and Devices ID 38
Hello World! 39
Hello World! ios TestApp o AppDelegate o Supporting Files Info.plist Main.m Frameworks 40
Hello World! ios 41
Hello World! ios Add action when button clicked 42
Hello World! ios Get information and display 43
Hello World! ios 44
Conclusion Mobile development!= simple adaptation Interesting if real thinking on smartphone capacities and rich user interaction Layouts should be adapted to screen size, density and orientation Entry fee: Time and money! 45