This project contains the ParseLoginUI
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.
We also provide several sample projects demonstrating how to use the ParseLoginUI
library. To run these
sample projects, you need to do the following:
- Clone this repository onto your machine.
- Import this repository's projects with Android Studio. The project has Maven dependencies on the Facebook SDK and the Bolts framework. Android Studio automatically resolves these.
- Specify the following in
res/values/strings.xml
of each sample project:
parse_app_id
andparse_client_key
facebook_app_id
twitter_consumer_key
andtwitter_consumer_secret
- Build and run the sample project using Android Studio.
For complete details about this library project, please see our documentation on the Parse website.
We'll discuss some highlights here.
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.
For example, you can directly configure the login experience through the activity meta-data in AndroidManifest.xml
.
<activity
android:name="com.parse.ui.ParseLoginActivity"
android:label="@string/my_app_name"
android:launchMode="singleTop">
<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"/>
<meta-data
android:name="com.parse.ui.ParseLoginActivity.FACEBOOK_LOGIN_ENABLED"
android:value="true"/>
</activity>
Please see the Parse website for additional documentation.
See the CONTRIBUTING file for how to help out.
Copyright (c) 2014, Facebook, Inc. All rights reserved.
You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
copy, modify, and distribute this software in source code or binary form for use
in connection with the web services and APIs provided by Facebook.
As with any software that integrates with the Facebook platform, your use of
this software is subject to the Facebook Developer Principles and Policies
[http://developers.facebook.com/policy/]. This copyright notice shall be
included in all copies or substantial portions of the software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.