{"id":2958,"date":"2011-02-07T10:06:07","date_gmt":"2011-02-07T09:06:07","guid":{"rendered":"http:\/\/blog.jteam.nl\/?p=2958"},"modified":"2011-02-07T10:06:07","modified_gmt":"2011-02-07T09:06:07","slug":"creating-an-android-app-for-your-website-with-spring-android-and-rest","status":"publish","type":"post","link":"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/","title":{"rendered":"Creating an Android app for your website with Spring Android and REST"},"content":{"rendered":"<p>As Android is really hot at the moment (and I have an Android phone), I wanted to create an Android app for my website. In this blog post I will explain the changes I had to make on the part of my web application and how I used Spring Android to interact from Android to my web application.<\/p>\n<p><!--more--><\/p>\n<h2>Website<\/h2>\n<p>My website is just a simple Spring application with Spring MVC 3.0.5, JPA, Hibernate and MySQL. In order to create a REST api that is understandable for my Android app, I needed to add a little more configuration to the web application.<\/p>\n<h3>Spring Security<\/h3>\n<p>As I have Spring Security in place, I had to add a security rule for my REST api. If you really want to do it the right way, than make sure you use the <a href=\"http:\/\/oauth.net\/\" target=\"_blank\" rel=\"noopener\">OAuth<\/a> implementation as Spring Android also provides you to use OAuth in your Android app.<\/p>\n<p>But being a bit lazy I just configured the REST api to be public and therefor does not require any authentication. This is good for now.<\/p>\n<p>So in my security-context.xml I added the following rule:<\/p>\n<p><pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;br&gt;\n&lt;intercept-url access=&quot;hasRole('ROLE_ANONYMOUS')&quot; pattern=&quot;\/rest\/**&quot;&gt;&lt;br&gt;\n<\/pre><\/p>\n<p>As you can see I specified all the URL\u2019s that match on <span style=\"font-family: Courier New\">\/rest\/**<\/span> can be accessed without any authentication.<\/p>\n<h3>ContentNegotiatingViewResolver<\/h3>\n<p>Spring provides us with the <a href=\"http:\/\/static.springsource.org\/spring\/docs\/3.0.x\/javadoc-api\/org\/springframework\/web\/servlet\/view\/ContentNegotiatingViewResolver.html\" target=\"_blank\" rel=\"noopener\">ContentNegotiatingViewResolver<\/a>. This is an implementation of ViewResolver that resolves a view based on the file extension, parameter, or Accept header.<\/p>\n<p><pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;br&gt;\n    &lt;bean class=&quot;org.springframework.web.servlet.view.ContentNegotiatingViewResolver&quot;&gt;\n        &lt;property name=&quot;mediaTypes&quot;&gt;\n&lt;map&gt;\n                &lt;entry value=&quot;application\/json&quot; key=&quot;json&quot;&gt;&lt;br&gt;\n                &lt;entry value=&quot;text\/html&quot; key=&quot;html&quot;&gt;&lt;br&gt;\n            &lt;\/entry&gt;&lt;\/entry&gt;&lt;\/map&gt;\n&lt;\/property&gt;&lt;\/bean&gt;&lt;\/p&gt;&lt;p&gt;\n        &lt;property name=&quot;viewResolvers&quot;&gt;\n&lt;list&gt;\n                &lt;bean class=&quot;org.springframework.web.servlet.view.UrlBasedViewResolver&quot;&gt;\n                    &lt;property name=&quot;viewClass&quot; value=&quot;org.springframework.web.servlet.view.JstlView&quot;&gt;&lt;\/property&gt;\n                    &lt;property name=&quot;prefix&quot; value=&quot;\/WEB-INF\/jsp\/&quot;&gt;&lt;\/property&gt;\n                    &lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot;&gt;&lt;\/property&gt;\n                &lt;\/bean&gt;\n            &lt;\/list&gt;\n        &lt;\/property&gt;\n        &lt;property name=&quot;defaultViews&quot;&gt;\n&lt;list&gt;\n                &lt;bean class=&quot;org.springframework.web.servlet.view.json.MappingJacksonJsonView&quot;&gt;\n            &lt;\/bean&gt;&lt;\/list&gt;\n        &lt;\/property&gt;\n    &lt;br&gt;\n<\/pre><\/p>\n<p>As you can see in the code above, I have configured two <span style=\"font-family: Courier New\">mediaTypes<\/span>. The <span style=\"font-family: Courier New\">json<\/span> mediatype will be used by our Android app and the <span style=\"font-family: Courier New\">html<\/span> mediatype will be used by any browser.<\/p>\n<p>The <span style=\"font-family: Courier New\">defaultViews<\/span> property allows us to override the views provided by the view resolvers. Which is necessary in order resolve the correct view for JSON.<\/p>\n<h3>Converting data<\/h3>\n<p>Later on this post I will show how you can POST data to your controllers via Spring Android. To do this we need to configure the <span style=\"font-family: Courier New\"><a href=\"http:\/\/static.springsource.org\/spring\/docs\/3.0.x\/javadoc-api\/org\/springframework\/http\/converter\/json\/MappingJacksonHttpMessageConverter.html\" target=\"_blank\" rel=\"noopener\">MappingJacksonHttpMessageConverter<\/a><\/span> that allows us to convert data of&nbsp; the media type <span style=\"font-family: Courier New\">application\/json<\/span>.<\/p>\n<p><pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;br&gt;\n    &lt;bean class=&quot;org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter&quot;&gt;\n        &lt;property name=&quot;messageConverters&quot;&gt;\n&lt;list&gt;\n                &lt;ref bean=&quot;jsonConverter&quot;&gt;\n            &lt;\/ref&gt;&lt;\/list&gt;\n        &lt;\/property&gt;\n    &lt;\/bean&gt;&lt;\/p&gt;\n&lt;p&gt;    &lt;bean id=&quot;jsonConverter&quot; class=&quot;org.springframework.http.converter.json.MappingJacksonHttpMessageConverter&quot;&gt;\n        &lt;property name=&quot;supportedMediaTypes&quot; value=&quot;application\/json&quot;&gt;&lt;\/property&gt;\n    &lt;\/bean&gt;&lt;br&gt;\n<\/pre><\/p>\n<h3>Controller<\/h3>\n<p>Now that we have the ContentNegotiatingViewResolver in place, we can call any URL in our web application with the <span style=\"font-family: Courier New\">.json<\/span> extension and give you a JSON representation of your data. Let\u2019s take a look at an example of a Controller method.<\/p>\n<p><pre class=\"brush: java; title: ; notranslate\" title=\"\">&lt;br&gt;\n    @RequestMapping(&quot;\/rest\/matches\/played&quot;)&lt;br&gt;\n    public ModelAndView getAllPlayedMatches() {&lt;br&gt;\n        Competition competition = competitionService.findCompetitionByDescription(CURRENT_COMPETITION_DESCRIPTION);&lt;br&gt;\n        List&lt;match&gt; matches = matchService.getAllMatchesByCompetitionAndStatusDesc(competition, true);&lt;\/match&gt;&lt;\/p&gt;\n&lt;p&gt;        List&lt;matchdto&gt; matchesDto = getMatches(matches);&lt;\/matchdto&gt;&lt;\/p&gt;\n&lt;p&gt;        ModelAndView mav = new ModelAndView();&lt;br&gt;\n        mav.addObject(&quot;matches&quot;, matchesDto);&lt;br&gt;\n        return mav;&lt;br&gt;\n    }&lt;br&gt;\n<\/pre><\/p>\n<p>If I want to call this method via my browser, I can simple call \/rest\/matches\/played.json. This will simply work for all your request mappings. In this example I convert the list of matches to a list of matchDto objects. These objects contain less data, so that I don\u2019t send any unnecessary data to our Android app.<\/p>\n<p>The JSON output will look like this:<\/p>\n<p><pre class=\"brush: java; title: ; notranslate\" title=\"\">{&lt;br&gt;\n   &quot;matches&quot;: &#x5B;&lt;br&gt;\n    {&lt;br&gt;\n        &quot;id&quot;: 125,&lt;br&gt;\n        &quot;comment&quot;: &quot;Match nr 137667&quot;,&lt;br&gt;\n        &quot;date&quot;: &quot;2 february 2011 at 21:05&quot;,&lt;br&gt;\n        &quot;home_team&quot;: &quot;VVGA 2&quot;,&lt;br&gt;\n        &quot;away_team&quot;: &quot;Badhoevedorp 2&quot;,&lt;br&gt;\n        &quot;home_goals&quot;: 6,&lt;br&gt;\n        &quot;away_goals&quot;: 9,&lt;br&gt;\n        &quot;location&quot;: &quot;Zuid&quot;&lt;br&gt;\n    }, &lt;\/p&gt;\n&lt;p&gt;    {&lt;br&gt;\n        &quot;id&quot;: 124,&lt;br&gt;\n        &quot;comment&quot;: &quot;Match nr 137684&quot;,&lt;br&gt;\n        &quot;date&quot;: &quot;26 january 2011 at 20:15&quot;,&lt;br&gt;\n        &quot;home_team&quot;: &quot;DCG 7&quot;,&lt;br&gt;\n        &quot;away_team&quot;: &quot;VVGA 2&quot;,&lt;br&gt;\n        &quot;home_goals&quot;: 7,&lt;br&gt;\n        &quot;away_goals&quot;: 4,&lt;br&gt;\n        &quot;location&quot;: &quot;Zuid&quot;&lt;br&gt;\n    }&lt;br&gt;\n..&lt;br&gt;\n}&lt;br&gt;\n<\/pre><\/p>\n<p>Well that\u2019s basically it for the web application part. I have created separate controllers for my REST api, but you could easily reuse your existing controller if it contains all your data.<\/p>\n<h2>Android app<\/h2>\n<h3>Spring Android<\/h3>\n<p><a href=\"http:\/\/www.springsource.org\/spring-android\" target=\"_blank\" rel=\"noopener\">Spring Android<\/a> provides us with a <a href=\"http:\/\/static.springsource.org\/spring-android\/docs\/1.0.x\/reference\/html\/rest-template.html\" target=\"_blank\" rel=\"noopener\">Rest Client<\/a> and <a href=\"http:\/\/static.springsource.org\/spring-android\/docs\/1.0.x\/reference\/html\/commons-logging.html\" target=\"_blank\" rel=\"noopener\">Commons Logging<\/a> adapter for Android. I don\u2019t want to spend any time on how to set-up an Android project, as everyone prefers their own IDE. But it is clear that we need the Spring Android jars in our project.<\/p>\n<p>You can either <a href=\"http:\/\/www.springsource.com\/download\/community\" target=\"_blank\" rel=\"noopener\">download<\/a> them from the Spring Android site of you can use <a href=\"http:\/\/blog.springsource.com\/2010\/12\/17\/spring-android-and-maven-part-1\/\" target=\"_blank\" rel=\"noopener\">Maven<\/a> to include them into your project.<\/p>\n<h3>RestTemplate &#8211; GET<\/h3>\n<p>Retrieving data from our web application is really simple thanks to the RestTemplate.<\/p>\n<p><pre class=\"brush: java; title: ; notranslate\" title=\"\">&lt;br&gt;\npublic Matches getPlayedMatches() {&lt;br&gt;\n    RestTemplate restTemplate = new RestTemplate();&lt;br&gt;\n    restTemplate.setRequestFactory(new CommonsClientHttpRequestFactory());&lt;br&gt;\n    String url = BASE_URL + &quot;\/rest\/matches\/played.json&quot;;&lt;br&gt;\n    return restTemplate.getForObject(url, Matches.class);&lt;br&gt;\n}&lt;br&gt;\n<\/pre><\/p>\n<p>The code above uses the <span style=\"font-family: Courier New\">getForObject()<\/span> method to invoke the REST api from our web application and expects an object of the type <span style=\"font-family: Courier New\">Matches<\/span>. This object contains an array of <span style=\"font-family: Courier New\">Match<\/span> objects. The <span style=\"font-family: Courier New\">Match<\/span> object contains all fields that are present in the JSON output.<\/p>\n<h3>RestTemplate \u2013 POST<\/h3>\n<p>Posting data to our web application is as easy as retrieving data.<\/p>\n<p><pre class=\"brush: java; title: ; notranslate\" title=\"\">&lt;br&gt;\npublic boolean getUser(String username, String password) {&lt;br&gt;\n    String url = BASE_URL + &quot;\/rest\/login.json&quot;;&lt;\/p&gt;\n&lt;p&gt;    Credentials credentials = new Credentials(username, password);&lt;br&gt;\n    return restTemplate.postForObject(url, credentials, Boolean.class);&lt;br&gt;\n}&lt;br&gt;\n<\/pre><\/p>\n<p>You can just use the <span style=\"font-family: Courier New\">postForObject()<\/span> method to POST any object to your web application. In this example I post a <span style=\"font-family: Courier New\">Credentials<\/span> object which contains the username and password. This is not really secure, but fits it\u2019s purpose for now.<\/p>\n<h3>@RequestBody and @ResponseBody<\/h3>\n<p>One thing that I want to mention is the use of <span style=\"font-family: Courier New\">@RequestBody<\/span> and <span style=\"font-family: Courier New\">@ResponseBody<\/span> in a controller in the web application part. In my web application I have the exact same <span style=\"font-family: Courier New\">Credentials<\/span> object as in my Android app. This allows us to use the following controller code:<\/p>\n<p><pre class=\"brush: java; title: ; notranslate\" title=\"\">&lt;br&gt;\n@RequestMapping(value = &quot;\/rest\/login&quot;, method = RequestMethod.POST)&lt;br&gt;\npublic @ResponseBody boolean login(@RequestBody Credentials credentials) {&lt;br&gt;\n    String username = credentials.getUsername();&lt;br&gt;\n    String password = credentials.getPassword();&lt;\/p&gt;\n&lt;p&gt;    boolean isValidUser = \/\/ check if user exist.&lt;\/p&gt;\n&lt;p&gt;    return isValidUser;&lt;br&gt;\n}&lt;br&gt;\n<\/pre><\/p>\n<p>Because of the <span style=\"font-family: Courier New\">jsonConverter<\/span> we configured earlier, the object in the request is mapped to the <span style=\"font-family: Courier New\">Credentials<\/span> object in the web application.<\/p>\n<p>With <span style=\"font-family: Courier New\">@ResponseBody<\/span> I directly bind my method return value to the web response body. So there is no need for creating a model and as you could see in the corresponding Android part I can just expect a <span style=\"font-family: Courier New\">boolean<\/span> to be returned.<\/p>\n<h2>Next time<\/h2>\n<p>Now that we are able to communicate from an Android app to a web application and vice versa, it is time to create a great Android app. In my next blog post I will explain how I applied a few layout <a href=\"http:\/\/android-developers.blogspot.com\/2010\/05\/twitter-for-android-closer-look-at.html\" target=\"_blank\" rel=\"noopener\">patterns<\/a> and Android how I tackled a few of my problems during the development of my Android app.<\/p>\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/bit.ly\/3BAo305\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"256\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1024x256.png\" alt=\"\" class=\"wp-image-20303\" srcset=\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1024x256.png 1024w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-300x75.png 300w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-768x192.png 768w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1536x384.png 1536w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-2048x512.png 2048w, https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1920x480.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>As Android is really hot at the moment (and I have an Android phone), I wanted to create an Android app for my website. In this blog post I will explain the changes I had to make on the part of my web application and how I used Spring Android to interact from Android to [&hellip;]<\/p>\n","protected":false},"author":102,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[53,55,10],"tags":[25,227,70,228],"class_list":["post-2958","post","type-post","status-publish","format-standard","hentry","category-android","category-mobile","category-development","tag-android","tag-json","tag-spring","tag-spring-security"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating an Android app for your website with Spring Android and REST - Trifork Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating an Android app for your website with Spring Android and REST - Trifork Blog\" \/>\n<meta property=\"og:description\" content=\"As Android is really hot at the moment (and I have an Android phone), I wanted to create an Android app for my website. In this blog post I will explain the changes I had to make on the part of my web application and how I used Spring Android to interact from Android to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/\" \/>\n<meta property=\"og:site_name\" content=\"Trifork Blog\" \/>\n<meta property=\"article:published_time\" content=\"2011-02-07T09:06:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1024x256.png\" \/>\n<meta name=\"author\" content=\"Roberto van der Linden\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Roberto van der Linden\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/\",\"url\":\"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/\",\"name\":\"Creating an Android app for your website with Spring Android and REST - Trifork Blog\",\"isPartOf\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1024x256.png\",\"datePublished\":\"2011-02-07T09:06:07+00:00\",\"author\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/037974cf3e24a7b09a93770b190d6e35\"},\"breadcrumb\":{\"@id\":\"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/#primaryimage\",\"url\":\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1024x256.png\",\"contentUrl\":\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1024x256.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/trifork.nl\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating an Android app for your website with Spring Android and REST\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/trifork.nl\/blog\/#website\",\"url\":\"https:\/\/trifork.nl\/blog\/\",\"name\":\"Trifork Blog\",\"description\":\"Keep updated on the technical solutions Trifork is working on!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/trifork.nl\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/037974cf3e24a7b09a93770b190d6e35\",\"name\":\"Roberto van der Linden\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/afe49faf7ef8dd3753baefb334568b10?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/afe49faf7ef8dd3753baefb334568b10?s=96&d=mm&r=g\",\"caption\":\"Roberto van der Linden\"},\"url\":\"https:\/\/trifork.nl\/blog\/author\/roberto\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating an Android app for your website with Spring Android and REST - Trifork Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/","og_locale":"en_US","og_type":"article","og_title":"Creating an Android app for your website with Spring Android and REST - Trifork Blog","og_description":"As Android is really hot at the moment (and I have an Android phone), I wanted to create an Android app for my website. In this blog post I will explain the changes I had to make on the part of my web application and how I used Spring Android to interact from Android to [&hellip;]","og_url":"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/","og_site_name":"Trifork Blog","article_published_time":"2011-02-07T09:06:07+00:00","og_image":[{"url":"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1024x256.png","type":"","width":"","height":""}],"author":"Roberto van der Linden","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Roberto van der Linden","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/","url":"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/","name":"Creating an Android app for your website with Spring Android and REST - Trifork Blog","isPartOf":{"@id":"https:\/\/trifork.nl\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/#primaryimage"},"image":{"@id":"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/#primaryimage"},"thumbnailUrl":"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1024x256.png","datePublished":"2011-02-07T09:06:07+00:00","author":{"@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/037974cf3e24a7b09a93770b190d6e35"},"breadcrumb":{"@id":"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/#primaryimage","url":"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1024x256.png","contentUrl":"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2022\/02\/Blog-Banner-1-1024x256.png"},{"@type":"BreadcrumbList","@id":"https:\/\/trifork.nl\/blog\/creating-an-android-app-for-your-website-with-spring-android-and-rest\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/trifork.nl\/blog\/"},{"@type":"ListItem","position":2,"name":"Creating an Android app for your website with Spring Android and REST"}]},{"@type":"WebSite","@id":"https:\/\/trifork.nl\/blog\/#website","url":"https:\/\/trifork.nl\/blog\/","name":"Trifork Blog","description":"Keep updated on the technical solutions Trifork is working on!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/trifork.nl\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/037974cf3e24a7b09a93770b190d6e35","name":"Roberto van der Linden","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/afe49faf7ef8dd3753baefb334568b10?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/afe49faf7ef8dd3753baefb334568b10?s=96&d=mm&r=g","caption":"Roberto van der Linden"},"url":"https:\/\/trifork.nl\/blog\/author\/roberto\/"}]}},"_links":{"self":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/2958","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/users\/102"}],"replies":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/comments?post=2958"}],"version-history":[{"count":0,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/2958\/revisions"}],"wp:attachment":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/media?parent=2958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/categories?post=2958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/tags?post=2958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}