Getting started with Xamarin and Samsung Gear/Galaxy

Jimmy Engström

NAVIGATION

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)
 
clip_image001.png

Tizen SDK

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
 

clip_image002.png
4. Restart Visual Studio

Now you should have a menu Tools ->Tizen
5. Start Tools -> Tizen -> Tizen Package Manager
 

clip_image003.png
This will start the installation of the Tizen SDK.
6. Click Install new Tizen SDK
7. Create and browse to an empty folder where you want your SDK to be installed.
 

clip_image004.png
clip_image005.png
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 4.0.0.4 So I want to install 4.0 Wearable
Click Install to the right of 4.0 Wearable
 

clip_image006.png
10. We also need Samsung Certificate Extension which is located under Extension SDK
clip_image007.png

 
 
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

clip_image008.png
 
3. Go to software version
clip_image009.png

 
4. Find software version and tap it 5 times

clip_image010.png
 

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

clip_image011.png
 
4. Turn on WIFI and connect to your WIFI network

clip_image012.png
 
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
 

clip_image013.png
3. Click the Remote Device Manager button
4. Click the add button
 

clip_image014.png
 
 
5. Enter your information and click add
 

clip_image015.png
6. Click the Connection button (if this doesn't work, restart your watch)
 

clip_image016.png

 
clip_image017.png

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
clip_image018.png
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
clip_image019.png
6. Just press ok if you don't have any previous profiles
7. Click the +
8. Choose Samsung
clip_image020.png
9. Choose Mobile/Wearable
clip_image021.png
10. Name your profile
clip_image022.png
11. Create a new author certificate

clip_image023.png
12. Enter a name and password (Our company name is Azm Dev)

clip_image024.png
13. Sign in with your Samsung Account (if you don't have one, create one)
14. Create a new Distributor certificate

clip_image025.png
15. Close Tizen Certificate Manager
16. Goto tools -> Options -> Tizen -> Certification

Make sure "Sign the .TPK file using the following option" is checked
It should find your profile automatically
 
clip_image026.png
 
17. Click OK
18. Check the deployment is your watch
  clip_image027.png
19. Now press Ctrl + F5 (Run without debugging)
20. Check your watch you now have "MyApp" (or the name you used) installed.

 
clip_image028.png  
 
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.
 
 
 
 
Helpful links
https://developer.tizen.org/development/visual-studio-tools-tizen/installing-visual-studio-tools-tizen?langredirect=1

Posted with :