Coder Social home page Coder Social logo

404-not-find / line-sdk-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from line/line-sdk-android

0.0 1.0 0.0 698 KB

LINE SDK for Android lets you integrate LINE into your Android app to create a more engaging experience for your users.

Home Page: https://developers.line.biz/en/docs/android-sdk/

License: Apache License 2.0

Java 81.42% CSS 4.32% JavaScript 4.39% C# 5.89% Smalltalk 1.45% Kotlin 2.52%

line-sdk-android's Introduction

Download

Overview

The LINE SDK for Android provides a modern way of implementing LINE APIs. The features included in this SDK will help you develop an Android app with engaging and personalized user experience.

Features

The LINE SDK for Android provides the following features.

User authentication

This feature allows users to log in to your service with their LINE accounts. With the help of the LINE SDK for Android, it has never been easier to integrate LINE Login into your app. Your users will automatically log in to your app without entering their LINE credentials if they are already logged in to LINE on their Android devices. This offers a great way for users to get started with your app without having to go through a registration process.

Utilizing user data with OpenID support

Once the user is authorized, you can get the user’s LINE profile. You can utilize the user's information registered in LINE without building your user system.

The LINE SDK supports the OpenID Connect 1.0 specification. You can get ID tokens that contain the user’s LINE profile when you retrieve the access token.

Setup

Pre-request

Create your own LINE Channel and follow the instructions here to link your app to your channel.

Gradle

Setup current line-sdk version

linesdk_version = '5.4.0'

Add Jcenter to your repositories if it's not added yet.

repositories {
    ...
	jcenter()    
}

Import line-sdk dependency

dependencies {
    implementation 'com.linecorp.linesdk:linesdk:$linesdk_version'
    ...
}

Quickstart

A pre-defined LINE login button is provided. You can add it to the user interface of your app to provide your users with a quick way to log in as below

Add login buton to layout xml

<com.linecorp.linesdk.widget.LoginButton
    android:id="@+id/line_login_btn"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

Use it in codes

LoginButton loginButton = rootView.findViewById(R.id.line_login_btn);

// if the button is inside a Fragment, this function should be called.
loginButton.setFragment(this); 

// replace the string to your own channel id.
loginButton.setChannelId("the channel id you created");

// configure whether login process should be done by LINE App, or by WebView.
loginButton.enableLineAppAuthentication(true);

// set up required scopes. 
loginButton.setAuthenticationParams(new LineAuthenticationParams.Builder()
        .scopes(Arrays.asList(Scope.PROFILE))
        .build()
);

// A delegate for delegating the login result to the internal login handler. 
private LoginDelegate loginDelegate = LoginDelegate.Factory.create();
loginButton.setLoginDelegate(loginDelegate);

loginButton.addLoginListener(new LoginListener() {
    @Override
    public void onLoginSuccess(@NonNull LineLoginResult result) {
        Toast.makeText(getContext(), "Login success", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onLoginFailure(@Nullable LineLoginResult result) {
        Toast.makeText(getContext(), "Login failure", Toast.LENGTH_SHORT).show();
    }
});

For more information, refer to the LINE SDK for Android guide on the LINE Developers site.

Try the starter app

To have a quick look at the features of the LINE SDK, try our starter app by following the steps below:

  1. Clone the repository.

    git clone https://github.com/line/line-sdk-android.git

  2. Build the starter app.

    ./gradlew app:assembleDebug

The starter app apk file will be built as app/build/outputs/apk/debug/app-debug.apk.

Contributing

If you believe you have discovered a vulnerability or have an issue related to security, please DO NOT open a public issue. Instead, send us a mail to [email protected].

For contributing to this project, please see CONTRIBUTING.md.

line-sdk-android's People

Contributors

cherenkov avatar coffeephile avatar hayasilin avatar liying2010 avatar marshallgunnell avatar perthcpe23 avatar plateaukao avatar tsairene avatar wouter-veeken 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.