# Trying the sample app
The LINE Login sample app for Android lets you quickly see how LINE Login works on an Android app.
# Prerequisites
To build and run the sample app, you need:
- Android Studio (opens new window) installed
# Trying the sample app
To try the sample app with our sample channel, follow the steps below.
Clone the LINE SDK for Android open-source repository (opens new window).
$ git clone https://github.com/line/line-sdk-android.git
Open the LINE SDK project in Android Studio.
Build the project and run the app using an Android device or Android Emulator.
The sample app has already defined its own sample channel id, and its value is 1620019587
, you don't need to set it again.
# Running the sample app
Run the sample app using an Android device or Android Emulator. When you first log in, you must agree to let the app access your profile information.
# Using the "Log in with LINE" button
Tap the green Log in with LINE button to log in using app-to-app login. This is the LINE SDK's built-in login button.
If LINE is installed on the device, and you are logged in, you will be able to log in to the sample app automatically without entering your LINE credentials. Otherwise, you'll be requested to log in by using your device's browser. In this scenario, you'll need to enter your LINE credentials.
# Using the "login" button
If you aren't currently logged in, the login button will be available.
Tap the login button, the LINE app-to-app login process will be triggered.
The login method and process is just like the built-in login button from the SDK, but it provides some options to adjust, such as Scopes
.
You may refer to the getLoginIntent
method of the LineLoginApi
class provided by LINE SDK.
The default Scopes it use are PROFILE
and OPENID_CONNECT
.
# Using the "web login" button
If you aren't currently logged in, the web login button will be available. Tap the web login button, a LINE login webpage will be opened by browser.
# Using the "logout" button
After you are logged in, the logout button will be available. Tap the logout button to log out current user.
For more information, see Logging out users.
# Trying out the features available on the LINE SDK
Once you've logged in to the app, you can tap the API List Page button to try out the following features of the LINE SDK.
- Getting user profiles
- Getting the current access token
- Refreshing access tokens
- Verifying access tokens
- Use LINE Login to get friendship status
You can view the response from the top half of the page after clicking on each SDK API Button.