Search in sources :

Example 1 with AllPlaylists

use of com.sdsmdg.harjot.MusicDNA.models.AllPlaylists in project MusicDNA by harjot-oberai.

the class HomeActivity method getSavedData.

private void getSavedData() {
    try {
        Gson gson = new Gson();
        Log.d("TIME", "start");
        String json2 = mPrefs.getString("allPlaylists", "");
        allPlaylists = gson.fromJson(json2, AllPlaylists.class);
        Log.d("TIME", "allPlaylists");
        String json3 = mPrefs.getString("queue", "");
        queue = gson.fromJson(json3, Queue.class);
        Log.d("TIME", "queue");
        String json4 = mPrefs.getString("recentlyPlayed", "");
        recentlyPlayed = gson.fromJson(json4, RecentlyPlayed.class);
        Log.d("TIME", "recents");
        String json5 = mPrefs.getString("favouriteTracks", "");
        favouriteTracks = gson.fromJson(json5, Favourite.class);
        Log.d("TIME", "fav");
        String json6 = mPrefs.getString("queueCurrentIndex", "");
        queueCurrentIndex = gson.fromJson(json6, Integer.class);
        Log.d("TIME", "queueCurrentindex");
        String json8 = mPrefs.getString("settings", "");
        settings = gson.fromJson(json8, Settings.class);
        Log.d("TIME", "settings");
        String json9 = mPrefs.getString("equalizer", "");
        equalizerModel = gson.fromJson(json9, EqualizerModel.class);
        Log.d("TIME", "equalizer");
        String json = mPrefs.getString("savedDNAs", "");
        savedDNAs = gson.fromJson(json, AllSavedDNA.class);
        Log.d("TIME", "savedDNAs");
    } catch (Exception e) {
        e.printStackTrace();
    }
    try {
        String json7 = mPrefs.getString("versionCode", "");
        prevVersionCode = gson.fromJson(json7, Integer.class);
        Log.d("TIME", "VersionCode : " + prevVersionCode + " : " + versionCode);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : AllSavedDNA(com.sdsmdg.harjot.MusicDNA.models.AllSavedDNA) RecentlyPlayed(com.sdsmdg.harjot.MusicDNA.models.RecentlyPlayed) EqualizerModel(com.sdsmdg.harjot.MusicDNA.models.EqualizerModel) Gson(com.google.gson.Gson) AllPlaylists(com.sdsmdg.harjot.MusicDNA.models.AllPlaylists) Queue(com.sdsmdg.harjot.MusicDNA.models.Queue) Favourite(com.sdsmdg.harjot.MusicDNA.models.Favourite) Settings(com.sdsmdg.harjot.MusicDNA.models.Settings) FileNotFoundException(java.io.FileNotFoundException)

Aggregations

Gson (com.google.gson.Gson)1 AllPlaylists (com.sdsmdg.harjot.MusicDNA.models.AllPlaylists)1 AllSavedDNA (com.sdsmdg.harjot.MusicDNA.models.AllSavedDNA)1 EqualizerModel (com.sdsmdg.harjot.MusicDNA.models.EqualizerModel)1 Favourite (com.sdsmdg.harjot.MusicDNA.models.Favourite)1 Queue (com.sdsmdg.harjot.MusicDNA.models.Queue)1 RecentlyPlayed (com.sdsmdg.harjot.MusicDNA.models.RecentlyPlayed)1 Settings (com.sdsmdg.harjot.MusicDNA.models.Settings)1 FileNotFoundException (java.io.FileNotFoundException)1