Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

(MBL311) Workshop: Build an Android App Using AWS Mobile Services | AWS re:Invent 2014

3 972 vues

Publié le

Learn how to build a powerful Android app that leverages a variety of AWS services. In this three-hour, demo-heavy workshop, we show how you can build a modern native client app using the AWS Mobile SDK that uses a number of cross-platform mobile cloud services directly with minimal code on the client. We share best practices for building a highly scalable backend so you can add your own functionality. This is a step-by-step journey where you configure and add components to your architecture, then modify and test your components inside a mobile location-based messaging application. In the end, you will have a mobile application with your own backend consisting of different AWS services including: Amazon Cognito, Amazon Mobile Analytics, Amazon SNS Push Notification, Amazon S3, Amazon CloudFront, Amazon CloudSearch, Amazon DynamoDB, Amazon SQS, and AWS Elastic Beanstalk.

Publié dans : Technologie
  • There are over 16,000 woodworking plans that comes with step-by-step instructions and detailed photos, Click here to take a look ♥♥♥ http://ishbv.com/tedsplans/pdf
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici

(MBL311) Workshop: Build an Android App Using AWS Mobile Services | AWS re:Invent 2014

  1. 1. November 14, 2014 | Las Vegas, NV Danilo Poccia, Amazon Web Services
  2. 2. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data Deliver media Store shared data Stream real-time data Track Retention Send push notifications Manage users and identity providers Securely access cloud resources Sync user prefs across devices Track active users, engagement Manage funnels, Campaign performances Store user-generated photos Media and share them Automatically detect mobile devices Deliver content quickly globally Bring users back to your app by sending messages reliably Store and query fast NoSQLdata across users and devices Collect real-time clickstream logs and take actions quickly Your Mobile App
  3. 3. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data AWS Mobile SDK Amazon Mobile Analytics Deliver media Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity) Amazon S3 Transfer Manager Amazon CloudFront (Device Detection) Store shared data Amazon DynamoDB (Object Mapper) Stream real-time data Amazon Kinesis (Recorder) Track Retention Amazon Mobile Analytics Send push notifications Amazon SNS Mobile Push Your Mobile App
  4. 4. Amazon Cognito Amazon Mobile Analytics Amazon SNS Mobile Push Kinesis Connector DynamoDB Connector S3 Connector SQS Connector SES Connector AWS Global Infrastructure (10 Regions, Availability Zones, 51 Edge Locations) Core Building Block Services Mobile Optimized Connectors Mobile Optimized Services Your Mobile App, Game or Device App AWS Mobile SDK, API Endpoints, Management Console Compute Storage Networking Analytics Databases Integrated SDK
  5. 5. Amazon Cognito Amazon Mobile Analytics Amazon SNS Mobile Push Kinesis Connector DynamoDB Connector S3 Connector SQS Connector SES Connector User identity & data synchronization service Store any NoSQL data and also map mobile OS specific objects to DynamoDB tables Fast cross-platform Analytics & reporting Service Powerful Cross-platform Push notification service Recorder that can handle intermittent network connection Easily upload, download to S3 and also pause, resume, and cancel these operations Send email reliably from device Access distributed buffering and queuing service
  6. 6. Simplifies Identity and Access Management Securely access all AWS services from Mobile device Cross-device and Cross-platform Sync Implement security best practices “Your App data is secure, available offline, and kept in sync between devices” Synchronize user’s data across devices and platforms Manage users as unique identities across identity providers Guest YourAuth
  7. 7. Identity Providers Unique Joe Anna Bob Identities Any Device Any Platform Any AWS Service Helps implement security best practices Securely access any AWS Service from mobile device. It simplifies the interaction with AWS Identity and Access Management Support Multiple Login Providers Easily integrate with major login providers for authentication. Unique Users vs. Devices Manage unique identities. Automatically recognize unique user across devices and platforms. Mobile Analytics S3 DynamoDB Kinesis Your own Auth
  8. 8. Unique Identifier for Your “Things” “Headless” connected devices can also securely access cloud services. Save Data to the Cloud Save app and device data to the cloud and merge them after login Guest User Access Securely access AWS resources and leverage app features without the need to create an account or logging in Visitor Preferences Cognito Store Guest EC2 S3 DynamoDB Kinesis
  9. 9. Sign up for AWS Account and login to AWS Management Console Download and integrate the Mobile SDK and store and sync user data in a dataset Create identitypoolfor authenticated and unauthenticated users in the AWS Console
  10. 10. Set granular access permissions on AWS resources Get fine-grained access control to cloud resources. Safeguard AWS Credentials No need to embed credentials in the app anymore. Get least-privileged temporary credentials. Helps implement security best practices Securely access any AWS Service. It simplifies the interaction with Security Token Service and removes the need of Token Vending Machine EC2 S3 DynamoDB Kinesis
  11. 11. End Users App with AWS Mobile SDK Access to AWS Services Login OAUTH/OpenID Access Token Cognito ID, Temp Credentials Access Token Pool ID Role ARNs Cognito ID (Temp Credentials) DynamoDB Developer Cognito Identity Broker S3 Mobile Analytics Cognito Sync Store AWS Management Console
  12. 12. Your own Username And Password Your own user authentication system Several apps prefer to have their own username and password instead of public identity providers for authentication. Manage mappings easily Cognito manages the mappings across login systems (public or private) using a unique Cognito ID Easily integrate with existing systems Implement GetOpenIdTokeForDeveloperIdentity() using our server-side SDKs like Java, Python, Ruby etc.
  13. 13. Cognito ID (Temp Credentials) DynamoDB End Users Developer App with AWS Mobile SDK Access to AWS Services Cognito Identity Broker Get OpenIDToken Username password Cognito ID, Temp Credentials S3 Mobile Analytics Cognito Sync Store AWS Management Console OIDC Token Pool ID Role ARNs User Authentication System (Running on AWS or not) OIDC Token OIDC Token
  14. 14. Identitypool Identity Providers Pool of identities that share the same trust policy Access Policy Access to AWS Services identitypool Unauthenticated Identities authenticated identities AWS IAM Roles AWS Account Web Identity Federation S3 DynamoDB Get Delete Put
  15. 15. s3:* dynamodb:* cognito-sync:* Allow Actions: All S3, Sync store Operations Resource: All resources within these services Deny Actions: All DDB Operations Resource: All resources
  16. 16. s3:PutObjects3:GetObjects3:DeleteObjects3:ListMultipartUploadPartss3:AbortMultipartUploadarn:aws:s3:::BUCKET_NAME/* s3:ListBuckets3:ListBucketMultipartUploadsarn:aws:s3:::BUCKET_NAMEdynamodb:GetItemdynamodb:Querydynamodb:PutItemarn:aws:dynamodb:REGION:123456789:table/TABLE_NAME", "arn:aws:dynamodb:REGION:123456789:table/TABLE_NAME/ index/INDEX_NAME Allow Actions: Certain operations Resource: One bucket, table ..
  17. 17. s3:PutObject","s3:GetObject","s3:DeleteObject”,”s3: ListMultipartUploadParts","s3:AbortMultipartUploadarn:aws:s3:::BUCKET_NAME/Bob/* s3:ListBucketarn:aws:s3:::BUCKET_NAMEs3:prefix":”Bob/ s3:ListBucketMultipartUploadsarn:aws:s3:::BUCKET_NAME Allow Actions: Certain operations Resource: Within a bucket with specific prefix (user)
  18. 18. Allow Actions: All sync operations Resource: Only to that identity { "Effect": "Allow”, "Action": ["s3:GetObject”,"s3:PutObject”], "Resource": ["arn:aws:s3::: myBucket/amazon/snakegame/ ${cognito-identity.amazonaws.com:sub}"] } { "Effect":"Allow", "Action":"cognito-sync:*", "Resource":["arn:aws:cognito-sync:us-east-1: 123456789012:identitypool/ ${cognito-identity.amazonaws.com:aud}/identity/ ${cognito-identity.amazonaws.com:sub}/*"] } Allow Actions: S3 Get/Put operations Resource: Only to a specific part of bucket to that identity
  19. 19. Implementing a user profile that syncs across devices, OS, apps is hard.
  20. 20. User Data Storage and Sync Any Platform iOS/Android/FireOS Store App Data, Preferences and State Save app and device data to the cloud and merge them after login Cross-device Cross-OS Sync Sync user data and preferences across devices with one line of code Work Offline Data always stored in local SQLite DB first. Works seamlessly when intermittent or no connectivity Identity pool k/v data
  21. 21. Offline Fast Intelligent Sync Flexible Conflict resolution Local SQLite Cache
  22. 22. AWS Account Identitypool Dataset Pool of identities that share the same trust policy Identity Identity Identity Dataset Dataset identitypool Unique identifier across devices, get cached on local devices as well as saved in the cloud 1:n 1:n 1:n Dataset synchronized across devices by simply calling dataset.synchronize() method Dataset Dataset Key/Value 1:n Key-value and sync count
  23. 23. AWS Account Identitypool Dataset Identity Identity Identity Dataset Dataset identitypool 1:n 1:n 1:n User preferences Developer has two apps: a game and a productivity app Game state Identitypool1 Productivity App Game App Dataset Dataset Key/Value 1:n
  24. 24. CognitoCachingCredentialsProvidercognitoProvider= newCognitoCachingCredentialsProvider( myActivity.getContext(),// get the context for the current activity "AWS_ACCOUNT_ID", "COGNITO_IDENTITY_POOL_ID", "arn:aws:iam::AWS_ACCOUNT_ID:role/UNAUTHENTICATED_ROLE", "arn:aws:iam::AWS_ACCOUNT_ID:role/AUTHENTICATED_ROLE", Regions.US_EAST_1 ); Log.d("LogTag","my ID is "+cognitoProvider.getIdentityId()); // Create a service client with the provider AmazonDynamoDBclient =newAmazonDynamoDBClient(cognitoProvider);
  25. 25. CognitoSyncManagersyncClient=new CognitoSyncManager(myActivity.getContext(), COGNITO_POOL_ID,Regions.YOUR_REGION,cognitoProvider); Dataset dataset =client.openOrCreateDataset("myDataset"); dataset.put("myKey","my value"); String value =dataset.get("myKey"); dataset.remove("myKey"); dataset.synchronize(this,syncCallback); dataset.synchronizeOnConnectivity(this,syncCallback);
  26. 26. Analyze User Behavior Store and share media Deliver media Store shared data Stream real-time data Track Retention Send push notifications Track active users, engagement Manage funnels, Campaign performances Store user-generated photos Media and share them Automatically detect mobile devices Deliver content quickly globally Bring users back to your app by sending messages reliably Store and query fast NoSQLdata across users and devices Collect real-time clickstream logs and take actions quickly Your Mobile App Authenticate users Authorize access Synchronize data Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker)
  27. 27. Developer Economics | State of the Developer Nation Q3 2014 | © VisionMobile | All rights reserved | www.developereconomics.com/go 27
  28. 28. Developer Economics State of the Developer Nation Q3 2014 © VisionMobile
  29. 29. timely mannerown their mobile data
  30. 30. Scalable and Generous Free Tier Focus on metrics that matter. Usage reports available within 60 minutes of receiving data from an app Fast Scale to billions of events per day from millions of users. Own Your Data “Easily collect, visualize and understand your app usage data at scale” Data collected are not shared, aggregated, or reused
  31. 31. Sign up for AWS Account and create or use existing Cognito ID in the AWS Management Console View engagement and session activity reports in the AWS Management console within minutes Download and integrate the Mobile SDK with one line of code (Android/FireOS, iOS)
  32. 32. // Within your activity privatestaticMobileAnalyticsManageranalytics; // Within your activity onCreate() try{ AnalyticsConfigoptions = newAnalyticsConfig(); options.withAllowsWANDelivery(true); analytics = MobileAnalyticsManager.getOrCreateInstance( getApplicationContext(), "YOU MOBILE ANALYTICS APP ID", Regions.US_EAST_1, cognitoProvider, // You need a Cognitocredential provider options ); } catch(InitializationExceptionex) { Log.e(this.getClass().getName(), "Failed to initialize Amazon Mobile Analytics", ex); }
  33. 33. @Override protectedvoidonPause() { super.onPause(); if(analytics != null) { analytics.getSessionClient().pauseSession(); //Attempt to send any events that have been recorded to the Mobile Analytics service. analytics.getEventClient().submitEvents(); } } @Override protectedvoidonResume() { super.onPause(); if(analytics != null) { analytics.getSessionClient().resumeSession(); } }
  34. 34. publicvoidonLevelComplete(String levelName, String difficulty, doubletimeToComplete, intplayerState) { //Create a Level Complete event with some attributes and metrics(measurements) //Attributes and metrics can be added using with statements AnalyticsEventlevelCompleteEvent= analytics.getEventClient().createEvent("LevelComplete") .withAttribute("LevelName", levelName) .withAttribute("Difficulty", difficulty) .withMetric("TimeToComplete", timeToComplete); //attributes and metrics can also be added using add statements if(playerState== STATE_LOSE) levelCompleteEvent.addAttribute("EndState", "Lose"); elseif(playerState== STATE_WIN) levelCompleteEvent.addAttribute("EndState", "Win"); //Record the Level Complete event analytics.getEventClient().recordEvent(levelCompleteEvent); } this.onLevelComplete("Lower Dungeon", "Very Difficult", 2734, STATE_WIN);
  35. 35. EventClienteventClient= mobileAnalyticsManager.getEventClient(); // create a builder that can record purchase events for Amazon IAP AmazonMonetizationEventBuilderbuilder = AmazonMonetizationEventBuilder.create(eventClient); Event purchaseEvent= builder.withProductId(purchasedItem.getSku()) .withFormattedItemPrice(purchasedItem.getPrice()) .withQuantity(1).build(); eventClient.recordEvent(purchaseEvent); // create a builder that can record purchase events for Google Play IAP GooglePlayMonetizationEventBuilderbuilder = GooglePlayMonetizationEventBuilder.create(eventClient); Event purchaseEvent= builder.withProductId(sku) .withFormattedItemPrice(price) .withTransactionId(purchase.getOrderId()) .withQuantity(1).build(); eventClient.recordEvent(purchaseEvent); MonetizationEventBuilder AmazonMonetizationEventBuilder CustomMonetizationEventBuilder GooglePlayMonetizationEventBuilder VirtualMonetizationEventBuilder
  36. 36. Key Business Metrics (with one line of code) 1.Monthly Active Users (MAU) 2.Daily Active Users (DAU) 3.New Users, 4.Daily Sessions, 5.Sticky Factor, 6.1-Day Retention, 7.Avg. Revenue per DAU, 8.Daily Paying Users, 9.Avg. Paying DAU
  37. 37. Track Retention User retention is a key indicator to judge the outcome of a marketing campaign, new feature introduction, UX changes, app updates, etc. Mobile Analytics provide four charts to track daily or weekly rate of returning users, after first use of the app
  38. 38. Get behavioral insights into app specific actions that your users take Reports provide a view of how often custom events occur. You can add further context with Attributes and Metrics, to each custom event Examples Track the number of Likes/Shares, per article, in a news app Understand player abort rates per level, in a game Number of songs played, per user session, in a music app In-app item popularity in a shopping app
  39. 39. Store and share media Deliver media Store shared data Stream real-time data Send push notifications Store user-generated photos Media and share them Automatically detect mobile devices Deliver content quickly globally Bring users back to your app by sending messages reliably Store and query fast NoSQLdata across users and devices Collect real-time clickstream logs and take actions quickly Your Mobile App Authenticate users Authorize access Analyze User Behavior Synchronize data Amazon Mobile Analytics Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker) Track Retention Amazon Mobile Analytics
  40. 40. S3 Connector Multipart upload media (photos, videos, audio) Fault tolerant download (e.g. assets) No backend required Automatic retries Pause, resume, cancel functions Optimized for native OS
  41. 41. // Creating the transfer manager TransferManagertransferManager= newTransferManager(credentialProvider); // Upload image Upload upload = transferManager.upload(BUCKET_NAME, fileName, file); // Download image Download download = transferManager.download(BUCKET_NAME, mKey, file); // Pause, and Resume try{ PersistableDownloadpersistableDownload= download.pause(); //do something if we didn’t abort } catch(PauseExceptione) { //do something if we aborted } download = transferManager.resumeDownload(persistableDownload);
  42. 42. Amazon S3 Custom OR User requests Edge location (cache + network optimizations) Origin Get content Get content Content Content
  43. 43. Dallas(2) St.Louis Miami Jacksonville Los Angeles(2) Palo Alto Seattle Ashburn(3) Newark New York(3) Dublin London(2) Amsterdam(3) Stockholm Frankfurt(3) Paris(2) Singapore(2) Hong Kong(2) Tokyo(2) Sao Paulo South Bend San Jose Milan Sydney Madrid Seoul Mumbai Chennai Atlanta Hayward Rio de Janeiro Marseille Warsaw Osaka Manila Taipei Melbourne
  44. 44. Store shared data Stream real-time data Send push notifications Bring users back to your app by sending messages reliably Store and query fast NoSQLdata across users and devices Collect real-time clickstream logs and take actions quickly Your Mobile App Authenticate users Authorize access Analyze User Behavior Synchronize data Amazon Mobile Analytics Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker) Track Retention Amazon Mobile Analytics Store and share media Deliver media Amazon S3 Transfer Manager Amazon CloudFront (Device Detection)
  45. 45. Joe Anna Bob High Scores Joe 1500 Anna 800 Bob 750 Amazon DynamoDB Connector: Object Mapper Simplifies access to Amazon DynamoDB in you app Map client-side classes to Amazon DynamoDB tables Removes the need to transform objects into tables and vice versa
  46. 46. Amazon DynamoDB: Example @DynamoDBTable(tableName= "Bookstore") publicstaticclassBook{ privateintid; privateString isbn, title; privateBoolean hardCover; @DynamoDBHashKey(attributeName= "id") publicintgetId() { returnid; } publicvoidsetId(intid) { this.id= id; } @DynamoDBAttribute(attributeName="isbn") publicString getIsbn() { returnisbn; } ... } Id isbn Title hardCover 1 22-22222 My First Book Yes 2 43-43234 My Favorite Book No 3 55-12345 My NewBook Yes Table: Bookstore
  47. 47. Amazon DynamoDB: An Example // Build a book object Book book = newBook(); book.setId(17); book.setIsbn("222-2222222222"); book.setTitle("Some Title"); book.setHardCover(true); // Save book object to dynmaoDB mapper.save(book); // Update item and save object again book.setTitle("Updated Title"); book.setHardCover(false); mapper.save(book); // Load another book Book anotherBook= mapper.load(Book.class,7);
  48. 48. Geo Library for Amazon DynamoDB
  49. 49. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data AWS Mobile SDK Amazon Mobile Analytics Deliver media Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker) Amazon S3 Transfer Manager Amazon CloudFront (Device Detection) Store shared data Amazon DynamoDB (Object Mapper) Stream real-time data Track Retention Amazon Mobile Analytics Send push notifications Your Mobile App Bring users back to your app by sending messages reliably Collect real-time clickstream logs and take actions quickly
  50. 50. 65% of mobile apps are abandoned within 90 days. http://blog.flurry.com/bid/90743/App-Engagement-The-Matrix-Reloaded
  51. 51. Broadcast Direct Closed Loop Identical messages to many at once Unique messages to individual customers Targeted and optimized with analytics
  52. 52. Broadcast Direct Closed Loop Identical messages to many at once Unique messages to individual customers Targeted and optimized with analytics
  53. 53. •New features/content/games •Promotion start/ends/redemption •Active players (active in 7 days) •Newly inactive players •Segmentation (geo, spend, others..)
  54. 54. •“New episode available now!” •“Halloween challenge starts today.” •“Keep the streak going.” •“Smokey the bear misses you!” •“New Jetpack, on sale today!”
  55. 55. Broadcast Closed Loop Identical messages to many at once Targeted and optimized with analytics Direct Unique messages to individual customers
  56. 56. •Messaging •Turn-based activities •Events •User lifecycle •Administrative
  57. 57. •“Jon invited you to a game.” •“It’s your turn to play.” •“You now have full lives.” •“Welcome to the game!” •“Your subscription is ending.”
  58. 58. Broadcast Identical messages to many at once Direct Unique messages to individual customers Closed Loop Targeted and optimized with analytics
  59. 59. •Broadcast push notifications •Direct push notifications
  60. 60. •Different messages •Different frequencies •Different segments •Different times of day •Different points in the lifecycle
  61. 61. Broadcast Direct Closed Loop Identical messages to many at once Unique messages to individual customers Targeted and optimized with analytics
  62. 62. Cloud App Mobile Apps
  63. 63. Cloud App Mobile Apps Platform Service
  64. 64. Platform Service Token Registration TokenFeedback
  65. 65. Apple APNS Google GCM Amazon ADM
  66. 66. Cloud App Platform Services Mobile Apps
  67. 67. Mobile Apps Custom Code Push Intermediary
  68. 68.   Operational complexity Scalability takes work Cost –even though the platform services themselves are free
  69. 69. Amazon SNS Cross-platform Mobile Push Apple APNS Google GCM Amazon ADM Windows WNS and MPNS Baidu CP Android Phones and Tablets Apple iPhones and iPads Kindle Fire Devices Android Phones and Tablets in China iOS Windows Desktop and Windows Phone Devices
  70. 70. New features: •Time to Live (TTL) •Message Attributes •Large Topics •iOS8
  71. 71. Apple APNS Google GCM Amazon ADM Amazon SNSMobile Push
  72. 72. Apple APNS Google GCM Amazon ADM Amazon SNSMobile Push ARN 1 Token A ARN 2 Token B ARN 3 Token C
  73. 73. Amazon SNSMobile Push Token Registration Token Feedback Cloud App
  74. 74. Apple APNS Google GCM Amazon ADM Amazon SNSMobile Push ARN 1 Token A ARN 2 Token B ARN 3 Token C Token X Token Y
  75. 75. Amazon SNSMobile Push ARN 1 Token A ARN 2 Token B ARN 3 Token C
  76. 76. Publish Publish Publish Publish Direct Publishing Broadcast with SNS Topics
  77. 77. Geography Activity Product US –West Coast Daily Actives Flapping Bird Rio Interest Tier Segment 49ers Premium Top 100 Players
  78. 78. Apple Kindle Fire Kindle Fire Google Publish Apple Kindle Fire Kindle Fire Google Publish Publish Once, Deliver Anywhere Specify Platform-Specific Payloads
  79. 79. So let’s get started.
  80. 80. Step 1: Write your mobile app •Use the mobile app platform’s push notification libraries as you normally would.
  81. 81. Step 2: Obtain Application Prerequisites •APNs: •Apple Push Notification service SSL certificate •Application Private Key •GCM: •API Key (Sender Auth Token) •ADM: •Client ID •Client secret
  82. 82. Step 3: Register Your Mobile App with AWS Amazon SNSMobile Push
  83. 83. Step 4: Obtain a Token/Registration ID from the device •APNs: •Device Token •GCM: •Registration ID •ADM: •Registration ID CloudApp <e960d9b1…de43f6c0>
  84. 84. Step 5: Add Token/Registration ID to Amazon SNS •For existing devices •Use the console for .csvimport •Or use CreatePlatformEndpointAPI •For future devices •Use a proxy server and the CreatePlatformEndpointAPI •Or use Cognitoand let devices register themselves •Receive an ARN back Amazon SNSMobile Push CloudApp <e960d9b1…de43f6c0> arn:aws:sns:eu-west-1:12…1f
  85. 85. privateString getArnForDeviceEndpoint( String platformApplicationArn, String deviceToken) { CreatePlatformEndpointRequestrequest = newCreatePlatformEndpointRequest() .withPlatformApplicationArn(platformApplicationArn) .withToken(deviceToken); CreatePlatformEndpointResultresult = snsClient.createPlatformEndpoint(request); returnresult.getEndpointArn(); } Device Registration –Code example
  86. 86. Step 6a: Send Push Notifications via the Console
  87. 87. Step 6b: Send Push Notifications via the API $ python >>> import boto >>> import boto.sns >>> sns= boto.sns.connect_to_region("us-west-2") >>> sns.publish( ... message="Hello world!", ... target_arn="arn:aws:sns:us-west-2:514247453397:endpoint/GCM/MsgDemo/24885ae1- 4002-306d-bb4f-0c79c11e951c") {u'PublishResponse': {u'PublishResult': {u'MessageId': u'f1f0f549-0e80-5eeb-a5bc- b984bf66dcc4'}, u'ResponseMetadata': {u'RequestId': u'258e807e-5430-5050-8873- ccb3e5d6c27f'}}} >>>
  88. 88. Step 7: Receive and Close the Loop
  89. 89. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data AWS Mobile SDK Amazon Mobile Analytics Deliver media Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker) Amazon S3 Transfer Manager Amazon CloudFront (Device Detection) Store shared data Amazon DynamoDB (Object Mapper) Stream real-time data Track Retention Amazon Mobile Analytics Send push notifications Amazon SNS Mobile Push Your Mobile App Collect real-time clickstream logs and take actions quickly
  90. 90. Amazon Kinesis Redshift S3 Kinesis enabled Apps on EC2 AWS Mobile SDK For sophisticated User Behavior Analysis Integrated AWS Mobile SDK Generic batching system that handles intermittent network connection and also optimize battery utilization
  91. 91. String kinesisDirectory= "YOUR_UNIQUE_DIRECTORY"; KinesisRecorderrecorder = newKinesisRecorder( cognitoProvider, Regions.US_WEST_2, getDir(kinesisDirectory, MODE_PRIVATE));
  92. 92. recorder.saveRecord("MyData".getBytes(),"MyStreamName"); recorder.submitAllRecords(); Long byteLimit= recorder.getDiskByteLimit(); Long bytesUsed= recorder.getDiskBytesUsed(); KinesisRecorderConfigkinesisRecorderConfig= recorder.getKinesisRecorderConfig(); Long maxStorageSize= kinesisRecorderConfig.getMaxStorageSize();
  93. 93. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data AWS Mobile SDK Amazon Mobile Analytics Deliver media Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker) Amazon S3 Transfer Manager Amazon CloudFront (Device Detection) Store shared data Amazon DynamoDB (Object Mapper) Stream real-time data Amazon Kinesis (Recorder) Track Retention Amazon Mobile Analytics Send push notifications Amazon SNS Mobile Push Your Mobile App
  94. 94. Kinesis Application AWS Elastic Beanstalk
  95. 95. DeployYour Backend Application
  96. 96. Elastic Load Balancing Auto Scaling Elastic Beanstalk Application CloudWatch Alarm
  97. 97. Amazon Cognito Amazon Mobile Analytics S3 Connector DynamoDB Connector Kinesis Connector k/v data Amazon SNS Mobile Push S3 Bucket DynamoDB Table Kinesis Application Sync Repository End users App with AWS Mobile SDK Developers AWS Management Console Kinesis Application (?) Your Auth
  98. 98. Amazon Cognito Amazon Mobile Analytics S3 Connector DynamoDB Connector Kinesis Connector k/v data Amazon SNS Mobile Push S3 Bucket DynamoDB Table Kinesis Application Sync Repository Developers AWS Management Console Kinesis Application (?) End users App with AWS Mobile SDK Your Auth
  99. 99. Developers AWS Management Console Kinesis Application (?) Amazon Cognito Amazon Mobile Analytics S3 Connector DynamoDB Connector Kinesis Connector k/v data Amazon SNS Mobile Push S3 Bucket DynamoDB Table Kinesis Application Sync Repository End users App with AWS Mobile SDK Your Auth
  100. 100. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data Deliver media Store shared data Stream real-time data Track Retention Send push notifications Manage users and identity providers Securely access cloud resources Sync user prefs across devices Track active users, engagement Manage funnels, Campaign performances Store user-generated photos Media and share them Automatically detect mobile devices Deliver content quickly globally Bring users back to your app by sending messages reliably Store and query fast NoSQLdata across users and devices Collect real-time clickstream logs and take actions quickly Your Mobile App
  101. 101. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data AWS Mobile SDK Amazon Mobile Analytics Deliver media Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker) Amazon S3 Transfer Manager Amazon CloudFront (Device Detection) Store shared data Amazon DynamoDB (Object Mapper) Stream real-time data Amazon Kinesis (Recorder) Track Retention Amazon Mobile Analytics Send push notifications Amazon SNS Mobile Push Your Mobile App
  102. 102. Amazon Cognito Amazon Mobile Analytics Amazon SNS Mobile Push Kinesis Connector DynamoDB Connector S3 Connector SQS Connector SES Connector AWS Global Infrastructure (10 Regions, Availability Zones, 51 Edge Locations) Core Building Block Services Mobile Optimized Connectors Mobile Optimized Services Your Mobile App, Game or Device App AWS Mobile SDK, API Endpoints, Management Console Compute Storage Networking Analytics Databases Integrated SDK
  103. 103. Amazon Cognito Amazon Mobile Analytics Amazon SNS Mobile Push Kinesis Connector DynamoDB Connector S3 Connector SQS Connector SES Connector User identity & data synchronization service Store any NoSQL data and also map mobile OS specific objects to DynamoDB tables Fast cross-platform Analytics & reporting Service Powerful Cross-platform Push notification service Recorder that can handle intermittent network connection Easily upload, download to S3 and also pause, resume, and cancel these operations Send email reliably from device Access distributed buffering and queuing service
  104. 104. http://bit.ly/awsevals

×