Top Banner
End-to-end Mobile App Development @andri_yadi | http://andriyadi.com codeMeetUp() - March 16, 2015
48

End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Jul 18, 2015

Download

Mobile

Andri Yadi
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

End-to-end Mobile App Development

@andri_yadi | http://andriyadi.com

codeMeetUp() - March 16, 2015

Page 2: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

about me

Page 3: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

CEO of

Page 4: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Co-founder of

http://jepret.in

Page 5: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

7 years in a row

Page 6: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

start up companies for 11 years15 years in software development

Page 7: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

I assume you’re all coders :)

Disclaime

r

Page 8: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Develop end-to-end (server-driven) mobile app?

Page 9: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

develop the backend1st you’ ll do

Page 10: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

a backend needsTypically

Storage

Auth

Logic

Push

Page 11: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Typical Steps We’ll Take

Purchase a physical server or a VMInstall OS, Web Server, DB Server Install & configure server-side scripting/runtime (PHP, Node.js, Python, .NET, Java) …and other fine tuning for performance, security …1 - 2 days later, your server infra is up

Develop web API, authentication, push notification

Backe

nd

Page 12: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Typical Steps We’ll Take

1 - 2 weeks later, you have a mobile backend and accessible API

Congratulation

Backe

nd

Page 13: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Typical Steps We’ll Take

Prepare mobile project & integrate libraries: async HTTP client, JSON parser

Develop web API 2 - 3 days later, you’re ready to access the API

Fronte

nd

Page 14: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

3 - 4 weeks later, you’re ready to develop your mobile app features :)

which is OK, if you’re doing it for fun!

Page 15: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

OR…

Page 16: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

DB & Storage

Authentication

Logic

Push

API Wrapper

Mobile Backend as a Service

Leverage BaaS

Page 17: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Mobile Services

Microsoft Azure Mobile Services

a lot of BaaS providersTurn out…

Page 18: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Microsoft Azure Mobile Services

Page 19: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

So, what is it?

Storage

Authentication

Logic

Push

Scheduler

Page 20: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Mobile ServicesDemo

Deploy

for less than 5 minutes

Page 21: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Mobile ServicesAccessing

from iOS

Page 22: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

iOSDevelopment stuffs

allow me talk a bit…

Page 23: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

iOS

Page 24: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Objective-CSince 2008

Page 25: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Introducing Swift…Since June 2

, 2014

Page 26: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Not this one…

Note, I’m a fan :)

Page 27: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

A new programming language for iOS and OSX

Page 28: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

adding WindowsAzureMobileServices.framework

to your project

+

as easy as…

Page 29: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Typical Steps We’ll Take

Prepare mobile project & integrate libraries: async HTTP client, JSON parser

Develop web API 2 - 3 days later, you’re ready to access the API

Fronte

nd

Page 30: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Mobile ServicesDemo

Let’s do it!

from iOS for less than 5 minutes

Page 31: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

AddingAuthentication

Page 32: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

//client is instance of MSClient //assumed to sign-in with Twitter

client?.loginWithProvider("twitter", controller:self, animated:true) { //trailing closure for completion handler (user, error) -> Void in if user != nil { //do something about it! } }

as easy as adding this code on iOS side

Page 33: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Mobile ServicesDemo

add Auth to

for iOS for less than 5 minutes

Page 34: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

azure mobile preview enable YOUR_MOBILE_SERVICE_NAME Users

Opt-in for Users featureGetting expanded data of signed in user, via call to user.getIdentities()

Install Azure-CLI Type command:

Page 35: End-to-end Mobile App Development (with iOS and Azure Mobile Services)
Page 36: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

AddingServer-side logic

Page 37: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

The case

Let’s say, upon successful sign-in (on client side), I want to register signed-in users to a table

Page 38: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Adding server-side logicOn “Insert” operation of User table, add this script:function insert(item, user, request) { var usersTable = tables.getTable('User'); usersTable.where({ userId: user.userId, }).read({ success: function(results) { if (results.length == 0) { insertNewUser(usersTable, user); } else { console.log('User exists'); request.respond(statusCodes.OK, results[0]); } } }); }

Page 39: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Cont… function insertNewUser(theUserTable, theUser) { theUser.getIdentities({ success: function (identities) { if (identities.twitter) { var newUser = { userId: theUser.userId}; if (identities.twitter.screen_name) { newUser.username = identities.twitter.screen_name; } theUserTable.insert(newUser, { success: function(newItem) { request.respond(statusCodes.OK, newItem); } }); } else { console.log('Identities is not retrieved'); request.respond(); } } }); }

Page 40: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

On client-side

Add this Swift code upon successful sign-in:

let userTable = client?.tableWithName("User") userTable?.insert(["userId": user.userId]){ (item, error) in if let err = error { println("Error: " + err.description) } }

Page 41: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Mobile ServicesDemo

adding server-script

Page 42: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

More Advance Use-Case & customisation…?

Contact [email protected] :)

Page 43: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Notes on the Microsoft Azure Platform

Infrastructure as a Service IaaS

Platform as a Service PaaS

Page 44: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Get startedVisit azure.com

Free trial! worth $200

Page 45: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

Craving to know more about iOS development?

Let’s join upcoming iOS 8 development class - with Swift

http://edu.dycode.co.id

Page 46: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

QA

Page 47: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

a leading mobile & web apps developer, an educator, an early

adopter, an award-winning company

Page 48: End-to-end Mobile App Development (with iOS and Azure Mobile Services)

DyCode www.dycode.com

@dycode