Mobile API with Java examples?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mickknutson
    Senior Member
    • Jan 2004
    • 257
    • 3.6.x

    [Forum] Mobile API with Java examples?

    I am starting to read through


    But am interested if anyone has done this with Java instead of PHP. I am just not that strong on PHP, and not sure of the code translation, and would love to be able to tie Java into these API's.
    Thank You...Mick Knutson

    BLiNC Magazine Forums: "Everything you ever wanted to know about BASE-Jumping, but didn't know whom to ask."

  • mickknutson
    Senior Member
    • Jan 2004
    • 257
    • 3.6.x

    #2
    Specifically, I am looking at


    This talks about being able to just map POJO's from REST Services:

    Code:
    public class Event {
    
        private Long id;
    
        private String title;
    	
        public Long getId() {
            return id;
        }
    
        public void setId(Long id) {
            this.id = id;
        }
    
        public String getTitle() {
            return title;
        }
    	
        public String setTitle(String title) {
            this.title = title;
        }
    }
    Then calling:
    Code:
    RestTemplate restTemplate = new RestTemplate();
    restTemplate.setRequestFactory(new CommonsClientHttpRequestFactory());
    String url = "https://mypretendservice.com/events";
    Event[] events = restTemplate.getForObject(url, Event[].class);
    If I could figure out the result classes used, this would be easy to create a utility set of POJO's to map from the API's you are providing.
    Thank You...Mick Knutson

    BLiNC Magazine Forums: "Everything you ever wanted to know about BASE-Jumping, but didn't know whom to ask."

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎