• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
MBL302 Using the AWS Mobile SDKs - AWS re: Invent 2012
 

MBL302 Using the AWS Mobile SDKs - AWS re: Invent 2012

on

  • 1,142 views

The AWS Mobile SDKs can be used to build thick-client architecture apps for iOS and Android devices. An overview of the SDKs will be presented as well as demos and code for storing data in Amazon S3 ...

The AWS Mobile SDKs can be used to build thick-client architecture apps for iOS and Android devices. An overview of the SDKs will be presented as well as demos and code for storing data in Amazon S3 and sending emails via Amazon SES. You will also learn how to manage AWS credentials in a mobile environment.

Statistics

Views

Total Views
1,142
Views on SlideShare
1,142
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    MBL302 Using the AWS Mobile SDKs - AWS re: Invent 2012 MBL302 Using the AWS Mobile SDKs - AWS re: Invent 2012 Presentation Transcript

    • Agenda• Overview of the AWS Mobile SDKs: • http://aws.amazon.com/mobile • AWS SDK for iOS : http://aws.amazon.com/sdkforios/ • AWS SDK for Android : http://aws.amazon.com/sdkforandroid/• Common use cases • Data storage • Searchable data • Application feedback • Messaging• Managing credentials
    • AWS Mobile SDKs• What are the AWS mobile SDKs?• Who should use them?• Which services do they support?• How are they integrated into my applications?• How do I get help or support using the mobile SDKs?• Where is the source code for the SDKs?
    • What Are the AWS Mobile SDKs?• Simplifies mobile-to-cloud development• Thick-client architecture• AWS SDK for iOS • Support iOS v4.3 and above• AWS SDK for Android • Supports Android v2.2 (API Level 8) and above
    • Who Should Use Them?• Thick-client applications• Don’t want to manage a back end• Want users to make direct calls to the cloud• Back-end processing isn’t necessary
    • Thin Versus Thick-Client Architecture AWS SDKs custom thin architecture APIs AWS mobile SDKs Thick clientsThin clients proxy thick architecture connect directly torequests through the services theyintermediary services need
    • Which Services Do They Support?• The AWS mobile SDKs support 11 services: • Amazon Simple Storage Service (S3) • Amazon DynamoDB • Amazon Simple Queue Service (SQS) • Amazon Simple Notification Service (SNS) • Amazon Simple Email Service (SES) • Amazon Elastic Compute Cloud (EC2) • Elastic Load Balancing • Auto Scaling • Amazon CloudWatch • Amazon SimpleDB • AWS Security Token Service (STS)
    • Integration• How are the SDKs integrated into my application? • AWS SDK for iOS • Single framework that can be added to your application • AWS SDK for Android • Single or service level jars available
    • Minimization• How BIG will the SDKs make my application? • AWS SDK for iOS • Statically linked –only the parts you use will be added to your application • AWS SDK for Android • Proguard integration to help obfuscate and minimize the size of your application
    • Amazon S3• SDK has many samples with Amazon S3 • Amazon S3 allows for the storage and retrieval of data• Article and sample for Amazon S3: • http://aws.amazon.com/articles/SDKs/3002109349624271
    • Amazon S3 Demo
    • Amazon S3 SDK CodeiOS Android// Create Amazon S3 Client // Create Amazon S3 ClientAmazonS3Client *s3 = [[AmazonS3Client alloc] AmazonS3Client s3 = new AmazonS3Client( initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY]; new BasicAWSCredentials( ACCESS_KEY_ID, SECRET_KEY ) );// Create an S3 Bucket // Create an S3 Bucket[s3 createBucketWithName:PICTURE_BUCKET]; s3.createBucket(PICTURE_BUCKET);// Put an Object into a Bucket // Put an Object into a BucketS3PutObjectRequest *por = [[S3PutObjectRequest alloc] PutObjectRequest por = initWithKey:PICTURE_NAME inBucket:PICTURE_BUCKET]; new PutObjectRequest(PICTURE_BUCKET,por.contentType = @"image/jpeg"; PICTURE_NAME,por.data = image; new java.io.File( image ) );[s3 putObject:por]; s3.putObject( por );// Get an Object from a Bucket // Get an Object from a BucketS3GetObjectRequest *gor = [[S3GetObjectRequest alloc] S3Object data = s3.getObject(PICTURE_BUCKET, PICTURE_NAME); initWithKey:PICTURE_NAME withBucket:PICTURE_BUCKET];S3GetObjectResponse *response = [s3 getObject:gor];
    • Queuing / Messaging (Amazon SQS, Amazon SNS)• Queue up data for the application/user• Send SMS/email to many users at once• Article and sample for Amazon SNS & Amazon SQS: • http://aws.amazon.com/articles/SDKs/9156883257507082
    • Application Feedback (Amazon SES Demo)• Have the application send you customer feedback, stack traces, etc. • Don’t leave the app to go to the mail client • Customers don’t worry about exposing their email address• Article and sample included with SDKs for Amazon SES: • http://aws.amazon.com/articles/SDKs/3290993028247679
    • Amazon SES DEMO
    • Amazon SES Demo CodeiOS Android// Create Amazon SES Client // Create Amazon SES ClientAmazonSESClient *ses = [[AmazonSESClient alloc] AmazonSESClient ses = new AmazonSESClient( initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY]; new BasicAWSCredentials( ACCESS_KEY_ID, SECRET_KEY ) );// Create the Message // Create the MessageSESMessage *message = [Utility createMessage]; Message message = Utility.createMessage();// Send the Message // Send the MessageSESDestination *destination = [[SESDestination alloc] init]; Destination to = new[destination.toAddresses addObject:@”email@domain.com”]; Destination().withToAddresses( “email@domain.com” ); String from = “email@domain.com”; SendEmailRequest ser= new SendEmailRequest( from, to, message );SESSendEmailRequest *ser = [[SESSendEmailRequest alloc] init]; SendEmailResult result = ses.sendEmail( ser);ser.source = @”email@domain.com”;ser.destination = destination;ser.message = message;SESSendEmailResponse response = [ses sendEmail:ser];
    • Storing Searchable Data (Amazon DynamoDB)• NoSQL database• SDKs have low and high level interfaces: • AWS Persistence Framework for Core Data • DynamoDB Mapper for Android• Articles and samples for all interfaces included in SDKs: • http://aws.amazon.com/articles/SDKs/7439603059327617 • http://aws.amazon.com/articles/SDKs/4435846131581972 • http://aws.amazon.com/articles/SDKs/3756417425850538
    • Managing Credentials• DO NOT embed your ROOT credentials • If compromised, your entire AWS account is accessible
    • Managing Credentials• Create an IAM account with limited permissions? { "Statement : [{ "Effect":"Allow", "Action":["s3:PutObject","s3:GetObject"], "Resource":"arn:aws:s3:::my_bucket/*"}] }• DO NOT embed IAM account credentials • Can’t rotate the credentials • NO individual user controls or revocation
    • Token Vending Machine TVM STS Simple DB temporary get token credentials requests via AWS mobile SDK using temporary credentials
    • Token Vending Machine• DO NOT EMBED YOUR CREDENTIALS! • http://aws.amazon.com/articles/SDKs/4611615499399490• Full Application TVM sample • http://aws.amazon.com/code/4598681430241367
    • Token Vending Machine Demo• Amazon S3 personal file store demo using the token vending machine
    • Temporary Credentials—It’s in the Policy{ "Statement : [{ "Effect":"Allow", "Action":["s3:PutObject","s3:GetObject","s3:DeleteObject"], "Resource":"arn:aws:s3:::reinvent-personal-file-store/__USERNAME__/*"},{ "Effect":"Allow", "Action":"s3:ListBucket", "Resource":"arn:aws:s3:::reinvent-personal-file-store", "Condition":{"StringLike":{"s3:prefix":"__USERNAME__/"}}}]}
    • Resources• Links to services supported by AWS mobile SDKs: • Amazon S3 (http://aws.amazon.com/s3/) • Amazon DynamoDB (http://aws.amazon.com/dynamodb/) • Amazon SQS (http://aws.amazon.com/sqs/) • Amazon SNS (http://aws.amazon.com/sns/) • Amazon SES (http://aws.amazon.com/ses/) • Amazon EC2 (http://aws.amazon.com/ec2/) • Elastic Load Balancing (http://aws.amazon.com/elasticloadbalancing/) • Auto Scaling (http://aws.amazon.com/autoscaling/) • CloudWatch (http://aws.amazon.com/cloudwatch/) • Amazon SimpleDB (http://aws.amazon.com/simpledb/)
    • How Do I Get Help/Support Using the Mobile SDKs?• Community support available through the AWS forums • https://forums.aws.amazon.com/forum.jspa?forumID=88• SDKs contain a number of samples and articles• AWS mobile blogs • Release updates • Tips & Tricks
    • Where’s the Source?• All SDK source is available on GitHub: • http://github.com/aws/aws-sdk-android • http://github.com/aws/aws-sdk-ios• Source includes project files to enable you to build the source directly• Want something changed/improved? • Fork and submit a pull request!
    • We are sincerely eager to #reinvent hear your feedback on thispresentation and on re:Invent. Please fill out an evaluation form when you have a chance.