Skip to content

Commit 095d347

Browse files
committed
refined catalog/parse initialization process, much simpler now
1 parent eaec4f4 commit 095d347

5 files changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.autolean.appcatalog;
2+
3+
import android.app.Application;
4+
import android.content.Context;
5+
6+
import com.autolean.appcatalog.data.apps.AppCatalogApp;
7+
import com.autolean.appcatalog.data.social.AppCatalogSocialMediaOutlet;
8+
import com.parse.Parse;
9+
import com.parse.ParseCrashReporting;
10+
import com.parse.ParseObject;
11+
import com.parse.PushService;
12+
13+
/**
14+
* Created by anthony on 7/17/15.
15+
*
16+
* Extend your Application class from this class whenever Parse, or the AppCatalog
17+
* is needed in your application.
18+
*
19+
*/
20+
public abstract class CatalogApp extends Application {
21+
@Override
22+
public void onCreate() {
23+
super.onCreate();
24+
initParse();
25+
}
26+
27+
public abstract Context getContext();
28+
public abstract String getApplicationId();
29+
public abstract String getClientId();
30+
public abstract Class getDefaultCallback();
31+
32+
public void initParse(){
33+
Parse.enableLocalDatastore(getContext());
34+
ParseCrashReporting.enable(getContext());
35+
36+
ParseObject.registerSubclass(AppCatalogApp.class);
37+
ParseObject.registerSubclass(AppCatalogSocialMediaOutlet.class);
38+
39+
Parse.initialize(getContext(), getApplicationId(), getClientId());
40+
PushService.setDefaultPushCallback(getContext(), getDefaultCallback());
41+
}
42+
}
-3.34 KB
Binary file not shown.
-2.15 KB
Binary file not shown.
-4.73 KB
Binary file not shown.
-7.54 KB
Binary file not shown.

0 commit comments

Comments
 (0)