So now that Parse.com is gone, there’s still the option of using your own server w/ their open-source server code.
You can find info on setting that up on their site linked above. But this post is about setting up your Android Studio project w/ the Parse SDK.
- If you don’t have it, get Android Studio: https://developer.android.com/studio/index.html
- Add Parse: https://github.com/ParsePlatform/Parse-SDK-Android
- Restarted project (it wasn’t picking up the SDK)
- Added imports, init call and login call to test
As you can see, I created a class to house some static methods including initializing the Parse server connection. The ‘initialized’ flag is to prevent it from happening multiple times in a given execution of the app.
Parse.initialize(new Parse.Configuration.Builder(getApplicationContext()) .applicationId(“<app id>“) .clientKey("-----n/a-----") .server(“<api url>”) .build() );
I was connecting to an existing database/Parse server so I tested it w/ a quick login…
ParseUser user = ParseUser.logIn(“<username>”, “<password>”); // returns user