I'd like to develop a companion application for my Tizen5.5 watch which uses information from the phone (Android host). I'm working on Windows 10 with Tizen Studio.
I found a nice example which I want to test: https://developer.samsung.com/galaxy-watch-develop/samples/companion/hello-native.html, it's dated for 2016, kind of old, but I haven't found anything newer.
For the development I'd like to use the Tizen5.5 emulator along with Android Studio's emulator.
I found a guidance on how to test my companion application with Tizen Emulator, but it didn't help.
It turned out that I need to install "Samsung Wearable Extension". So I did it:
However my emulator didn't get the Extension libraries, so Tizen Studio couldn't build these samples, as it couldn't find sap.h
:
I searched for this issue online, and I found nothing. It seems Samsung Wearable Extension is not compiled for x86 emulators since Tizen version 3.0 (they only provided that for the real device which is not x86 surely).
So I ended up copying Tizen3's x86 builds of SAP, and then finally Tizen Studio could build this sample.
However my Emulator is not able to run the sample, as it doesn't have the SAP installed.
Then I found this site: https://github.com/Samsung/Tizen.NET/issues/54, where they managed to install sap onto emulator manually by these commands:
sdb push [tizen_sdk_path]\platforms\tizen-4.0\wearable\emulator-images\add-ons\sap /opt/usr/home/owner/sap
sdb shell rpm -i /opt/usr/home/owner/sap/sap-1.9.5-0.i686.rpm
Now my problem is that I don't have sap
folder in add-ons
for tizen4.0. I only have it for Tizen3.0.
So I tried doing this, but rpm -i
fails:
sh-3.2# ls -all /lib/* | grep ncurses
lrwxrwxrwx 1 root root 19 Nov 3 10:15 /lib/libncurses++.so.6 -> libncurses++.so.6.1
-rwxr-xr-x 1 root root 71696 Oct 23 22:27 /lib/libncurses++.so.6.1
lrwxrwxrwx 1 root root 20 Nov 3 10:15 /lib/libncurses++w.so.6 -> libncurses++w.so.6.1
-rwxr-xr-x 1 root root 71696 Oct 23 22:27 /lib/libncurses++w.so.6.1
lrwxrwxrwx 1 root root 17 Mar 13 18:20 /lib/libncurses.so.5 -> libncurses.so.6.1
lrwxrwxrwx 1 root root 17 Nov 3 10:15 /lib/libncurses.so.6 -> libncurses.so.6.1
-rwxr-xr-x 1 root root 169780 Oct 23 22:27 /lib/libncurses.so.6.1
lrwxrwxrwx 1 root root 18 Nov 3 10:15 /lib/libncursesw.so.6 -> libncursesw.so.6.1
-rwxr-xr-x 1 root root 247700 Oct 23 22:27 /lib/libncursesw.so.6.1
sh-3.2# rpm -i sap-1.7.54-0.i686.rpm
error: Failed dependencies:
libncurses.so.5 is needed by sap-1.7.54-0.i686
As you can see, libncurses.so.5
is actually there (although I have linked it to libncurses.so.6.1
.
So this is the first step: make my Tizen5.5 emulator contain the SAP library.
And the second step is to make my Android emulator to connect to Tizen5.5 emulator:
I managed to install SAccessoryService_Emul.apk
to my Android Emulator, but I can't make it recognize my Watch Emulator, it always says "Disconnected" (not too surprising as the watch emulator is not having the SAP library):
I also did the adb
command with adb -e forward tcp:8230 tcp:8230
, -e
because host is not an USB device but an emulator.
To make it sure I'm not missing anything I've installed Tizen 3.0 emulator (which obviously not able to run my application compiled with for 5.5), and this emulator actually has the SAP library installed.
So I went to step2, and opened up the "Emulator for Samsung Accessory" on the Android Emulator, but whenever it tries connecting with the Tizen Emulator it crashes:
Another very well designed Samsung Software.
Here is the error if anyone is interested:
2021-03-13 14:36:46.734 5124-5157/com.samsung.accessory.framework E/AndroidRuntime: FATAL EXCEPTION: SAP_DAEMON_HANDLER_THREAD
Process: com.samsung.accessory.framework, PID: 5124
java.lang.ArrayIndexOutOfBoundsException: Failed to update offset while sending the message! [offset=0; size=2]
at com.samsung.accessory.session.SAMessage.decrementOffset(SAMessage.java:359)
ArrayIndexOutOfBoundsException
: OMG.
For the record: Samsung guys: really shame on you! You managed to create the worst SDK of the world. Your samples have to be way easier to install!