Android Open Source - GMIMediaAndroid Serializer Helper






From Project

Back to project page GMIMediaAndroid.

License

The source code is released under:

GNU General Public License

If you think the Android project GMIMediaAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (C) 2014 Gospel Ministries International
 */*from  w  w w.  j  ava  2s  .  com*/
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

package com.gospelministries.gmimedia.util;

import android.content.Context;
import com.gospelministries.gmimedia.bean.StreamList;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;

import java.io.InputStream;

/**
 * Helperclass for de-/serialization.
 *
 * @since 1.0.0
 */
public class SerializerHelper {

    /**
     * Common serializer instance.
     */
    private final static Serializer SERIALIZER = new Persister();

    /**
     * Deserializes a {@link com.gospelministries.gmimedia.bean.StreamList}
     * stored in an XML file.
     *
     * @param context   The context of the resource.
     * @param rawId     The ID of the resource.
     *
     * @return The deserialized StreamList.
     *
     * @throws Exception
     */
    public static StreamList deserializeStreamList(Context context, int rawId) throws Exception {
        InputStream input = context.getResources().openRawResource(rawId);
        return SERIALIZER.read(StreamList.class, input);
    }
}




Java Source Code List

com.gospelministries.gmimedia.adapter.MainFragmentPagerAdapter.java
com.gospelministries.gmimedia.adapter.StreamArrayAdapter.java
com.gospelministries.gmimedia.bean.AudioStream.java
com.gospelministries.gmimedia.bean.StreamList.java
com.gospelministries.gmimedia.bean.Stream.java
com.gospelministries.gmimedia.bean.Streampoint.java
com.gospelministries.gmimedia.bean.VideoStream.java
com.gospelministries.gmimedia.ui.activity.AbstractStreamListFragment.java
com.gospelministries.gmimedia.ui.activity.InfoActivity.java
com.gospelministries.gmimedia.ui.activity.MainActivity.java
com.gospelministries.gmimedia.ui.activity.RadioListFragment.java
com.gospelministries.gmimedia.ui.activity.TvListFragment.java
com.gospelministries.gmimedia.ui.activity.VideoPlayerActivity.java
com.gospelministries.gmimedia.ui.dialog.SelectStreampointDialog.java
com.gospelministries.gmimedia.ui.dialog.TextFileDialogBuilder.java
com.gospelministries.gmimedia.util.Constants.java
com.gospelministries.gmimedia.util.SerializerHelper.java
com.gospelministries.gmimedia.widget.MutableVideoView.java
com.gospelministries.gmimedia.widget.MuteableVideoView.java