언어 설정

Menu
Sites
Language
How to get list applications on wearable from a watch face and choose one of thems

Hi every one!

I had seen a watch face which support select an applciation in Gear device (with a new window and I can using rotating benzel in there),
It's seem like that app using appControll to open native app which list all apps in device and then when we select one of them, the information of selected app will be return to watch face to display.

I take a lot of time to searching about that but there is nothing can do that. Have an appControll to pick an image from devices, I think also have another for pick an application infor .

please help me any idea to make above feature, thank so much!

Edited by: minh hoat tran on 09 3월, 2017

Responses

9 댓글
Iqbal Hossain

hi 

To launch a app with the image from filesystem, use this

  var imageFileSource= 'home2.jpg';
    var imageSourceFolder = 'images';

    tizen.filesystem.resolve(imageSourceFolder, function(images) {
        var imagePath = images.resolve(imageFileSource);
    	var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/image/crop",
    			imagePath.toURI(),
                "image/*", null , null);
    	tizen.application.launchAppControl(appControl, "tizen.imageviewer", successCb, errCb, null);
	   
    	
    	 function successCb() {
    		  console.log("Success");
    	 }
    	 
    	 function errCb() {
   		  console.log("Failed");
   	     }
     });

To get list of apps installed on device, use this, 

tizen.application.getAppsInfo(onListInstalledApps);
function onListInstalledApps(applications) {
      for (var i = 0; i < applications.length; i++)
	  console.log("ID : " + applications[i].id+ " "+ applications[i].name);
}

Also add these privileges, 

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

Ref:

1. https://developer.tizen.org/dev-guide/web/2.3.0/org.tizen.mobile.web.appprogramming/html/guide/app_guide/launching_appcontrol.htm#platform

2. https://developer.tizen.org/community/code-snippet/web-code-snippet/list-app-ids-installed-applications-on-device?tab=all

3. https://developer.tizen.org/community/code-snippet/web-code-snippet/launch-%E2%80%98settings%E2%80%99-app-wearable-web-application-0?tab=all

 

minh hoat tran

Hi Iqbal Hossain!

Thanks so much for your answer, but I had know hor to get applications list in my code. But I saw a watch face whichs support open a screen which list all apps in device and we can using rotatebenzel on it. Did you know how to do that, please help, thanks so much.

Iqbal Hossain

You can use simply HTML <ul> and <li> tag for list view implementation. TAU has the listview. You can use it. 

<div class="ui-page">
    <header class="ui-header">
		<h2 class="ui-title">Normal List</h2>
	</header>
		<div class="ui-content">
			<ul class="ui-listview">
				<li><a href="#">List 1</a></li>
				<li><a href="#">List 2</a></li>
				<li><a href="#">List 3</a></li>
				<li><a href="#">List 4</a></li>
				<li><a href="#">List 5</a></li>
				<li><a href="#">List 6</a></li>
			</ul>
		</div>
</div>

For ListView => https://developer.tizen.org/ko/design/wearable/ui-components?langredirect=1#list_

For Bezen Scroll action=>

1. https://developer.tizen.org/ko/forums/web-application-development/scrolling-listview-rotary-bezel?langswitch=ko

2. https://developer.tizen.org/ko/community/code-snippet/web-code-snippet/how-scroll-section-using-bezel-gear-s2?langredirect=1

minh hoat tran

I understand what you mean. I mean in the watch face, we cannot using rorating with tau UI,  but I saw other watch face can open new page (which include all apps name) from watch face and in that page we can using rotating benzel, you can refer with a case you want to pick an image from system and select one of that image, it's using open app controll to open select image window

var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/pick",
                                              null, "image/*", null)

 

Marco Buettner
function onRotary(event) {
        
	if (event.detail.direction === "CW") {
		
		console.log("CW");
		document.getElementById('lv').scrollTop += 25;
		
	} else if (event.detail.direction === "CCW") {
		
		console.log("CCW");
		document.getElementById('lv').scrollTop -= 25;

	}
}

document.addEventListener("rotarydetent", onRotary);

Thats listen to the rotating bezel.. For u other "problem" you have to find a own solution.. You have to create a own list/page/circle whatever u need... As developer you shouldnt any problems with that ;)

minh hoat tran

Thanks for your comment, Actually I can easy to make my list which support rotating benzel, But my question is how to open a list Gear apps from Watch face, that list support rotating event because I saw an watch face can do that, after many time I searching API I guess that that watch face using tizen app controll to open a native app which support list all Gear apps and select one of them to return watch face app, but I can not found what app controll is used for that :(

Onur Şahin

You cannot capture rotarydetent events on a watchface (you can listen for the event but cannot prevent w-home to change the page to notifications or widgets), what that other watchface you mention is probably creating a native notification window or lanching another app to show the list of applications, thats why it is able to use rotarydetent events.

minh hoat tran

Yes, you right, I check the watch face which can do that, I can guess that that app using tizen app controll to open an native app which support list all apps in devices and select one of them.

minh hoat tran

Do you know any way to do that?