언어 설정

Menu
Sites
Language
Gear 2 - how to check bluetooth/battery status

Hi,

 

I am not a real developer. I just built a Watchface for my Gear2 using the Tizen Wearable SDK.

I want to add a bluetooth status check and battery information to the watchface. But I can't find a sample code for this.

Actually I can't even find a reference for Tizen wearable.

 

Where can I start ?

Btw, is this "native" or "web" app ? Which forum should I check ?

 

Thx.

 

Responses

12 댓글
Kamil N

To find reference for tizen wearables open help in you Tizen Wearable SDK.

 

 

mekabe remain

Thanks for your reply.

I am not at home to check it now. Shall I find references to check bluetooth status etc. in the help ?

Thx.

 

Marco Buettner

You cannot check the bluetooth status because Tizen Wearables doesn't include Bluetooth-API

mekabe remain

But there are watchfaces which have bluetooth status indicator.

How do they do it ?

 

Marco Buettner

Maybe tizen.systeminfo has informations about bluetooth? Check it on SystemInfo API

mekabe remain

thanks. tizen.systeminfo helped a lot. I figured out how to use it.

Now I can show  battery and bluetooth status on my watchface.

But I have another issue; 

Now I want to publish my app on Samsung Apps to be able to load it through Gear manager.

However, I get the following error on app registration:

Result : Pre-Review rejected(API Fail)
Failure Details: The author signature has failed the integrity test.[Defect]The author signature included in the Package has failed the integrity test.[Expected Result]The integrity of the author signature must be verified.[Reference]Author can digitally sign a package as a mechanism to ensure continuity of authorship. Validation system uses the author signature to verify the data integrity of the files within the application package.The author certificate must be chained with the developer Certification Authority (CA) certificate.

 I don't know how to sign the app. Where should I start ?

 

Thanks.

mekabe remain

ok; I figured outthe certification process.

Now I am waiting for my certificate from Samsung.

 

thx for all help.

 

raoul bizzotto

hello can you tell me how you did it? maybe sending me the code. I would be really grateful. thanks so much. tnx

 

daniel kim

Hi,

You can the necessary information about certificate in the Help page of wearable IDE.

      Getting Started with Tizen Wearable > Development Environment > Tizen SDK for Wearable > Certificates

I wish this will help you.

raoul bizzotto

Meanwhile, thanks, I already have the certificates and all, but I can not find, and do not know to use the code to use to display the% of the battery charge and remaining el bluetooth on and off. the battery is in numeric value such that 50% feel.
These are days that I try and giornoi information, tutorials and more.
if anyone can help I would be grateful.
Everything should be on web application to use as many Clocks. Thanks so much.
Sorry for the 'poor English.

daniel kim

Hi,

Here is the description of help page in wearable SDK for battery status.

Retrieving Battery Status Information

To enhance the user interaction with the device, you must learn to retrieve and display the battery status:

1.Define the elements used to display the battery status information on the screen:
<div>charging: <span id="charging"></span></div>
<div>chargingTime: <span id="chargingTime"></span></div>
<div>dischargingTime: <span id="dischargingTime"></span></div>
<div>level: <span id="level"></span></div>

2.Check whether the Battery Status API is supported. If it is supported, the object navigator area contains the battery property:
<script>
   /* As Tizen is webkit-based, it uses the webkit prefix */
   var battery = navigator.battery || navigator.webkitBattery || navigator.mozBattery;
</script>

3.Use the attributes of the BatteryManager interface to display the battery charging status, remaining charging time, remaining battery life, and battery level:

<script>
   window.addEventListener('load', function(e)
   {
      /* Charging status: true or false */
      document.querySelector('#charging').textContent = battery.charging ? 'charging' : 'not charging';

      /* Battery charging time: seconds (for example, 3600) or Infinity */
      document.querySelector('#chargingTime').textContent = battery.chargingTime / 60;

      /* Battery life: seconds (for example, 3600) or Infinity */
      document.querySelector('#dischargingTime').textContent = battery.dischargingTime / 60;

      /* Battery.level: between 0 and 1 (for example, 0.50) */
      document.querySelector('#level').textContent = Math.floor(battery.level * 100) + '%';  
   }, false);
</script>

 

I wish this will help you.

raoul bizzotto

thanks, this is the cosice there in help? because I had used it but did not work, I do not know why, maybe I forgot something.
Now the last question% of the battery does not update, I tried to use
battery1 function () {
  var bat1 = setInterval (function () {
        battery1 ();
     }, 1000);
}, True); }
and also
setTimeout,
  but putting these disappears% battery.