I am trying to develop an android application which will retrieve pdf files from Amazon s3 bucket. How can I implement this in such a way that, the files are always synced between the app and s3 bucket ? I will be adding large number of pdf files manually into the s3 bucket and I would like the app to reflect the changes in s3 bucket instantly. I would also like to know, if it's possible to trigger a push notification when new files are added to the bucket and app is not open on users phone?
Asked
Active
Viewed 714 times
0
-
You could trigger a push notification using AWS Lambda watching S3 events. That could also send an instruction for a mobile device to fetch a file on a background task – OneCricketeer May 05 '18 at 13:54
-
@cricket_007 wont that add more expense? Already am not sure how much would the ec2 instance and s3 could cost me. How is lamda charged? Is it upon the number of calls made? – user86366 May 05 '18 at 14:01
-
Lambda is charged by event usage. There's no EC2 instances you maintain for it. Also, it's the cheapest way to get any type of immediate notification without periodically scanning the bucket yourself for files – OneCricketeer May 05 '18 at 14:06
-
@cricket_007 In my case, files are uploaded by users to my s3 bucket using a node app. So I don't need to periodically scan since the uploads are made through my node app. I can trigger a push notification through my node app right? – user86366 May 05 '18 at 14:10
-
You need a GCM / FCM server to send any push notifications to mobile devices. But sure, you could do that – OneCricketeer May 05 '18 at 14:12
-
@cricket_007 I would like to know how the app can fetch new files added on s3. JUST like how Stack exchange app works on my phone, when ever you comment, i get a notification along with the comment being shown without reloading the activity. – user86366 May 05 '18 at 14:13
-
For more information on that, you need another Amazon service. SNS https://stackoverflow.com/q/38300450/2308683 – OneCricketeer May 05 '18 at 14:13