Search in sources :

Example 1 with Caller

use of com.softartdev.lastfm.Caller in project scroball by peterjosling.

the class ScroballApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());
    FlowManager.init(this);
    MobileAds.initialize(this, "ca-app-pub-9985743520520066~4279780475");
    sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    String userAgent = String.format(Locale.UK, "%s.%d", BuildConfig.APPLICATION_ID, BuildConfig.VERSION_CODE);
    String sessionKeyKey = getString(R.string.saved_session_key);
    LastfmApi api = new LastfmApi();
    Caller caller = Caller.getInstance();
    if (sharedPreferences.contains(sessionKeyKey)) {
        String sessionKey = sharedPreferences.getString(sessionKeyKey, null);
        lastfmClient = new LastfmClient(api, caller, userAgent, sessionKey);
    } else {
        lastfmClient = new LastfmClient(api, caller, userAgent);
    }
    scroballDB = new ScroballDB();
    eventBus.register(this);
}
Also used : Caller(com.softartdev.lastfm.Caller) Crashlytics(com.crashlytics.android.Crashlytics) ScroballDB(com.peterjosling.scroball.db.ScroballDB)

Aggregations

Crashlytics (com.crashlytics.android.Crashlytics)1 ScroballDB (com.peterjosling.scroball.db.ScroballDB)1 Caller (com.softartdev.lastfm.Caller)1