Git Product home page Git Product logo

para-client-android's Introduction

Logo

Android Client for Para

Download Join the chat at https://gitter.im/Erudika/para

What is this?

Para was designed as a simple and modular backend framework for object persistence and retrieval. It helps you build applications faster by taking care of the backend. It works on three levels - objects are stored in a NoSQL data store or any old relational database, then automatically indexed by a search engine and finally, cached.

This is the Android client for Para. Works with Android KitKat+ (API level 19 or later).

Quick start

  1. Use Maven or Gradle and include para-client-android as a dependency to your project.
dependencies {
    compile 'com.erudika:para-client-android:+'
}
  1. Initialize the client with your access and secret API keys.
// avoid using the secret key on mobile devices
ParaClient client = new ParaClient('ACCESS_KEY', null, applicationContext);
client.signIn("facebook", "fb_access_token", new Response.Listener<ParaObject>() {
    public void onResponse(ParaObject user) {
    	if (user != null) {
    		// success! user is authenticated, JWT token is saved
    	}
    }
});

It's a bad idea to hardcode your Para secret key in your code because it will run in an insecure client-side environment. Instead use the signIn() method to get an access token (JWT) with limited client permissions. Think of it like this: API key+secret = full API access, paraClient.signIn() = limited API access for clients with JWT tokens. You can have a special user object created just for your Android app and assign it special permissions so that your app can access a part of the Para API before authenticating another real user. Read the documentation for more information about client permissions. For granting resource permissions to your client users go to console.paraio.org where you can edit your app object and allow your users the call specific API methods.

The Android client uses Volley for HTTP requests so all requests are asynchronous, unless you use the methods that end in Sync(). These methods are executed synchronously and will block. Each method takes a callback (Listener) in which the result is returned.

To trust a self-signed TLS certificate use the method pc.trustHostnameCertificates(hostname):

ParaClient pc = new ParaClient(myAppId, null, applicationContext);
pc.trustHostnameCertificates("myhost.com");

Documentation

Read the Docs

Contributing

  1. Fork this repository and clone the fork to your machine
  2. Create a branch (git checkout -b my-new-feature)
  3. Implement a new feature or fix a bug and add some tests
  4. Commit your changes (git commit -am 'Added a new feature')
  5. Push the branch to your fork on GitHub (git push origin my-new-feature)
  6. Create new Pull Request from your fork

For more information see CONTRIBUTING.md

License

Apache 2.0

para-client-android's People

Contributors

albogdano avatar

Watchers

 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.