Created
April 26, 2021 09:55
-
-
Save nuriyevn/0b642d8d8ed8cd2959b4dba78c74a8c0 to your computer and use it in GitHub Desktop.
Revisions
-
nuriyevn created this gist
Apr 26, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ 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()); } } }