Skip to content

Instantly share code, notes, and snippets.

@nuriyevn
Created April 26, 2021 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuriyevn/0b642d8d8ed8cd2959b4dba78c74a8c0 to your computer and use it in GitHub Desktop.
Save nuriyevn/0b642d8d8ed8cd2959b4dba78c74a8c0 to your computer and use it in GitHub Desktop.
public class StarterApplication extends Application {
public static final String TAG = "Starter";
@Override
public void onCreate() {
super.onCreate();
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
// Add your initialization code here
Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
.applicationId("myappID")
.clientKey("tDjVOpOd4xMg")
.server("https://ec2-18-216-250-74.us-east-2.compute.amazonaws.com/parse/")
.build()
);
//ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
defaultACL.setPublicReadAccess(true);
defaultACL.setPublicWriteAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
if (ParseUser.getCurrentUser() == null)
{
ParseAnonymousUtils.logIn(new LogInCallback() {
@Override
public void done(ParseUser user, ParseException e) {
if (e == null)
Log.i(TAG, "Anon ok");
else
Log.i(TAG, "Anon not ok");
}
});
}
else {
Log.i(TAG, "username = " + ParseUser.getCurrentUser().getUsername().toString());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment