Posts

Showing posts with the label private bucket

Amazon AWS s3 private Bucket video streaming

Amazon AWS s3 private bucket video streaming is so simple.. Add below permission in menifeast : < uses-permission android :name = " android.permission.INTERNET " /> Add below dependency in gradle file : compile ' com.amazonaws:aws-android-sdk-s3:2.3.0 ' Write below code lines to get private streaming url to stream video : AWSCredentials myCredentials = new BasicAWSCredentials ( {AWS_ACCESS_KEY_ID} , {AWS_SECRET_KEY} ); AmazonS3 s3client = new AmazonS3Client (myCredentials); s3client. setEndpoint ( {AWS_END_POINT} ); GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest ( {AWS_BUCKET} , {AWS_KEY} ); URL objectURL = s3client.generatePresignedUrl(request); Uri url = Uri.parse(objectURL.toString()); Initialize media controller & play video in video view VideoView mContentView = ( VideoView ) findViewById(R.id.surface); MediaController mController = new MediaController (this); mController. setAnchorView (mContentView); mCon...

Download file from Amazon AWS private Bucket

Download file from AWS S3 private Bucket Amazon is providing many of the APIs, all are used in different scenarios, Here, our aim is to download file using Amazon API, for that amazon's AWS S3 from SDK is used. Add below dependency in your app's gradle file compile 'com.amazonaws:aws-android-sdk-s3:2.3.0' below are the classes you need to import import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.mobileconnectors.s3.transferutility.TransferListener; import com.amazonaws.mobileconnectors.s3.transferutility.TransferObserver; import com.amazonaws.mobileconnectors.s3.transferutility.TransferState; import com.amazonaws.mobileconnectors.s3.transferutility.TransferType; import com.amazonaws.mobileconnectors.s3.transferutility.TransferUtility; import com.amazonaws.services.s3.AmazonS3Client; Declare Below variables in your class private static AmazonS3Client sS3Client; private static AWSCredentials ...