# How to Use?
<p>[TOC]</p>
<h1>1. New a Project</h1>
<ul>
<li>Create a Flutter Plugin project using Android Studio or other development tools.</li>
</ul>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=01627f77e89bea7b36f6dc304fa47f5f&amp;file=file.png" alt="" /></p>
<h1>2. Include 3rd-Party Libraries</h1>
<h2>iOS</h2>
<ul>
<li>Import the SDK and .h file into the "flutter_tunnel.podspec",and copy it to the corresponding folder directory.</li>
</ul>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=78df574c1d671a199093d129c3b7910a&amp;file=file.png" alt="" /></p>
<p>> Note: When compiling, it is necessary to include the "libz.tbd" library in the ".xcodeproject".</p>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=e9a58cdbfee60257b6058398b169e565&amp;file=file.png" alt="" /></p>
<h2>Android</h2>
<ul>
<li>Import the SDK file into the "build.gradle" file and copy it to the corresponding folder directory.</li>
</ul>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=2aa7a14929af2d0a3fa69a5eb746edb7&amp;file=file.png" alt="" /></p>
<h1>3. Development</h1>
<ul>
<li>The "flutter_tunnel.dart" file contains calls to implement Tunnel related APIs, and the UI layer can call methods of this calss.</li>
</ul>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=8ba58de3b62bad38786f698394528213&amp;file=file.png" alt="" /></p>
<ul>
<li>In the local Flutter project, import flutter_tunnel plugin</li>
</ul>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=f0ca51ff6fb8a7285596c8aa2bf4db24&amp;file=file.png" alt="" /></p>
<h1>4. How to demo?</h1>
<h2>Demo Installation</h2>
<p></p>
<h3>IOS Installation Guide</h3>
<ul>
<li>System requirements: IOS 10.0 and above.</li>
<li>
<p>Method One:
a. Use the mobile phone system scanning tool (wechat or Alipay scanning is not supported for now);
b. Scan the QR code above to get the download link address;
c. The mobile phone can automatically identify the download address and pop up an installation prompt dialog box;
d. Click "Install" and wait for the app installation to complete.</p>
</li>
<li>
<p>Method Two:
a. Use a third-party code scanning tool (wechat or Alipay scanning is not supported for now);
b. Scan the QR code above to get the download link address;
c. Click the link, or paste the download link address into the Safari browser and go, a prompt pops up: "Open the link in 'iTunes'?"
d. Click "Open", and the installation prompt dialog box will pop up;
e. Click "Install" and wait for the app installation to complete.</p>
</li>
<li>When starting the app for the first time, if you encounter the prompt "Untrusted Enterprise Developer", please do the following:
a. Enter the mobile phone system settings, click "General";
b. Find “Device Management” and check it, click “Throughtek Co., Ltd.”;
c. After clicking Trust “Throughtek Co., Ltd.”, restart the application.</li>
</ul>
<hr />
<h3>Android Installation Guide</h3>
<ul>
<li>System requirements: Android 7.0 and above.
a. Use browser scanning tools, or third-party scanning tools (wechat or Alipay scanning is not supported for now);
b. Scan the QR code above to get the download link address;
c. Click the link, or paste the download link address into the browser and open it;
d. After clicking "Download", enter the browser download interface to check the progress and wait for the download to complete;
e. Click "Install" and complete the installation steps according to the operation of the mobile phone.</li>
</ul>
<p>> Note: The detailed operation steps are still subject to the behavior of the third-party scanning tool/browser/mobile phone system actually used, and the above is only for reference.</p>
<h2>Call API Steps</h2>
<ul>
<li>Step1. Call TK_initSDK Success(return code 0);</li>
<li>Step2. Call TK_tunnelConnect Success(return code 0);</li>
<li>Step3. Call TK_startPortMapping Success(return code 0);</li>
<li>Step4. Make Sure the ip:localport setting in the sample code,and try to copy the url(such as <a href="http://127.0.0.1:10000/nas">http://127.0.0.1:10000/nas</a> ) to the browser,data access successful;</li>
<li>Step5. Call TK_stopPortMapping(return code 0) to exit port mapping setting;</li>
<li>Step6. Call TK_disconnectTunnel(return code 0) to exit the tunnel connection;</li>
<li>Step7. Call TK_unInitThunnel(return code 0) to uninitial IOTC Module;</li>
</ul>
<p>> Note: If return error code when call api, your can refer the readme file in standard SDK to check the abnormal situation.</p>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=725fb7534adcae20a8a7b1c9d7e2010b&amp;file=file.png" alt="" /></p>
<h1>5. Note</h1>
<ul>
<li>Flutter Compilation Environment</li>
<li>Flutter 2.10.1</li>
<li>Tools • Dart 2.16.1 • DevTools 2.9.2</li>
</ul>