Android Open Source - Android-CriminalIntent Photo






From Project

Back to project page Android-CriminalIntent.

License

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.

Java Source Code

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;
    }
}




Java Source Code List

com.bignerdranch.android.criminalintent.CrimeCameraActivity.java
com.bignerdranch.android.criminalintent.CrimeCameraFragment.java
com.bignerdranch.android.criminalintent.CrimeFragment.java
com.bignerdranch.android.criminalintent.CrimeLab.java
com.bignerdranch.android.criminalintent.CrimeListActivity.java
com.bignerdranch.android.criminalintent.CrimeListFragment.java
com.bignerdranch.android.criminalintent.CrimePagerActivity.java
com.bignerdranch.android.criminalintent.Crime.java
com.bignerdranch.android.criminalintent.CriminalIntentJSONSerializer.java
com.bignerdranch.android.criminalintent.DatePickerFragment.java
com.bignerdranch.android.criminalintent.ImageFragment.java
com.bignerdranch.android.criminalintent.Photo.java
com.bignerdranch.android.criminalintent.PictureUtils.java
com.bignerdranch.android.criminalintent.SingleFragmentActivity.java
com.bignerdranch.android.criminalintent.dummy.DummyContent.java