Skip to content

temi Center

Lance Gao edited this page Aug 27, 2020 · 38 revisions

Overview

The features here need to be configured in the temi Center before they can be used.

API Overview

Return Method Description
void startFaceRecognition() Start face recognition
void stopFaceRecognition() Stop face recognition
List<SequenceModel> getAllSequences() Get all sequences
void playSequence(String sequenceId) Play specific sequence by sequenceId
InputStream getInputStreamByMediaKey(ContentType contentType, String mediaKey) Obtain the input stream of the file by contentType and mediaKey (currently only used to obtain the contact photo for face recognition)
Interface Description
OnSequencePlayStatusChangedListener Sequence status changed listener
OnFaceRecognizedListener Face recognition listener
Models Description
ContactModel Contact data
SequenceModel Seqeunce data
ContentType Content type

Methods

startFaceRecognition()

Use this method to start temi's face recognition and send the face data back to the callback method of OnFaceRecognizedListener.

  • Prototype

    void startFaceRecognition();
  • Required permissions

    Selected Kiosk, Face Recognition

  • Support from

    0.10.70


stopFaceRecognition()

Use this method to stop the face recognition.

  • Prototype

    void stopFaceRecognition();
  • Required permissions

    Selected Kiosk, Face Recognition

  • Support from

    0.10.70


getAllSequences()

Use this method to get all the sequences that configured on temi Center.

  • Return

    Type Description
    List<SequenceModel> All seqeunces list
  • Prototype

    List<SequenceModel> stopFaceRecognition();
  • Required permissions

    Selected Kiosk, Face Recognition

  • Support from

    0.10.70

  • Note

    This method is a time-consuming operation and is recommended to be used in a non-main thread.


playSequence()

Use this method to play a specific sequence.

  • Parameters

    Parameter Type Description
    sequenceId String ID of the sequence
  • Prototype

    void playSequence(String sequenceId);
  • Required permissions

    Sequence

  • Support from

    0.10.70

getInputStreamByMediaKey()

Use this method to obtain the input stream of the file by mediaKey, currently only used to obtain the contact photo for face recognition.

  • Parameters

    Parameter Type Description
    contentType ContentType Content type
    mediaKey String Media key of the file
  • Return

    Type Description
    InputStream Input stream of the file
  • Prototype

    InputStream getInputStreamByMediaKey(ContentType contentType, String mediaKey);
  • Required permissions

    None.

  • Support from

    0.10.70

  • Note

    This method is a time-consuming operation and is recommended to be used in a non-main thread.

Interfaces

OnFaceRecognizedListener

Set your context to implement this listener and add the override method to get the contact information when someone is recognized. When the recognized face has been configured in the temi Center, other information of the corresponding contact will be returned; and if it has not been configured in the temi Center, an empty ContactModel object will be returned.

Prototype

package com.robotemi.sdk.face;

interface OnFaceRecognizedListener {

Abstract methods

  • Parameters

    Parameter Type Description
    contactModelList List<ContactModel> Contact set corresponding to the recognized face
  • Prototype

    void onFaceRecognized(List<ContactModel> contactModelList);

Method for adding listener

  • Parameters

    Parameter Type Description
    listener ConversationViewAttachesListener An instance of a class that implements this interface
  • Prototype

    void addOnFaceRecognizedListener(OnFaceRecognizedListener listener);

Method for removing listener

  • Parameters

    Parameter Type Description
    listener OnFaceRecognizedListener An instance of a class that implements this interface
  • Prototype

    void removeOnFaceRecognizedListener(OnFaceRecognizedListener listener);
  • Required permissions

    Face Recognition

  • Support from

    0.10.70


OnSequencePlayStatusChangedListener

Set your context to implement this listener and add the override method to listen to the status of the sequence.

Prototype

package com.robotemi.sdk.sequence;

interface OnSequencePlayStatusChangedListener {}

Static constant

Constant Type Value Description
IDLE int 0 Finish playing
PREPARING int 1 Source preparing
PLAYING int 2 Playing
ERROR int -1 Errors occurred while playing

Abstract methods

  • Parameters

    Parameter Type Description
    status int Sequence's status
  • Prototype

    void onSequencePlayStatusChanged(int status);

Method for adding listener

  • Parameters

    Parameter Type Description
    listener OnSequencePlayStatusChangedListener An instance of a class that implements this interface
  • Prototype

    void addOnSequencePlayStatusChangedListener(OnSequencePlayStatusChangedListener listener);

Method for removing listener

  • Parameters

    Parameter Type Description
    listener OnSequencePlayStatusChangedListener An instance of a class that implements this interface
  • Prototype

    void removeOnSequencePlayStatusChangedListener(OnSequencePlayStatusChangedListener listener);
  • Required permissions

    None.

  • Support from

    0.10.70

Models

ContactModel

Used for holding the contact data.

Prototype

package com.robotemi.sdk.face;

class ContactModel {}

Attributes

Attribute Type Description
firstName String First name of contact
lastName String Last name of contact
gender String Gender
imageKey String The media key for the contact photo, Obtain the corresponding file input stream through the getInputStreamByMediaKey(String mediaKey) method.
description String Description information

Sample

Please refer to the sample code for more details.


ContentType

Used for holding the content type, Face recognition image only for now.

Prototype

enum class {
    FACE_RECOGNITION_IMAGE
}

SequenceModel

Used for holding the sequence data.

Prototype

package com.robotemi.sdk.sequence;

class SequenceModel {}

Attributes

Attribute Type Description
id String ID of sequence
name String Name of sequence
description String Description of sequence
Clone this wiki locally