Android Question Developing for Wear OS 3.5

canalrun

Well-Known Member
Licensed User
Longtime User
I have a Samsung Galaxy Watch 5 I would like to develop for – just simple stuff for fun. It uses Android 11 and Wear OS 3.5.

Has anyone tried developing for Wear OS 3 or above?

I see Agraham's tutorial "Using B4A to Develop for a Wear OS 2 Watch" and plan to follow that closely. One thing, I'm planning to use ADB's command "install" to sideload the resulting APK rather than going through Google Play. I am guessing this will work.

I think I have read somewhere that Wear OS 3.0 and above requires the target version to be set at or above a certain level. Is this true?
 
Last edited:

Sagenut

Expert
Licensed User
Longtime User
You could try to enable Developer Options and Debug USB on your watch.
Then connect it to the PC using the recharge cradle and you should be able to install APK directly from the IDE just like with your smartphone.
In previous versions it was working.
I think nothing has changed under this aspect.
 
Upvote 0

canalrun

Well-Known Member
Licensed User
Longtime User
Thanks. There is no USB on the GW5 and there is no charging cradle. Everything is done wirelessly via Qi (maybe Samsung's own version of Qi). Samsung supplies a puck (looks like a small hockey puck) that plugs into a USB wall wart and attaches magnetically to the watch.

Using Samsung's Watch Face Designer I have loaded watch faces wirelessly using ADB. I don't expect that to be a problem.

I am currently following Agraham.s tutorial trying to get a "hello world" program running on the watch. Wish me luck.
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Has anyone tried developing for Wear OS 3 or above?
Yes I have and I must tell you that unfortunately it is no longer possible with B4A. Wear OS 3 is not a problem, due to all the API changes the lib. is not compatible with Wear OS 5.
 
Upvote 0

canalrun

Well-Known Member
Licensed User
Longtime User
Thanks Alexander.

I was able to get my "hello world" app installed on my watch using a wireless ADB connection. When I ran the application showed the button, background, and text, but the scaling was off, and the button click event did not seem to fire.

I would have to agree with you that it does not work. You saved me from a lot of frustration knowing you also had problems.
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
was able to get my "hello world" app installed on my watch using a wireless ADB connection. When I ran the application showed the button, background, and text, but the scaling was off, and the button click event did not seem to fire.
For us the screen always stayed black when starting the app.
 
Upvote 0

canalrun

Well-Known Member
Licensed User
Longtime User
Have you found anything similar to B4A for Wear OS development?

All I've seen is stuff based on Android Studio.

B4A is attractive for Android development because it automates the 99% garbage required to make the compiler happy that is similar in every application. It allows you to spend the time actually developing your app. I wish something like that was available for Wear OS.
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Have you found anything similar to B4A for Wear OS development?
There is no lib. for Wear OS 5+ for B4A :(

We had made the author of the last lib. an offer, but unfortunately he has no time to bring the lib. up to date.
 
Last edited:
Upvote 0

canalrun

Well-Known Member
Licensed User
Longtime User
A library for B4A – that's a thought. In my playing around I was able to use ADB to load my "hello world" app written with B4A. The button showing "Hello" showed up, although the position was wrong, it was the wrong size, and the click event did not seem to work. Just getting as far as it did, it got past Ground Zero.

For the type of stuff I would do learning Android Studio is an overkill. A library that supports the GUI interface and allows you to make simple forms or cards would be perfect.

-- Added Later --
I got my "hello world" program running on the Samsung Galaxy Watch 5.
1669773561486.png

I connect to the watch via wireless ADB. When I compile and run, B4A downloads, installs, and runs the APK – that is nice.
Things fell into place when I did a Log(GetDeviceValues.ToString) and saw that the pixel resolution was 450 x 450 and the scale was 2.125.
The click function did not work originally because I had the button name spelled wrong :rolleyes:.

When I click the button, I change the text from "hello" to "hello world" and draw the red circle.

Now I have to figure out something useful to do.
 
Last edited:
Upvote 0

Tom1s

Member
Licensed User
Longtime User
I have gw5 too and i am wishing if I could get the car heating on with the watch app.
If button now works I could try to run an API call etc. Hopefully b4a will continue to update newer versions of Watch OS.
 
Upvote 0

canalrun

Well-Known Member
Licensed User
Longtime User
I have gw5 too and i am wishing if I could get the car heating on with the watch app.
If button now works I could try to run an API call etc. Hopefully b4a will continue to update newer versions of Watch OS.

I have gotten very simple apps written in B4A to run on the GW5. Actually, I'm hopelessly behind on B4A updates. I use version 7.3 or 7.8, I think I it is, with SDK version 20. Everything I have tried seems to work. I've done Erel's old TTS example, some stuff that uses the sensors, and some stuff that uses the GPS. Everything I have tried seems to work.

I connect via wireless ADB and the apps install after compile from the B4A IDE.

A trick I use is to set my designer screen for custom at 450 x 450 pixels with 2.125 set for scaling. I then place a 317 width x 317 height scrollview at position 66 left, 66 top and then place all my controls on a panel 317 pixels width which I load at runtime to the scrollview panel. This ensures the controls are visible and I can scroll down for slightly more real estate. I set Full Screen with No Title.
 
Last edited:
Upvote 0
Top