English

SINETStreamHelper ユーザガイド(端末位置情報の追跡部)

目次

1. モジュール構成
2. API概要
3. インタフェース LocationTrackerListener
3.1 メソッド概要
3.2 メソッド詳細
3.2.1 onLocationSettingsChecked
3.2.2 onLocationEngaged
3.2.3 onLocationDisengaged
3.2.4 onLocationDataReceived
3.2.5 onError
4. クラスLocationTracker
4.1 コンストラクタ概要
4.2 メソッド概要
4.3 コンストラクタ詳細
4.4 メソッド詳細
4.4.1 start
4.4.2 stop
4.4.3 bindLocationService
4.4.4 unbindLocationService

付録
A.1 ライフサイクル

1. モジュール構成

SINETStreamHelperライブラリにおける「Android端末位置の追跡取得」機能のモジュール構成を以下に示す。

      #-------------------------------------------------------+
      |                User Application                       |
      +-------------------------------------------------------+
                         |                             A
    =====================|=============================|== API functions
                         |                             |
      +------------------|-----------------------------|------+
      |                  V                             | [Location]
      | +----------------------------------+     +----------+ |
      | | LocationTracker                  |---> | Location | |
      | |       +----------+  +----------+ |     | Tracker  | |
      | |       |Permission|  |Settings  | |     | Listener | |
      | |       |Handler   |  |Handler   | |     +----------+ |
      | |       +----------+  +----------+ |                  |
      | +----------------------------------+                  |
      |      |  A                   |  A                      |
      |      V  | [Location]        V  | [Location]           |
      | +----------------+     +----------------+             |
      | | GpsService     |     | FlpService     |             |
      | +----------------+     +----------------+             |
      |      |  A                   |  A                      |
      |      |  |                   |  |    SINETStreamHelper |
      |      |  |                   |  |    (Location Handler)|
      +------|--|-------------------|--|----------------------+
             |  |                   |  |
    =========|==|===================|==|================= Android System
             |  |                   V  |
             |  |                ..............................
             V  | [Location]     : Google Play Service        :
        +------------+           : +------------------------+ :
        | Location   |        +--->| Fused                  | :
        | Manager    |        |  : | LocationProviderClient | :
        +------------+        |  : +------------------------+ :
             |  A             |  :     A       A       A      :
             |  |             |  :.....|.......|.......|......:
    =========|==|=============|========|=======|=======|======== Devices
             |  |             |        |       |       |
             V  | [Raw Data]  |        |       |       | [Raw Data]
         +----------+         |     +-----+ +----+ +-------+
         |   GPS    |---------+     | NET | | BT | |  ...  |
         +----------+               +-----+ +----+ +-------+

〈凡例〉

2. API概要

3. インタフェース LocationTrackerListener

3.1 メソッド概要

3.2 メソッド詳細

3.2.1 onLocationSettingsChecked

void onLocationSettingsChecked(boolean isReady)

3.2.2 onLocationEngaged

void onLocationEngaged(@NonNull
                       java.lang.String info)

3.2.3 onLocationDisengaged

void onLocationDisengaged(@NonNull
                          java.lang.String info)

3.2.4 onLocationDataReceived

void onLocationDataReceived(@NonNull
                            android.location.Location location)

3.2.5 onError

void onError(@NonNull
             java.lang.String errmsg)

4. クラスLocationTracker

4.1 コンストラクタ概要

4.2 メソッド概要

4.3 コンストラクタ詳細

public LocationTracker(@NonNull
                       androidx.appcompat.app.AppCompatActivity activity,
                       @NonNull
                       final String locationProviderName,
                       int clientId)

4.4 メソッド詳細

4.4.1 start

public void start()

4.4.2 stop

public void stop()

4.4.3 bindLocationService

public void bindLocationService()

4.4.4 unbindLocationService

public void unbindLocationService()

付録

A.1 ライフサイクル

            ( constructor )
                  |
    +-----------> |
    |             |
    |             V
    |           start()
    |             |
    |             |-----> onLocationSettingsChecked(true)
    |    +------> |
    |    |        V
    |    |   bindLocationService()
    |    |        |
    |    |        |-----> onLocationEngaged()
    |    |        |
    |    |        |-----> onLocationDataReceived()
    //   //       //           :
    |    |        |-----> onLocationDataReceived()
    |    |        V
    |    |   unbindLocationService()
    |    |        |
    |    |        |-----> onLocationDisengaged()
    |    +-------<>
    |             |
    |             V
    |           stop()
    |             |
    +------------<>
                  |
                  V