GithubHelp home page GithubHelp logo

ingenieursaurav / amplify-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-amplify/amplify-android

0.0 0.0 0.0 56.54 MB

A declarative library for application development using cloud services.

Home Page: https://amplify.aws

License: Apache License 2.0

Java 99.87% Python 0.05% Shell 0.09%

amplify-android's Introduction

AWS Amplify

Discord Chat

Amplify for Android (Preview)

AWS Amplify provides a high-level interface to perform different categories of cloud operations. Each category is fulfilled by a plugin. You specify which plugins to use during setup.

The default plugins that we provide are designed to facilitate interaction with Amazon Web Services (AWS). But, the Amplify framework is designed to be extensible to any other backend or service.

If you're new to the project, checkout the Getting Started Guide.

The Categories

Model your app's data. Save, query, and observe changes to your data from a local repository. Let DataStore synchronize your local data with the Cloud. Our default implemenation syncs local data to/from an Amazon DynamoDB database, via an Amazon AppSync front-end.

Easy auth and request signing against multiple REST endpoints. Our default plugin works great with Amazon API Gateway.

Data modeling and simple auth against GraphQL endpoints. Our default plugin targets AppSync.

Collect and report usage data for your app. Our default plugin communicates with Amazon Pinpoint.

Store and retrieve files in the Cloud. We use Amazon Simple Storage Service (S3) by default.

Platform Support

The Amplify Framework supports Android API level 16 (Android 4.1) and above.

Using Amplify from Your App

Specifying Gradle Dependencies

To begin, include Amplify from your app module's build.gradle dependencies section:

dependencies {
    // Only specify modules that provide functionality your app will use
    implementation 'com.amplifyframework:aws-datastore:0.10.0'
    implementation 'com.amplifyframework:aws-api:0.10.0'
    implementation 'com.amplifyframework:aws-storage-s3:0.10.0'
    implementation 'com.amplifyframework:aws-analytics-pinpoint:0.10.0'
}

Java 8 Compatibility

Amplify Android uses Java 8 features. Please add a compileOptions block inside your app's build.gradle, as below:

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

AWS Mobile Client

The default plugins for Amplify Android rely on the AWS Mobile Client to provide authentication with AWS services.

Please see Getting Started with Authentication for full details.

In summary, you need to ensure AWSMobileClient is initialized before interfacting with Amplify:

AWSMobileClient awsAuth = AWSMobileClient.getInstance();
Context context = getApplicationContext();
awsAuth.initialize(context, new Callback<UserStateDetails>() {
    @Override
    public void onResult(UserStateDetails userStateDetails) {
        Amplify.addPlugin(new AWSApiPlugin()); // For example
        Amplify.configuration(context);
        Toast.makeText(context, "OK!", Toast.LENGTH_SHORT);
    }

    @Override
    public void onError(Exception error) {
        Toast.makeText(context, "Uh oh...", Toast.LENGTH_SHORT);
    }
});

Please note that AWSMobileClient initialization is not required when using the AWSApiPlugin or AWSDataStorePlugin with api key as the authorization mode.

License

This library is licensed under the Apache 2.0 License.

Report a Bug

We appreciate your feedback -- comments, questions, and bug reports. Please submit a GitHub issue, and we'll get back to you.

Contribute to the Project

Please see the Contributor's Guide.

amplify-android's People

Contributors

desokroshan avatar drochetti avatar jamesonwilliams avatar jpeddicord avatar jpignata avatar mauerbac avatar mlabieniec avatar raphkim avatar richardmcclellan avatar rjuliano avatar royjit avatar treksoft avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.