For Java & Groovy DSL

Step 1

Create folder libs in your Android project, under your app folder and copy the SparkYou-v1.1.aar to this folder

Step 2

Open your build.gradle , add implementation(files("libs/SparkYou-v1.1.aar")) to dependencies section

Now you can import and use the SparkYouWebView to load SparkYou web app and inject the current user access token.

For example, add a button in your main activity and when user click this button, it will initiate a SparkYouWebView instance

  1. Add a button to the main activity

  1. In MainActivity.java

    1. Import SparkYouWebViewand SparkYouWebViewDelegate

    2. Since we use delegate for communication between MainActivity and the SparkYouWebView , your MainActivity need to implement the SparkYouWebViewDelegate interface. Modify your MainActivity as below:

    3. Add openWebsiteButtonClick function (which was added to android:onClick in the above button code)

    4. Implement two functions required by the SparkYouWebViewDelegate interface

Last updated