Android Open Source - cnp Post Parser






From Project

Back to project page cnp.

License

The source code is released under:

MIT License

If you think the Android project cnp 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.urucas.copynpaste.parser;
//  w  w  w.jav  a  2  s  .co m
import org.json.JSONObject;

import com.urucas.copynpaste.model.Post;

public abstract class PostParser {

  public static Post parse(JSONObject jsonObject) {
    try {
      
      int id = jsonObject.getInt("id");
      String data = jsonObject.getString("data");
      String fecha = jsonObject.getString("fecha");
      return new Post(id, data, fecha);
      
    }catch(Exception e) {
      return null;
    }
  }
}




Java Source Code List

com.urucas.copynpaste.CNPApplication.java
com.urucas.copynpaste.activities.HomeActivity.java
com.urucas.copynpaste.activities.SplashActivity.java
com.urucas.copynpaste.adapters.PostsAdapter.java
com.urucas.copynpaste.callbacks.PostsCallback.java
com.urucas.copynpaste.callbacks.UserCallback.java
com.urucas.copynpaste.controllers.ApiController.java
com.urucas.copynpaste.model.Post.java
com.urucas.copynpaste.model.User.java
com.urucas.copynpaste.parser.PostParser.java
com.urucas.copynpaste.parser.PostsParser.java
com.urucas.copynpaste.parser.UserParser.java
com.urucas.services.JSONRequestTaskHandler.java
com.urucas.services.JSONRequestTask.java
com.urucas.services.JSONRequest.java
com.urucas.services.RequestTaskHandler.java
com.urucas.services.RequestTask.java
com.urucas.utils.Utils.java