Mobile is still Fresh

77
Mobile F resh Alexey Buzdin January 2014

description

In this talk Alexey will once again compare Web and Mobile, but this time with a little twist. Alexey will be talking about the problems he encountered in Mobile, which does not arise in the Web, and what solutions were found. Talk will have a number of plot twist and will include the following topics: - Why Web and Mobile are so different? - Common pitfalls in Mobile projects - Comparison of Mobile solutions - How can we improve Mobile

Transcript of Mobile is still Fresh

Page 1: Mobile is still Fresh

Mobile FreshAlexey Buzdin

January 2014

Page 2: Mobile is still Fresh

Speaker

Android and Java enthusiast at

@AlexeyBuzdin! [email protected]

Page 3: Mobile is still Fresh

Table of Content• Mobile vs Web++

• What makes Web simple and attractive

• What are the pitfalls developing mobile apps

• Android vs iOS

• Interesting Android facts

@AlexeyBuzdin! [email protected]

Page 4: Mobile is still Fresh

DISCLAIMER

All characters, events, thoughts and ideas used in this presentation — even those based on real life —

are entirely fictional and purely subjective to speaker opinion.

:)

Page 5: Mobile is still Fresh

Round 1

0:0Growth

Page 6: Mobile is still Fresh
Page 7: Mobile is still Fresh

1995 to Present Day

Page 8: Mobile is still Fresh
Page 9: Mobile is still Fresh
Page 10: Mobile is still Fresh
Page 11: Mobile is still Fresh

Web had >20 years to evolve

Page 12: Mobile is still Fresh

Mobile as we know it today

June 29, 2007 - 7 years ago

July 9, 2008 - 6 years ago

Page 13: Mobile is still Fresh

2008 to Present Day

Page 14: Mobile is still Fresh
Page 15: Mobile is still Fresh
Page 16: Mobile is still Fresh

Number of mobile phones to exceed world population by 2014

http://www.digitaltrends.com/mobile/mobile-phone-world-population-2014/

iOS and Android - 1 million+ apps

Page 17: Mobile is still Fresh
Page 18: Mobile is still Fresh

Mobile

1:0[Grows faster]

Page 19: Mobile is still Fresh

Round 2

1:0Learning Curve

Page 20: Mobile is still Fresh

Mobile vs Web

Page 21: Mobile is still Fresh

Technologies

Page 22: Mobile is still Fresh

<span id="button"> Button </span> !

var button = document.getElementById("button"); button.addEventListener("onclick",function() { window.alert( “Hello World." ); });

Page 23: Mobile is still Fresh

!

<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button" android:text="Button" android:onClick=“click"/> !

public void click(View button) { Toast.makeText(context, "Hello World", 0).show(); }

Page 24: Mobile is still Fresh

<Button x:Name="Button" Content="Button" Click=“Button_Click"/> !private void Button_Click(object sender, RoutedEventArgs e) { MessageBox.Show(“Hello World", "Caption", MessageBoxButton.OK); }

Page 25: Mobile is still Fresh
Page 26: Mobile is still Fresh

!- (IBAction)buttonClick:(id)sender { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Caption" message:@"Hello World" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; ! [alert show]; }

@property (weak, nonatomic) IBOutlet UIButton *button;

Page 27: Mobile is still Fresh

I smell trouble• @property (weak, nonatomic) IBOutlet UIButton *button !

• Every time Xcode opens a XIB / Storyboard, it will also change a minute detail in the XML format. Are you using version control system? !

• Merges on XIBs and Storyboards can go horribly wrong, because their XML formats were not meant to be merged.

Page 28: Mobile is still Fresh

Web has some ‘Standards'And at least

Page 29: Mobile is still Fresh

3 platforms vs 1Cross Platform?

Page 30: Mobile is still Fresh

Cross platformers• Must be a native app-store app

• Must use native-looking UI controls.

• Must perform, even last-gen phones

• Must support at least iPhone & Android & WP

• Must have extensive documentation and community

• Must upgrade to new OS releases in time

Page 31: Mobile is still Fresh

Available Options

• Embedded WebView • Build to native code • VM

Page 32: Mobile is still Fresh

mGWT Codename One RoboVM

Apportable Xamarin

Page 33: Mobile is still Fresh

Corona

!

RhoMobile

!

DolphinPHP

!

Adobe Air

Page 34: Mobile is still Fresh

Sencha Touch

PhoneGap

Titanium

Page 35: Mobile is still Fresh

Not Mentioned*

*Game Engines

Page 36: Mobile is still Fresh

Embedded WebViewAs of Android 4.4 - WebView is now built on Chromium

Page 37: Mobile is still Fresh

Embedded WebViewiOS UIWebView lacks Nitro Javascript engine. This makes executing Javascript much slower compared to Safari.

Page 38: Mobile is still Fresh

Native UI?

Page 39: Mobile is still Fresh

Native UI

Page 40: Mobile is still Fresh
Page 41: Mobile is still Fresh
Page 42: Mobile is still Fresh

Releases

Page 43: Mobile is still Fresh

Cross platformers• Must be a native app-store app

• Must use native-looking UI controls.

• Must perform, even last-gen phones

• Must support at least iPhone & Android & WP

• Must have extensive documentation and community

• Must upgrade to new OS releases in time

[Plausible][Confirmed]

[Plausible]

[Plausible][Plausible][Confirmed]

Page 44: Mobile is still Fresh

Web

1:1[Easier to Learn]

Page 45: Mobile is still Fresh

Round 3

1:1Ease of Development

Page 46: Mobile is still Fresh

Web frameworks

and countless others JS and CSS frameworks in the wild

Page 47: Mobile is still Fresh

Android libraries?• HoloEverywhere - backport Holo theme & widgets from

Android 4.* to 2.1+

• Robolectric - run test inside the JVM on your workstation in seconds.

• RoboGuice - framework that brings the simplicity and ease of Dependency Injection to Android

• AndroidAnnotations - framework that speeds up Android development using annotations.

• ActionBarSherlock - backport ActionBar from Android 4.* to 2.1+

Page 48: Mobile is still Fresh

Android - January 2013

Page 49: Mobile is still Fresh

Android - January 2014

Page 50: Mobile is still Fresh

That’s basically it folks

Android libraries?

Page 51: Mobile is still Fresh

Dev Environment

Page 52: Mobile is still Fresh

Dev Environment

jsbin.com jsfiddle.net

hongkiat.com/blog/cloud-ide-developers

Page 53: Mobile is still Fresh

Pitfalls

• Adaptive design

• Backport functionality

• Optimisation for markets

• Memory management

• Besting speed

Page 54: Mobile is still Fresh

Adaptive?

Page 55: Mobile is still Fresh

Mobile

Page 56: Mobile is still Fresh

Should be adaptive by default

Page 57: Mobile is still Fresh

Should be adaptive by default

Also problems with images

Page 58: Mobile is still Fresh

Pitfalls

• Adaptive design

• Backport functionality

• Optimisation for markets

• Memory management

• Besting speed

Page 59: Mobile is still Fresh

Backport and optimisation

• No ActionBar in Android < 3.0

• No Fragments in Android < 3.0

• Kindle, OUYA, etc markets require additional configs

• iOS7 features does not work on <iOS7 (3G, 3GS)

• Supporting iPhones and iPads require additional work

Page 60: Mobile is still Fresh

Support libraries

Page 61: Mobile is still Fresh

No proper packet management!

github.com/mosabua/maven-android-sdk-deployer

Page 62: Mobile is still Fresh

Pitfalls

• Adaptive design

• Backport functionality

• Optimisation for markets

• Memory management

• Besting speed

Page 63: Mobile is still Fresh

Memory management

Image

Screen 2

Image

Screen 1

Memory leak!

Passing image from one screen to another …

Page 64: Mobile is still Fresh

Memory management

Memory leak!

Changing orientation and not handling ongoing request …

Page 65: Mobile is still Fresh

Pitfalls

• Adaptive design

• Backport functionality

• Optimisation for markets

• Memory management

• Besting speed

Page 66: Mobile is still Fresh

Images and HTTPBottleneck candidates:

Page 67: Mobile is still Fresh

Web

1:2[Easier to Develop]

Page 68: Mobile is still Fresh

Round 4

1:2Ease of Testing

Page 69: Mobile is still Fresh

Mobile vs Web

Page 70: Mobile is still Fresh

Testing Web

2-3caniuse.comhtml5test.com

Page 71: Mobile is still Fresh
Page 72: Mobile is still Fresh
Page 73: Mobile is still Fresh

Test online

appthwack.com AppThwack

developer.samsung.com/remotetestlab

testdroid.com

perfectomobile.com

Page 74: Mobile is still Fresh

Web

1:3[Easier to Test]

Page 75: Mobile is still Fresh

thus …

Page 76: Mobile is still Fresh

Mobile is still Fresh

1:3

Page 77: Mobile is still Fresh

Save Mobile,get involved

:)