From the course: Building Android Apps with AWS

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create AWS provider class

Create AWS provider class

From the course: Building Android Apps with AWS

Start my 1-month free trial

Create AWS provider class

- [Instructor] In order to allow our code to communicate with Amazon Web Services, I'm gonna follow an example that Amazon uses in their starter project and I'm actually gonna create a singleton class that can instantiate all of the necessary objects, and I'm gonna call that class AWS Provider. I'm gonna create that in the utilities folder here. Go to new Kotlin file, call AWSProvider. Make sure that I have object selected and hit OK. Then I'm gonna do just a little bit of setup here in this class so that we can access it statically. I'm first gonna create an instance property. Then I'm gonna create a little accessor method so that we can retrieve that instance called getInstance. And then I'm also gonna create a couple quick methods for initializing that instance. The first one I'm gonna call getAWSProvider. I'm gonna pass it a context. Just have it return this. Need to make sure that I import that context file. And then I'm also gonna add an initialize function. Gonna pass that the…

Contents