CINXE.COM
SINETStream | SINETStream
<!DOCTYPE html> <html lang="en-US"> <head> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-169261303-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-169261303-1'); </script> <meta charset="UTF-8"> <!-- Begin Jekyll SEO tag v2.8.0 --> <title>SINETStream | SINETStream</title> <meta name="generator" content="Jekyll v3.10.0" /> <meta property="og:title" content="SINETStream" /> <meta property="og:locale" content="en_US" /> <meta name="description" content="SINETStream" /> <meta property="og:description" content="SINETStream" /> <link rel="canonical" href="https://www.sinetstream.net/docs/tutorial-android/index.en.html" /> <meta property="og:url" content="https://www.sinetstream.net/docs/tutorial-android/index.en.html" /> <meta property="og:site_name" content="SINETStream" /> <meta property="og:type" content="website" /> <meta name="twitter:card" content="summary" /> <meta property="twitter:title" content="SINETStream" /> <script type="application/ld+json"> {"@context":"https://schema.org","@type":"WebPage","description":"SINETStream","headline":"SINETStream","url":"https://www.sinetstream.net/docs/tutorial-android/index.en.html"}</script> <!-- End Jekyll SEO tag --> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="theme-color" content="#157878"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <link rel="stylesheet" href="/assets/css/style.css?v=d6f0b877a2074d7508e6b1d390a965b3d937c724"> </head> <body> <header class="page-header" role="banner"> <h1 class="project-name"><a href="/">SINETStream</a></h1> <h2 class="project-tagline">SINETStream</h2> </header> <main id="content" class="main-content" role="main"> <!-- Copyright (C) 2020-2021 National Institute of Informatics Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <p><a href="/docs/tutorial-android/">日本語</a></p> <h1 id="quick-start-guide-android">Quick Start Guide (Android)</h1> <p><em>Table of contents</em></p> <pre> 1. Introduction 2. Operation environment 3. Prerequisites 3.1 Android client 3.2 Back-end system 3.3 Observatory PC (applicable only for the `STEP2` shown below) 4. Run tutorial scenarios </pre> <h2 id="1-introduction">1. Introduction</h2> <p>The generalized form of system components, which is depicted in the <code class="language-plaintext highlighter-rouge">Quick Start Guide (Python/Java)</code> looks like as follows.</p> <p><img src="/docs/tutorial-android/images/common/network_model.png" alt="Network Model" /></p> <p>Note that <code class="language-plaintext highlighter-rouge">Writer</code> and <code class="language-plaintext highlighter-rouge">Reader</code> functionalities on client side can be Android version, Linux version or the mix of them. In this tutorial, we focus on cases in which Android application works as both <code class="language-plaintext highlighter-rouge">Writer</code> and <code class="language-plaintext highlighter-rouge">Reader</code>, or either of them.</p> <h2 id="2-operation-environment">2. Operation environment</h2> <p>Just like the tutorials for Python/Java version, we setup <code class="language-plaintext highlighter-rouge">Broker</code> functionality on a <code class="language-plaintext highlighter-rouge">Docker</code> container, which is a virtual running environment for applications. For this purpose, you will take following steps; 1) install the <code class="language-plaintext highlighter-rouge">Docker Engine</code> on a host machine, 2) download and run the <code class="language-plaintext highlighter-rouge">Docker</code> container prepared for this tutorial.</p> <p>On the other hand, install our sample Android application on your Android device so that it work as <code class="language-plaintext highlighter-rouge">Writer</code> or <code class="language-plaintext highlighter-rouge">Reader</code>. Once you have set proper running parameters, the Android application can co-operate with the <code class="language-plaintext highlighter-rouge">Broker</code>.</p> <p><img src="/docs/tutorial-android/images/common/docker_configuration.png" alt="Docker Configuration" /></p> <p>In short, there are several steps to build the operation environment for this tutorial. You need to prepare the back-end system, install the client application on your Android device, and set connection parameters for the two of them. Detailed work procedures will be shown on latter parts.</p> <h2 id="3-prerequisites">3. Prerequisites</h2> <p>Following conditions must be fulfilled to run this tutorial.</p> <h3 id="31-android-client">3.1 Android client</h3> <ul> <li>The Android device must be IP reachable with the back-end system. <ul> <li>Example#1) An Android device with SINET SIM connects to the back-end system. <blockquote> <p>This is a connection model that the Android device connects to the <code class="language-plaintext highlighter-rouge">Broker</code> via cellular network.</p> </blockquote> </li> <li>Example#2) An Android device connects to the host running the <code class="language-plaintext highlighter-rouge">Broker</code> via LAN. <blockquote> <p>This is a connection model that the back-end system is built on your desktop PC.</p> </blockquote> </li> </ul> </li> </ul> <h3 id="32-back-end-system">3.2 Back-end system</h3> <ul> <li>The host running <code class="language-plaintext highlighter-rouge">Broker</code> must be Internet reachable. <ul> <li>The host downloads the target container image from our container repository.</li> </ul> </li> <li>A <code class="language-plaintext highlighter-rouge">Docker Engine</code> must have installed on the host which runs <code class="language-plaintext highlighter-rouge">Broker</code>. <ul> <li>The <code class="language-plaintext highlighter-rouge">Docker Engine</code> is the platform for a container image.</li> <li>As an example, we use a commercial cloud service <code class="language-plaintext highlighter-rouge">Amazon AWS</code> as our platform.</li> <li>We also show how to install <code class="language-plaintext highlighter-rouge">Docker Engine</code> on a desktop PC, as an casual test environment.</li> </ul> </li> </ul> <h3 id="33-observatory-pc-applicable-only-for-the-step2-shown-below">3.3 Observatory PC (applicable only for the <code class="language-plaintext highlighter-rouge">STEP2</code> shown below)</h3> <ul> <li>The observatory PC must be able to connect to the back-end system by HTTP. <ul> <li>Beware routing and firewall settings for the connectivity.</li> </ul> </li> <li>The observatory PC must be INTERNET reachable. <ul> <li>Some of element parts displayed on the web screen will be fetched from open server.</li> </ul> </li> </ul> <h2 id="4-run-tutorial-scenarios">4. Run tutorial scenarios</h2> <p>To show sample usages of <a href="https://translate.google.com/translate?hl=en&sl=ja&tl=en&u=https://nii-gakunin-cloud.github.io/sinetstream/docs/tutorial-android/../userguide/android.html">SINETStream for Android</a>, we provide two scenarios below.</p> <ul> <li><a href="/docs/tutorial-android/TUTORIAL-android-step1-overview.en.html">STEP1: Send and receive text messages (sinetstream-android-echo)</a> <ul> <li>Send a GUI input text to the peer <code class="language-plaintext highlighter-rouge">Broker</code>, then receive it.</li> </ul> </li> <li><a href="/docs/tutorial-android/TUTORIAL-android-step2-overview.en.html">STEP2: Publish sensor readout values (sinetstream-android-sensor-publisher)</a> <ul> <li>Send sensor readout values collected on the Android to the peer <code class="language-plaintext highlighter-rouge">Broker</code>.</li> <li>The back-end system behind the <code class="language-plaintext highlighter-rouge">Broker</code> stores the sensor readout values to the database.</li> <li>A web browser on an observatory PC shows the graph image of sensor readout values.</li> </ul> </li> </ul> <p>Detailed procedures are shown in the links above. Both two of steps are independent, and thus you can try one of them only, or run each of them sequentially.</p> <blockquote> <p><strong>NOTE</strong>:</p> <p>If you are going to run above two samples sequentially, try STEP2 first for smooth operations.</p> <p>In STEP1, the <code class="language-plaintext highlighter-rouge">Broker</code> can be anything. But in STEP2, the dedicated container image must be used so that the back-end system to couple with the <code class="language-plaintext highlighter-rouge">Broker</code> for sequential processing. That is, if you run STEP2 first and leave the container image running, you can reuse the <code class="language-plaintext highlighter-rouge">Broker</code> as is in STEP1.</p> <p>Of course, you can use the <code class="language-plaintext highlighter-rouge">Broker</code>, which is in the tutorial container for the Python/Java version, as the back-end system of STEP1. In this case, beware not to forget to replace container image before running STEP2.</p> </blockquote> <footer class="site-footer"> <span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</span> </footer> </main> </body> </html>