Skip to main content

Posts

Showing posts with the label jackson tutorial
Calling a rest service with spring rest + json jackson Presenting to you step by step a tutorial about the use of some apis that leverage the logic for calling to a rest service and also the json parting and marshalling process First Step Importing required libs: You will need to import spring for droid there are the files: spring-android-auth-1.0.0.M4.jar spring-android-core-1.0.0.M4.jar spring-android-rest-template-1.0.0.M4.jar You will need to import jackson lib there is the file: jackson-all-1.9.4.jar Second Step : Declaring variables You will need these three variables to do the trick. I will recomend to declare them as fields and instantiate them later on class constructor. RestTemplate restTemplate = new RestTemplate(); ObjectMapper objectMapper = new ObjectMapper(); JsonFactory jsonFactory = new JsonFactory(); Third step: Calling rest service: Just call this method of rest template and the api will call the service and will encapsulate all the stream st...