This application presets a sample login screen / account registration flow. It allows a user to create an account, log in, and stores the credentials in the Android Account Manager.
In particular this sample application highlights the following key backend tasks:
- Allow users to sign up and log in
- Store Credentials in Android AccountManager
- Integrate Login with Twitter or Facebook OAuth
- Clone the project repository.
- Download the latest Kinvey library (zip) and extract the downloaded zip file, from: http://devcenter.kinvey.com/android/downloads
###Android Studio
- In Android Studio, go to File → New → Import Project
- Browse to the extracted zip from step 1, and click OK
- Click Next and Finish.
- Copy all jars in the libs/ folder of the Kinvey Android library zip to the lib/ folder at the root of the project
- Click the play button to start a build, if you still see compilation errors ensure the versions are correctly defined in the dependencies list
###Finally, for all IDEs
app.key=MY_APP_KEY
app.secret=MY_APP_SECRET
##Twitter login
- Visit Twitter's developer console, login, and create a new application.
- Set the
Callback URL
to be anything, as long as it is not empty. For example,http://koauthtest.com
- Open the file
TwitterLoginActivity
and set the following two values to your unique keys.
private static final String TWITTER_CONSUMER_KEY = "your_twitter_consumer_key";
private static final String TWITTER_CONSUMER_SECRET = "your_twitter_consumer_secret";
##Facebook login
- Visit Facebook's developer console, login, and create a new appication.
- Check the box for
Native Android App
, and enter your Package name and Class name. - Visit Facebook's getting started guide and follow their
Step 4
to generate yourKey Hash
, and set that value in your Facebook's app's configuration page. - In this sample project, open the file
/res/values/strings.xml
and set following value with your unique key.
<string name="facebook_app_id">my_facebook_app_id</string>
##Google+ Login
- Visit Google's developer console and follow
Prerequisites
,Step 1
, andStep 2
to enable the Google+ API and import thelibrary project
(Not a JAR!) into your IDE.
The following libraries are required to run this sample:
- Kinvey Android Library
- Facebook SDK for Android
- Google Play Services (Available in the Android SDK Manager)
- Action Bar Sherlock
Copyright (c) 2014 Kinvey, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.