Android Open Source - face_rec_android Crowsource Data Parser






From Project

Back to project page face_rec_android.

License

The source code is released under:

GNU General Public License

If you think the Android project face_rec_android 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 in.amolgupta.helpingfaceless.parser;
/* w  w  w  .ja  va 2s .c o m*/
import in.amolgupta.helpingfaceless.entities.ImageData;
import in.amolgupta.helpingfaceless.entities.TaskDetails;

import java.util.ArrayList;

import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;

/**
 * @author amol
 * 
 */
public class CrowsourceDataParser {
  /**
   * @param input
   * @return
   * @throws JSONException
   */
  public static TaskDetails Parse(String input) throws JSONException {
    JSONObject root = new JSONObject(input);
    JSONObject imageOne = root.getJSONObject("one");
    JSONObject imagetwo = root.getJSONObject("two");
    JSONObject task = root.getJSONObject("task");
    
    Gson gson = new Gson();
    ImageData mImageOne = gson.fromJson(imageOne.toString(),
        ImageData.class);
    ImageData mImageTwo = gson.fromJson(imagetwo.toString(),
        ImageData.class);
    ArrayList<ImageData> images = new ArrayList<ImageData>();
    images.add(mImageOne);
    images.add(mImageTwo);
    return  new TaskDetails(mImageOne, mImageTwo, task.getString("id"));
  }
}




Java Source Code List

in.amolgupta.helpingfaceless.Views.Fragment.DashboardFragment.java
in.amolgupta.helpingfaceless.activities.HFBaseActivity.java
in.amolgupta.helpingfaceless.activities.HelpActivity.java
in.amolgupta.helpingfaceless.activities.HelpItemFragment.java
in.amolgupta.helpingfaceless.activities.HomeActivity.java
in.amolgupta.helpingfaceless.activities.ImageFragment.java
in.amolgupta.helpingfaceless.activities.PledgeFragment.java
in.amolgupta.helpingfaceless.activities.SetupActivity.java
in.amolgupta.helpingfaceless.activities.SigningActivity.java
in.amolgupta.helpingfaceless.activities.UploadForm.java
in.amolgupta.helpingfaceless.common.App.java
in.amolgupta.helpingfaceless.common.Constants.java
in.amolgupta.helpingfaceless.entities.ImageData.java
in.amolgupta.helpingfaceless.entities.NavItem.java
in.amolgupta.helpingfaceless.entities.TaskDetails.java
in.amolgupta.helpingfaceless.parser.CrowsourceDataParser.java
in.amolgupta.helpingfaceless.services.SendCSResponse.java
in.amolgupta.helpingfaceless.utils.ET.java
in.amolgupta.helpingfaceless.utils.LocationRequestData.java
in.amolgupta.helpingfaceless.utils.RequestUtils.java