Nuwe Parse Server - Android SDK Getting Started


#1

In order to get up and running with the Android SDK for the Parse-Server Service (see http://community.healthhackers.co/t/feature-nuwe-parse-server/75 for how to quickly setup Parse Server for your Nuwe app), here’s a quickstart guide (thanks to the team at Parse).

##Install

  1. Download the SDK
  2. Add the SDK to your App in Android Studio
  3. Add the following to your build.gradle
dependencies {
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'com.parse:parse-android:1.+'
}

Connect to Nuwe Parse-Server

Add the following to your Application#onCreate():

Parse.initialize(new Parse.Configuration.Builder(myContext)
    .applicationId("YOUR_PARSE_APP_ID")
    .server("https://parse.nuwe.co:YOUR_PORT/parse")
 
    ...
 
    .build()
);

Your app must request the INTERNET and ACCESS_NETWORK_STATE permissions, if it isn’t doing so already. Add the following lines inside the tag in your AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Compile and run!

Test the SDK

After installing the SDK, copy and paste this code into your app, for example in your Activity#onCreate():

ParseObject testObject = new ParseObject("TestObject");
testObject.put("foo", "bar");
testObject.saveInBackground();

You will also have to add an import statement at the top of your file:

import com.parse.ParseObject;

Run your app. A new object of class TestObject will be sent to the Parse Server and saved.

Where to go from here?

Review the Android Guide
Review the Parse-Server Android API Reference