Saturday, December 12, 2015

Android and Parse (BAAS)

With Parse you can create apps and no worry to maintain a backend.
More info about parse: www.parse.com git: https://github.com/parseplatform

Getting started (Must do the below tutorial to understand how to setup Parse):
https://parse.com/apps/quickstart#parse_data/mobile/android/native/existing 

https://www.parse.com/docs/android/guide#local-datastore

Great tutorial to save and retrieve data with Parse: http://www.sitepoint.com/creating-cloud-backend-android-app-using-parse/
github to above link: https://github.com/sitepoint-editors/Android-Parse

Todo app: http://blog.revivalx.com/2015/06/09/develop-a-simple-android-mobile-app-todolist-part-1/

Parse dashboard: https://dashboard.parse.com/apps

Login with Facebook: https://github.com/ParsePlatform/ParseFacebookUtils-Android
ex: https://parse.com/docs/android/guide#users-facebook-users

Login with Parse(save users in Parse backend for free): https://github.com/AndreSand/UserParse

Parse Store tutorial: https://github.com/ParsePlatform/ParseStore

Parse Android send notifications (easy setup): https://parse.com/apps/quickstart#parse_push/android/native/existing
https://parse.com/tutorials/android-push-notifications

SETUP:https://parse.com/apps/quickstart#parse_data/mobile/android/native/existing 


.5 Create a test app in Parse dashboard to get AppID and ClientKey (found in: App Settings -> Security and keys)
1. Download the latest Parse.jar, and copy and paste to your app/lib/Parse.jar.
then add:
 dependencies {
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
}
to /GradleScripts/build.graddle(app)

2. Now create a new directory ParseApp, here we are going to setup the parse app, Create class ParseSetup ( we will add this class to your Manifest).

public class ParseSetup extends Application {

    @Override    public void onCreate() {
        super.onCreate();
        Parse.enableLocalDatastore(this);
        Parse.initialize(this);        //setupParse();        ParseObject testObject = new ParseObject("TestObject");        testObject.put("foo", "bar222");        testObject.saveInBackground();

    }

}

3. Open AndroidManifest.xml and add the name of the Parse App class here (ParseSetup). ex:
<application    android:name=".ParseApp.ParseSetup"    android:allowBackup="true"    android:icon="@mipmap/ic_gamma"    android:label="@string/app_name"    android:supportsRtl="true"    android:theme="@style/AppTheme">    <activity android:name=".MainActivity">        <intent-filter>            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />        </intent-filter>    </activity>
    <meta-data        android:name="com.parse.APPLICATION_ID"        android:value="your_ID" />    <meta-data        android:name="com.parse.CLIENT_KEY"        android:value="your_key" />

also add the below Permissions:
<uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

test

No comments:

Post a Comment