Android Open Source - json_resume Json Resume Parser






From Project

Back to project page json_resume.

License

The source code is released under:

/* * Copyright (c) 2015 Hunter Davis <hunter@hunterdavis.com> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided th...

If you think the Android project json_resume 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

package com.hunterdavis.jsonresumeviewer;
/* w ww. j  ava 2  s  . c om*/
import android.content.Context;
import android.content.res.AssetManager;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.stream.JsonReader;
import com.hunterdavis.jsonresumeviewer.types.Resume;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

/**
 * Created by hunter on 2/18/15.
 */
public class JsonResumeParser {

    /**
     * parse Hunter's current resume from the assets folder
     * @param context
     * @return
     */
    public static Resume parseHuntersResume(Context context) throws IOException {
        AssetManager assetManager = context.getAssets();
        InputStream inputStream;
        inputStream = assetManager.open("resume.json");
        return parseInputStreamForJsonResume(inputStream);
    }

    /**
     * parse an inputstream for a Resume object
     * @param input
     * @return
     */
    public static Resume parseInputStreamForJsonResume(InputStream input) throws UnsupportedEncodingException {

        JsonReader reader = new JsonReader(new InputStreamReader(input, "UTF-8"));
        Gson gson = new Gson();
        Resume resume = gson.fromJson(reader, Resume.class);

        return resume;
    }
}




Java Source Code List

com.hunterdavis.jsonresumeviewer.IconDownloadTask.java
com.hunterdavis.jsonresumeviewer.JsonResumeActivity.java
com.hunterdavis.jsonresumeviewer.JsonResumeParser.java
com.hunterdavis.jsonresumeviewer.ResumePagerAdapter.java
com.hunterdavis.jsonresumeviewer.ResumeSections.java
com.hunterdavis.jsonresumeviewer.fragment.AwardsFragment.java
com.hunterdavis.jsonresumeviewer.fragment.BasicsResumeFragment.java
com.hunterdavis.jsonresumeviewer.fragment.EducationFragment.java
com.hunterdavis.jsonresumeviewer.fragment.InterestsFragment.java
com.hunterdavis.jsonresumeviewer.fragment.LanguagesFragment.java
com.hunterdavis.jsonresumeviewer.fragment.ProfileFragment.java
com.hunterdavis.jsonresumeviewer.fragment.PublicationsFragment.java
com.hunterdavis.jsonresumeviewer.fragment.ReferencesFragment.java
com.hunterdavis.jsonresumeviewer.fragment.SkillsFragment.java
com.hunterdavis.jsonresumeviewer.fragment.TextResumeFragment.java
com.hunterdavis.jsonresumeviewer.fragment.VolunteerFragment.java
com.hunterdavis.jsonresumeviewer.fragment.WorkFragment.java
com.hunterdavis.jsonresumeviewer.types.Awards.java
com.hunterdavis.jsonresumeviewer.types.Basics.java
com.hunterdavis.jsonresumeviewer.types.Education.java
com.hunterdavis.jsonresumeviewer.types.Interests.java
com.hunterdavis.jsonresumeviewer.types.Languages.java
com.hunterdavis.jsonresumeviewer.types.Location.java
com.hunterdavis.jsonresumeviewer.types.Profiles.java
com.hunterdavis.jsonresumeviewer.types.Publications.java
com.hunterdavis.jsonresumeviewer.types.References.java
com.hunterdavis.jsonresumeviewer.types.Resume.java
com.hunterdavis.jsonresumeviewer.types.Skills.java
com.hunterdavis.jsonresumeviewer.types.Volunteer.java
com.hunterdavis.jsonresumeviewer.types.Work.java