{"id":875,"date":"2020-03-24T16:41:11","date_gmt":"2020-03-24T16:41:11","guid":{"rendered":"https:\/\/dev.i-smartcloud.com\/?page_id=875"},"modified":"2020-03-24T16:41:11","modified_gmt":"2020-03-24T16:41:11","slug":"serviceitem-android","status":"publish","type":"page","link":"https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/","title":{"rendered":"ServiceItem"},"content":{"rendered":"\n<p>This is the most important class in the Rainbow SDK, as it holds all the information that is needed for an account. From that class, and that class only, we can create an instance of the Cloud Manager.<\/p>\n\n\n\n<p>We can create an instance of that class by calling the default constructor:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RServiceItem rServiceItem = new RServiceItem();<\/code><\/pre>\n\n\n\n<p>But, we shouldn&#8217;t call this method, unless we have all the variables that are needed to properly use it. Instead, we should get the entries that  are stored in the <strong>connectedList<\/strong> variable of the corresponding <a href=\"https:\/\/dev.i-smartcloud.com\/index.php\/service-android\/\">Service<\/a> instance. <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>You should never create an instance of the RServiceItem class. This is a generic class, that has code that is used by the super-classes.<\/p><\/blockquote>\n\n\n\n<p>This class has two properties:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>name<\/strong>[String]: The name of the account. The Rainbow SDK sets the value of the <a href=\"https:\/\/dev.i-smartcloud.com\/index.php\/api-android\/\">rAPI<\/a>.name to that value<\/li><li><strong>iD<\/strong>[String]: It is a guid and it used to distinguish them. Thus, you can create as many instances of that class with the same name<\/li><\/ul>\n\n\n\n<p>The ServiceItems for OAuth2 Login have a few more properties:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>oauthAccessToken<\/strong>[String]: The Access Token<\/li><li><strong>oauthRefreshToken<\/strong>[String]: The Refresh Token<\/li><li><strong>oauthExpirationDate<\/strong>[Date]: The Expiration Date<\/li><\/ul>\n\n\n\n<p>The above values are set by the instance of the <a href=\"https:\/\/dev.i-smartcloud.com\/index.php\/api-android\/\">API<\/a> class, and except the Access Token, the other two variable may be an empty string.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>The MediaFireServiceItem class has the properties: sessionToken, pkey, and time. The RSugarSyncServiceItem class has the properties: sugarSyncAccessTokenLocation, sugarSyncRefreshTokenLocation, and sugarSyncActivationDate. The RIDriveServiceItem class has the properties: userID, password, and baseURL<\/p><\/blockquote>\n\n\n\n<p>The ServiceItem class has one method to check and refresh the Access token. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rServiceItem.checkStatus();<\/code><\/pre>\n\n\n\n<p>That method calls the <strong>onStatusChecked<\/strong>(boolean status) method of the <strong>ServiceCallback<\/strong> callback to inform you about the status.  You shouldn&#8217;t have to call that method. The Rainbow SDK is regularly calling it to validate the Access Token (whenever that is needed).<\/p>\n\n\n\n<p>Finally, the ServiceItem class is both Parceable and Serializable<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the most important class in the Rainbow SDK, as it holds all the information that is needed for an account. From that class, and that class only, we&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-875","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ServiceItem - Rainbow SDK<\/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:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ServiceItem - Rainbow SDK\" \/>\n<meta property=\"og:description\" content=\"This is the most important class in the Rainbow SDK, as it holds all the information that is needed for an account. From that class, and that class only, we...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/\" \/>\n<meta property=\"og:site_name\" content=\"Rainbow SDK\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/\",\"url\":\"https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/\",\"name\":\"ServiceItem - Rainbow SDK\",\"isPartOf\":{\"@id\":\"https:\/\/dev.i-smartcloud.com\/#website\"},\"datePublished\":\"2020-03-24T16:41:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dev.i-smartcloud.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ServiceItem\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dev.i-smartcloud.com\/#website\",\"url\":\"https:\/\/dev.i-smartcloud.com\/\",\"name\":\"Rainbow SDK\",\"description\":\"The Rainbow Cloud Manager at your disposal\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dev.i-smartcloud.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ServiceItem - Rainbow SDK","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:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/","og_locale":"en_US","og_type":"article","og_title":"ServiceItem - Rainbow SDK","og_description":"This is the most important class in the Rainbow SDK, as it holds all the information that is needed for an account. From that class, and that class only, we...","og_url":"https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/","og_site_name":"Rainbow SDK","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/","url":"https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/","name":"ServiceItem - Rainbow SDK","isPartOf":{"@id":"https:\/\/dev.i-smartcloud.com\/#website"},"datePublished":"2020-03-24T16:41:11+00:00","breadcrumb":{"@id":"https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/dev.i-smartcloud.com\/index.php\/serviceitem-android\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dev.i-smartcloud.com\/"},{"@type":"ListItem","position":2,"name":"ServiceItem"}]},{"@type":"WebSite","@id":"https:\/\/dev.i-smartcloud.com\/#website","url":"https:\/\/dev.i-smartcloud.com\/","name":"Rainbow SDK","description":"The Rainbow Cloud Manager at your disposal","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dev.i-smartcloud.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/dev.i-smartcloud.com\/index.php\/wp-json\/wp\/v2\/pages\/875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.i-smartcloud.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dev.i-smartcloud.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dev.i-smartcloud.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.i-smartcloud.com\/index.php\/wp-json\/wp\/v2\/comments?post=875"}],"version-history":[{"count":5,"href":"https:\/\/dev.i-smartcloud.com\/index.php\/wp-json\/wp\/v2\/pages\/875\/revisions"}],"predecessor-version":[{"id":881,"href":"https:\/\/dev.i-smartcloud.com\/index.php\/wp-json\/wp\/v2\/pages\/875\/revisions\/881"}],"wp:attachment":[{"href":"https:\/\/dev.i-smartcloud.com\/index.php\/wp-json\/wp\/v2\/media?parent=875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}