Languages

Menu
Sites
Language
Host(Android)측에서 Gear 매니저를 통해 현재 연결된 device model 정보를 받아올 수 있나요?

Gear2, Gear2 Neo, Gear S 세 가지 모델에 따라 Host(Android)측 구현사항에 차분을 두려고 합니다.

우선은 wearable app 실행 시 스스로 체크한 모델명을 Host로 메세지를 전달하여 구분중인데

이렇게 되면 유저가 app을 실행전까지는 구분 할 방법이 없습니다.

따라서 Host측에서 Gear 매니저를 통해 현재 연결된 device 정보를 받아올 수 있다면 보다 효과적인 구현이 가능 할 것 같은데..

정보를 받아올 방법이 있는지 답변 부탁드립니다.

 

Responses

2 Replies
daniel kim

안녕하세요..

Accessory SDK에 아래와 같은 method가 지원되는데, Product ID를 가져와서 구별하면 되지 않을까 합니다.

    Class SAPeerAccessory - This class represents a remote Accessory Device visible on one of the supported transports.

         String getAccessoryId()  - Get the unique Accessory ID of this remote Accessory Device.
 
         String getAddress() - Get the address of the remote Accessory Device.
 
         String getName() - Get the human readable friendly name of the remote Accessory Device.
 
         String getProductId() -  Get the product ID of the remote Accessory Device.
 
         int getTransportType()  - Get the transport type supported by the remote Accessory Device.
 
         String getVendorId()  - Get the vendor ID of the remote Accessory Device.

Gunwang Jeong

안녕하세요

 

Host side app에서 SAP API 를 이용하여 find peer 까지만 수행하시면 onFindPeerAgentResponse() callback 을 통해 

SAPeerAgent object 를 받을 수 있습니다.

이 SAPeerAgent.getAccessory() 하시면 SAPeerAccessory object 를 가져올 수 있고

SAPeerAccessory.getProductId() API 를 통해 wearable device 의 모델명을 가져올 수 있습니다.

 

find peer 까지만 수행하면 wearable app 을 실행하지 않고도 원하시는 정보를 가져올 수 있을 것으로 보입니다.

 

이상입니다.