5. MADRID · NOV 21-22 · 2014
Android Architecture
DALVIK
ART
Just-In-Time (JIT) Compilation
Ahead-Of-Time (AOT) Compilation
Cache builds up over time
Boot times are faster
Cache is built at first boot Rebooting device takes significantly longer
Apps compiled when executed
Stores Compiled Apps
Consumes much more internal storage space
15. MADRID · NOV 21-22 · 2014
Instruments on iOS
Debugging, performance analysis, and testing
Real-time CPU, memory, disk, energy, and network usage
Threads, network, and energy usage
I/O system and thread activity
Allows detecting memory leaks
26. MADRID · NOV 21-22 · 2014
iOS Applications
C
Objective –C,[message passing]
Swift
PlayGround for leaning Swift
Programming with Objetive-C in windows/ linux
http://www.gnustep.org/
https://developer.apple.com/swift
27. MADRID · NOV 21-22 · 2014
Objective-C vs Swift
NSString *string = @“hello”;
let string = "hello" as NSString
let s: NSString = "hello"
var string: NSString = "hello"
string= "Hello"
NSLog(@“This is a string”);
println("This is a string");
NSArray *myArray = [NSArray arrayWithObjects:@“string1", @“string2", nil];
var myArray = [“string1", "string2"]
var myArray : [String] = [“string1", "string2"]
28. MADRID · NOV 21-22 · 2014
iOS Applications
@synthesize will generate getter and setter methods for your @property
@interface MyObject:NSObject {
NSString *_name;
}
@property (nonatomic,assign) NSString* name;
@end
@implementation MyObject
@synthesize name = _ name;
@end
29. MADRID · NOV 21-22 · 2014
UIKit Framework
UIButton
UILabel
UIImageView
UITextField
UIPickerView
UIWindow
UIView
UIViewController
NSObject,NSString,NSMutableString, NSDate,NSNumber
Collections(NSArray, NSDictionary, NSSet,NSEnumerator)
Foundation Framework
30. MADRID · NOV 21-22 · 2014
iOS Applications
UIViewController is the parent for view Controllers
31. MADRID · NOV 21-22 · 2014
iOS Applications
Organizer
32. MADRID · NOV 21-22 · 2014
iOS Applications
Snippets in XCode
35. MADRID · NOV 21-22 · 2014
iOS Applications
UINavigationController
36. MADRID · NOV 21-22 · 2014
iOS Applications
UINavigationController
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
//Recuperamos el ViewController
UIViewController *rootViewController = [storyboard instantiateInitialViewController];
// Creamos un UINavigationController, que se encargará de controlar y almacenar los distintos viewControllers de nuestra aplicación.
UINavigationController *navigationController = [[UINavigationController alloc]initWithRootViewController:rootViewController];
//Asignamos el navigationController como principal.
self.window.rootViewController = navigationController; return YES;
}
-(IBAction)goToPantalla2:(id)sender {
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
//Obtenemos el controlador con Identifier "Pantalla2"
Pantalla2ViewController *pantalla2Controller = [storyBoard instantiateViewControllerWithIdentifier:@"Pantalla2"];
//Lanzamos el controlador en el navigation de forma animada: [self.navigationController pushViewController:pantalla2Controller animated:YES]; }
37. MADRID · NOV 21-22 · 2014
Design patterns on iOS Applications
MVC
Target-action
Delegate and protocols
A delegate is an object that control of the user interface for that event.
38. MADRID · NOV 21-22 · 2014
ViewPager / UIPageViewController
Swipe gesture
39. MADRID · NOV 21-22 · 2014
Multilanguage
NSString *localizedString = NSLocalizedString(@"Hello",@“DefaultString");
40. MADRID · NOV 21-22 · 2014
Certificates and Signing
Android
iOS
Self-signed certificate
Apps are signed by developers
Apple certificate
Apps are signed by Apple
Java Keytool
Generate a distribution provisioning profile
Export + Sign APK
iOS Provisioning Portal
Debug and distribution certificate
App ID (unique ID of your app)
Set of device unique identifiers
Developer certificate
41. MADRID · NOV 21-22 · 2014
Android Studio
Export + Sign APK
43. MADRID · NOV 21-22 · 2014
Permissions on Android
AndroidManifest.xml
Protection mechanism to interact with other applications
<uses--‐permission android:name="android.permission.INTERNET"/>
<uses--‐permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses--‐permission
android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses--‐permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses--‐permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
44. MADRID · NOV 21-22 · 2014
Permissions on iOS
oDeclare your application requirements in its manifest-like Info.plist. This is used only for ensuring device compatibility.
oUIRequiredDeviceCapabilities allows you to list ’hardware-like’ capabilities that your app needs.
oAppStore reads this information for filter installer devices.
45. MADRID · NOV 21-22 · 2014
Permissions on iOS
Privacy Analysis Tools for iOs Applications
patia.unileon.es
46. MADRID · NOV 21-22 · 2014
Privacy
Permission Manager
49. MADRID · NOV 21-22 · 2014
Android Material design
Minimalist and consistency
Transitions, animiations
Cards
https://developer.android.com/training/material/get-started.html
51. MADRID · NOV 21-22 · 2014
Android Material design
https://github.com/google/iosched
52. MADRID · NOV 21-22 · 2014
Android Fragments
Fragment is a chunk of user interface with its own life cycle.
Fragment must exist within an Activity
Interaction with fragments is done through FragmentManager
Fragment API was introduced in API 11
http://developer.android.com/tools/support-library
61. MADRID · NOV 21-22 · 2014
Mobile Application Testing
TYPES
Unit Testing
Functionality Testing
Integration Testing
Regression
Load Testing
Stress Testing
Performance
Usability Testing
62. MADRID · NOV 21-22 · 2014
Mobile Application Testing
63. MADRID · NOV 21-22 · 2014
CheckList
Rotating the screen
Behavior of when network is not available
Navigation between screens
Behavior of app if app is running for longer period of time and checking memory
64. MADRID · NOV 21-22 · 2014
Testing on Android
Unit & Integration,TDD
Junit
RoboElectric
Acceptance,BDD
RobotiumTesting User Interface
Calabash
65. MADRID · NOV 21-22 · 2014
Unit testing on iOS
XCTest
#import <XCTest/XCTest.h>
#import “TestObject.h"
@interface TestOjectLogicTests : XCTestCase {
@private
TestObject *object;
}
@end
67. MADRID · NOV 21-22 · 2014
Emulator vs Simulator
Android
iOS
Emulator
Simulator
Very slow integrated with SDK
Integrated with Xcode
Emulates hardware and software
Simulates only software
Launched apps are equal binaries from the apps compiled for Device CPU
Launched apps are different binaries from the apps compiled for Device CPU
68. MADRID · NOV 21-22 · 2014
Genymotion
Integration with Eclipse and Android Studio
MULTI OS Compatible with Linux,Windows and Mac
Requires VirtualBox
69. MADRID · NOV 21-22 · 2014
Alternatives
http://jimulabs.com/ for Android live preview
https://appthwack.com/ for testing in the cloud with real devices
71. MADRID · NOV 21-22 · 2014
Android
Handles memory management automatically
Garbage Collector
iOS
release, retain, autorelease
ARC(Automatic Reference Counting)
Developer maintain the count number for each object
Destroys object when reference counting become 0
@autoreleasepool
With ARC, compiler set this methods where its necessary
72. MADRID · NOV 21-22 · 2014
ARC
Migrating to ARC
Project Build Settings
74. MADRID · NOV 21-22 · 2014
Android
iOS
SQLite
android.database.sqlite
Tables and relations
Core Data
Objects
DataModel
Content Providers
/data/data/<Application-Package> /databases/<database-name> Only acces with root
DataModel editor in Xcode for register objects and their relationships
84. MADRID · NOV 21-22 · 2014
Android
iOS
Google requires a one time fee of US$25
iOS Developer Program
$99 /year
Greater capacity for monetization
Google play + Publish in other stores like Amazon,Opera
AppStore
Alpha/beta testing before put in production
Upload to store in 30 min
Review process 5-7 days
Android Developer Console
Beta Testing
http://ibetatest.com/
http://testflightapp.com/