Skip to content
Mengyan Wang edited this page Oct 2, 2015 · 2 revisions

Overview

ParseUI-Login is a library for building login and signup flows with the Parse Android SDK. You can easily configure the look and feel of the login screens by either specifying XML configurations or constructing an Intent in code. To use this project with your app, you should import it as a library project in Android Studio.

Running Sample Projects

We built several sample apps demonstrating how to use the ParseLoginUI library. Before importing this library into your app, we recommend that you run these sample apps to become familiar with its functionality and customizations. To run our sample apps, you need to import this repo as a standalone Gradle project:

  1. Clone this repository onto your machine.
  2. Import this repository's project with Android Studio (File > Import Project > ParseUI-Android folder). The project has Maven dependencies on the Parse Android SDK, Facebook SDK and the Bolts framework. Android Studio automatically resolves these via Gradle.
  3. Specify the following in res/values/strings.xml of each sample project: parse_app_id and parse_client_key facebook_app_id twitter_consumer_key and twitter_consumer_secret
  4. Build and run the sample apps using Android Studio.

Usage

  1. Import and config Parse as described in README.md.

  2. Add the following to your AndroidManifest.xml within the <application></application> section. You can see a complete example in our sample app.

    <activity
        android:name="com.parse.ui.ParseLoginActivity"
        android:label="@string/app_name"
        android:launchMode="singleTop">
        <!-- For more options, see https://www.parse.com/docs/android_guide#ui-login -->
        <meta-data
            android:name="com.parse.ui.ParseLoginActivity.PARSE_LOGIN_ENABLED"
            android:value="true"/>
        <meta-data
            android:name="com.parse.ui.ParseLoginActivity.PARSE_LOGIN_EMAIL_AS_USERNAME"
            android:value="true"/>
    </activity>
  3. To start the login flow from your own activity, you launch the ParseLoginActivity with two lines of code:

    ParseLoginBuilder builder = new ParseLoginBuilder(MyActivity.this);
    startActivityForResult(builder.build(), 0);

ParseLoginActivity will guide the user through the login experience, where the user can also sign up or reset a forgotten password. Each screen in the login experience is implemented by a fragment hosted within this activity. When ParseLoginActivity finishes, you can check ParseUser.getCurrentUser() in your own activity to see whether the user actually logged in. This library is ultra-customizable, allowing you to configure the login experience through either XML or code. You can directly configure the login experience through the activity meta-data in AndroidManifest.xml.

Documentation

For complete details about this library project, please see our documentation on the Parse website.

Clone this wiki locally