语言

Menu
Sites
Language
Android에 Application 설치 여부 확인

안녕하세요

 Tizen Watch 2.3.2 어플리케이션을 개발중입니다.

 타이젠에서 어플을 실행했을때 Android에 어플이 없는 경우 Alert창이 나오면서 Play Store로 진입을 합니다.

 나이키나 스타벅스를 보면 스플래시 이미지가 로딩이 된 후 Play Store로 이동한다는 커스텀창이 뜨는걸 확인 할 수 있는데

 마켓으로 보내는건 tizen.application.launchAppControl 통하여 구현을 하였습니다만, 인스톨 여부에 상관없이 이동을 합니다.

 어플리케이션 설치 확인 여부가 필요한데 Watch쪽 말고 Android에 특정 어플리케이션이 설치 되었는지 여부는 어떻게 확인 가능한가요

 

响应

6 回复
Armaan-Ul- Islam

Hello,

As far as my understanding from the translation this is my response:

You currently need to identify if the application is already installed on the device or not.

You may use  tizen.application.getAppsInfo() function of tizen application API which will return information about all the applications installed on the device. Then you can check whether the specific application is installed or not.

var installed=0;

function onListInstalledApps(applications){
    for (var i = 0; i < applications.length; i++) {
        console.log("ID : " + applications.id); 
        if(applications.id==yourAppId)               
            installed=1;
    }
} 

tizen.application.getAppsInfo(onListInstalledApps); 

To get app id of your app you may use tizen.application.getCurrentApplication() while running the app.

var yourAppId = tizen.application.getCurrentApplication();

Add necessary privileges in your config.xml file

<tizen:privilege name="http://tizen.org/privilege/application.info"/>
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>

Please check the Application API guide & API references for details.

https://developer.tizen.org/development/guides/web-application/application-management/application-information-and-controls#application_api

https://developer.tizen.org/development/api-references/web-application?redirect=/dev-guide/2.3.1/org.tizen.web.apireference/html/device_api/wearable/tizen/application.html

Thank you.

Hyojin Kwon

혹시 appContorl 어떻게 사용하셨는지 알려주실 수 있나요????

api 문서 랑 help contents 의 remoteApplicationControl 에서는 존재하지 않는 url 을 파라미터로 넘기라고 되어있어서요 ㅠ

Armaan-Ul- Islam

The application control consists of an operation, URI, MIME type, and some data, and it describes the request to be performed by the newly launched application. Launching an application with the App Control API is possible using following methods:

Explicit launch: Launch the application with the application ID.

Implicit launch: Launch the application with an operation, URI, or MIME type.

You may check the Application controls guide for details.

Hyojin Kwon

But the appcontrol operation url 

"http://tizen.org/appcontrol/operation/view"

is not exist now :-)

Is it not problem when coding? or not?

Gunwang Jeong

Android 단말에 App 설치 여부는 SAP API를 통해서 확인하는 방법이 있습니다.

Android App 과 Tizen App 에 SAP Accessory service profile 을 설정하고 Tizen App 이 먼저 설치 된 경우

Tizen App 에서 findPeer 를 수행하여 peer Agent 가 검색되지 않으면 Android App 이 미 설치된 것으로 간주하면 됩니다.

 

아래는 SAP API reference URL 입니다.

http://img-developer.samsung.com/onlinedocs/gear/web_device/webapis/sap.html

 

참고하시기 바랍니다.