Back to project page Android-CriminalIntent.
The source code is released under:
MIT License
If you think the Android project Android-CriminalIntent listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.bignerdranch.android.criminalintent; /*ww w . j a va 2 s . co m*/ import android.content.res.Configuration; import org.json.JSONException; import org.json.JSONObject; /** * Placeholder Photo class that wraps the filename of a photo * Created by mweekes on 1/4/14. */ public class Photo { private static final String JSON_FILENAME = "filename"; private static final String JSON_ORIENTATION = "orientation"; private String mFilename; private int mOrientation; public Photo(String filename, int orientation) { mFilename = filename; mOrientation = orientation; } public Photo(JSONObject json) throws JSONException { mFilename = json.getString(JSON_FILENAME); if (json.has(JSON_ORIENTATION)) { mOrientation = json.getInt(JSON_ORIENTATION); } } public JSONObject toJSON() throws JSONException { JSONObject json = new JSONObject(); json.put(JSON_FILENAME, mFilename); json.put(JSON_ORIENTATION, mOrientation); return json; } public String getFilename() { return mFilename; } public int getOrientation() { return mOrientation; } }