Getting started with Xamarin and Samsung Gear/Galaxy
A couple of years ago I bought a Samsung Gear S3 watch (now rebranded as Samsung Galaxy Watch).
It was one feature in particular that I thought was the most important one, I should be able to develop for it.
I had heard that Xamarin was working on Tizen templates so the choice was easy.
It took a couple of years until Xamarin support for the watch came out and by then I had other ongoing development projects.
But I recently decided to revisit this and see how hard it would be to develop a simple Hello World application, it wasn't as straight forward as I would have hoped, and I decided to write this post to help others get started.
Getting Visual Studio up and running
I like to run the latest stuff so I'm running Visual Studio 2019 Preview at the time of writing.
Make sure you have Mobile development with .NET installed (if not run Visual Studio installer again and add it)
To get access to all the templates you need to install the Tizen SDK, Visual Studio will do this for you when you install the
Tizen Extension and you have to install Java JRE 8 (later versions won't work).
Download and install Java SE Runtime Environment 8 (you'll have to create an Oracle account if you don't have one)
1. Start Visual Studio
2. Choose the menu item Extensions and then Manage extensions
3. Search for "Visual Studio Tools for Tizen" and click download
Now you should have a menu Tools ->Tizen
5. Start Tools -> Tizen -> Tizen Package Manager
8. When the installation is done open Tools -> Tizen -> Tizen Package Manager again (if it didn't start)
9. I have a Samsung Gear S3 running Tizen 126.96.36.199 So I want to install 4.0 Wearable
Click Install to the right of 4.0 Wearable
Now the Tizen SDK is installed
Setting up developer mode on your watch
Time to get the watch into developer mode.
1. On your watch go to settings
2. Go to About watch
4. Find software version and tap it 5 times
Setting up WIFI
The easiest way during development is probably to use the emulator, but I want my app in my watch straight away.
1. On you watch go to Setting s
2. Select Connections
3. Turn Off Bluetooth
5. When you connect you will also be able to see your IP number if you scroll down.
Take a note of it we will use it later.
Remember having WIFI tuned on will drain your battery so make sure you have a charger near by.
Putting it together
Ok we have a developer unlocked and WIFI connected watch and we have Visual Studio all set up, let's put it together.
1. Go back to Visual Studio
2. Click Tools -> Tizen -> Tizen Device Manager
Your first app
Now we have a connection to our watch, let's write our first app.
1. In Visual Studio, create a new project use the template Tizen Wearable Xaml App
2. In the solution explorer select MainPage.xaml
3. Look for "Welcome to Xamarin.Forms!" and change it to something else "Hello World from Tizen".
4. In the solution explorer right click on your project select properties.
5. Goto Tools->Tizen -> Tizen Certificate Manager
6. Just press ok if you don't have any previous profiles
7. Click the +
8. Choose Samsung
9. Choose Mobile/Wearable
10. Name your profile
11. Create a new author certificate
Make sure "Sign the .TPK file using the following option" is checked
It should find your profile automatically
17. Click OK
18. Check the deployment is your watch
19. Now press Ctrl + F5 (Run without debugging)
20. Check your watch you now have "MyApp" (or the name you used) installed.
As I mentioned I am using Visual Studio 2019 Preview, and it is missing the important "use preview framework" checkbox.
After many hours of debugging I came to the conclusion that you cannot run Visual Studio 2019 Preview and have .NET Core 3 preview SDKs installed, that will make the apps break.
So I uninstalled the .NET Core 3 SDKs and things started to work.
Hope this post has helped you and please let me know if I missed something or if I can help on any other way.