Coverting Tizen Web app to WearOS

I want to know about the tool or API to convert my web apps to wearos app.

Is there any way exist?

There is no conversion. I believe that it won’t be too hard to covert using Kotlin but I have no personal experience.

Ron
Samsung Developer Relations

2 Likes

You mean Tizen Web is dead?

Galaxy Watch4 and newer watches will use Wear OS Powered by Samsung which is Android based OS. However, retailers still sell Watch3 and Active2 watches at a lower price than the newer Watches so there still is a market for that. So Tizen Web Apps for Watches is not dead, yet.

Tizen OS for Smart TV is very much alive and is going to be used on Non Samsung Smart TVs in the future. It is Web based (no native) so Tizen Web is very much alive and healthy.

Ron
Samsung Developer Relations

I am converting some applications from TIZEN to wear OS (:-()

with Tizen i realized a POST Json with JS:
TIZEN code that RUNNING CORECTLY !

function btnclicked(cmd) {

       switch (cmd) {
         case 'AA':
           json = '{"pop":"clock1"}';
         break;
         case 'BB':
           json = '{"pop":"clock2"}';
         break;
       }
       var client = new XMLHttpRequest();
       client.open("POST", "https://xxxxxxx.it:8132/yyy/qqqqq");
       client.setRequestHeader("Content-Type", "application/json");
       client.onreadystatechange = function() {
           if (client.readyState == 4 && client.status == 200) {
               alert(client.status);
            }
       }
       client.send(json);
    }

Transformation into KOTING Code:

fun pushToChat(cmdx: String) {

val serverURL: String = "https://xxxxxxx.it:8132/yyy/qqqqq"
val url = URL(serverURL)
val connection = url.openConnection() as HttpURLConnection
connection.requestMethod = "PUT"
connection.connectTimeout = 300000
connection.doOutput = true

val message = "{\"cmd\":\"$cmdx\"}"
val postData: ByteArray = message.toByteArray(StandardCharsets.UTF_8)

connection.setRequestProperty("charset", "utf-8")
connection.setRequestProperty("Content-length", postData.size.toString())
connection.setRequestProperty("Content-Type", "application/json")

Log.d("cmd",message)

try {
    val outputStream: DataOutputStream = DataOutputStream(connection.outputStream)
    outputStream.write(postData)
    outputStream.flush()
} catch (exception: Exception) {
    Log.d("cmd1","Eccezione")
}

This NOT running and raise an exception . . .have someone have the same issue ?
I need use Data Layer API or alternative library like okHTTP or Retrofit ?
Have you some example of code ?
Thnaks in advance