{"id":4053,"date":"2018-02-05T11:00:32","date_gmt":"2018-02-05T05:30:32","guid":{"rendered":"https:\/\/www.innovationm.com\/blog\/?p=4053"},"modified":"2023-01-20T18:55:48","modified_gmt":"2023-01-20T13:25:48","slug":"ensure-google-play-services-apk-is-updated","status":"publish","type":"post","link":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/","title":{"rendered":"Ensure Google Play Services APK is updated"},"content":{"rendered":"<p>If your app is using any Google API in your project, then you need to make sure that your device has Google Play Services APK updated.<\/p>\n<p>Firstly, you have to decide the accurate position where you need to insert the code to update Google Play Services.<\/p>\n<p>If your app is entirely based on Google Play Services, then you can do this at the time your app launches initially. However, if only a part of your app uses Google Play Services, then you should do it whenever user needs to access that part of your app.<\/p>\n<p>Now there are two ways to check availability of Google Play Services :<\/p>\n<ol>\n<li>Using\u00a0GooglePlayServicesUtil<\/li>\n<\/ol>\n<pre class=\"\">int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());\r\n\r\nif(status != ConnectionResult.SUCCESS)\r\n{\r\n        if(status == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED)\r\n        {\r\n            Toast.makeText(context,\"Please udpate your google play services\",Toast.LENGTH_SHORT).show();\r\n        }\r\n}<\/pre>\n<p>But the problem with this approach is that some methods and fields of\u00a0GooglePlayServicesUtil have been deprecated.<\/p>\n<p>So, the second and better approach (which google also recommends) is<\/p>\n<p>2. Using GoogleApiAvailability<\/p>\n<pre class=\"\">GoogleApiAvailability googleAPI = GoogleApiAvailability.getInstance();\r\n\r\nint result = googleAPI.isGooglePlayServicesAvailable(activity);\r\n\r\nif(result != ConnectionResult.SUCCESS)\r\n{\r\n   if (googleAPI.isUserResolvableError(result)) \r\n   {\r\n      googleAPI.getErrorDialog(activity, result, AppConstant.PLAY_SERVICES_RESOLUTION_REQUEST).show();\r\n   }\r\n}<\/pre>\n<p>This will show you a Dialog containing an appropriate message about the error occured and the required action that will take you to play store to install or update Google Play Services.<\/p>\n<p>Finally, your device will have Google Play Services up-to-date!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If your app is using any Google API in your project, then you need to make sure that your device has Google Play Services APK updated. Firstly, you have to decide the accurate position where you need to insert the code to update Google Play Services. If your app is entirely based on Google Play [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4115,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,71],"tags":[242],"class_list":["post-4053","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","category-mobile","tag-google-play-services-apk"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ensure Google Play Services APK is updated - InnovationM - 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:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ensure Google Play Services APK is updated - InnovationM - Blog\" \/>\n<meta property=\"og:description\" content=\"If your app is using any Google API in your project, then you need to make sure that your device has Google Play Services APK updated. Firstly, you have to decide the accurate position where you need to insert the code to update Google Play Services. If your app is entirely based on Google Play [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/\" \/>\n<meta property=\"og:site_name\" content=\"InnovationM - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-05T05:30:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-20T13:25:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2018\/01\/Anuj_Blog_image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"525\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InnovationM Admin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InnovationM Admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/\"},\"author\":{\"name\":\"InnovationM Admin\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"headline\":\"Ensure Google Play Services APK is updated\",\"datePublished\":\"2018-02-05T05:30:32+00:00\",\"dateModified\":\"2023-01-20T13:25:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/\"},\"wordCount\":187,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/01\\\/Anuj_Blog_image.png\",\"keywords\":[\"Google Play Services APK\"],\"articleSection\":[\"Android\",\"Mobile\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/\",\"name\":\"Ensure Google Play Services APK is updated - InnovationM - Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/01\\\/Anuj_Blog_image.png\",\"datePublished\":\"2018-02-05T05:30:32+00:00\",\"dateModified\":\"2023-01-20T13:25:48+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/01\\\/Anuj_Blog_image.png\",\"contentUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/01\\\/Anuj_Blog_image.png\",\"width\":700,\"height\":525},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/ensure-google-play-services-apk-is-updated\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ensure Google Play Services APK is updated\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\",\"name\":\"InnovationM - Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\",\"name\":\"InnovationM Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"caption\":\"InnovationM Admin\"},\"sameAs\":[\"http:\\\/\\\/www.innovationm.com\\\/\"],\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/author\\\/innovationmadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ensure Google Play Services APK is updated - InnovationM - 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:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/","og_locale":"en_US","og_type":"article","og_title":"Ensure Google Play Services APK is updated - InnovationM - Blog","og_description":"If your app is using any Google API in your project, then you need to make sure that your device has Google Play Services APK updated. Firstly, you have to decide the accurate position where you need to insert the code to update Google Play Services. If your app is entirely based on Google Play [&hellip;]","og_url":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/","og_site_name":"InnovationM - Blog","article_published_time":"2018-02-05T05:30:32+00:00","article_modified_time":"2023-01-20T13:25:48+00:00","og_image":[{"width":700,"height":525,"url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2018\/01\/Anuj_Blog_image.png","type":"image\/png"}],"author":"InnovationM Admin","twitter_misc":{"Written by":"InnovationM Admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/#article","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/"},"author":{"name":"InnovationM Admin","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"headline":"Ensure Google Play Services APK is updated","datePublished":"2018-02-05T05:30:32+00:00","dateModified":"2023-01-20T13:25:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/"},"wordCount":187,"commentCount":0,"image":{"@id":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2018\/01\/Anuj_Blog_image.png","keywords":["Google Play Services APK"],"articleSection":["Android","Mobile"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/","url":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/","name":"Ensure Google Play Services APK is updated - InnovationM - Blog","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/#primaryimage"},"image":{"@id":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2018\/01\/Anuj_Blog_image.png","datePublished":"2018-02-05T05:30:32+00:00","dateModified":"2023-01-20T13:25:48+00:00","author":{"@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"breadcrumb":{"@id":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/#primaryimage","url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2018\/01\/Anuj_Blog_image.png","contentUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2018\/01\/Anuj_Blog_image.png","width":700,"height":525},{"@type":"BreadcrumbList","@id":"https:\/\/www.innovationm.com\/blog\/ensure-google-play-services-apk-is-updated\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.innovationm.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Ensure Google Play Services APK is updated"}]},{"@type":"WebSite","@id":"https:\/\/www.innovationm.com\/blog\/#website","url":"https:\/\/www.innovationm.com\/blog\/","name":"InnovationM - Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.innovationm.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed","name":"InnovationM Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","caption":"InnovationM Admin"},"sameAs":["http:\/\/www.innovationm.com\/"],"url":"https:\/\/www.innovationm.com\/blog\/author\/innovationmadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/4053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/comments?post=4053"}],"version-history":[{"count":0,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/4053\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media\/4115"}],"wp:attachment":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media?parent=4053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/categories?post=4053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/tags?post=4053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}