FORUMS

[APP] Samsung's Alti/Barometer app rebuilt for Wear OS w/ fully working Tile!

36 posts
Thanks Meter: 13
 
By calugj, Member on 21st July 2020, 09:46 PM
Post Reply Email Thread
Introduction

Google's Wear OS lacks many things from competitors... One of these is a Barometer-Altimeter application. So why not building one by getting the inspiration from the best one out in the market?
Original Alti-Barometer app from Samsung: https://galaxystore.samsung.com/gear...alti-barometer

Before installing read the instructions!




Demonstration


App and Tile (screenshots)
Click image for larger version

Name:	Altimeter.png
Views:	158
Size:	35.0 KB
ID:	5071597Click image for larger version

Name:	Barometer.png
Views:	152
Size:	35.2 KB
ID:	5071599Click image for larger version

Name:	Settings.png
Views:	120
Size:	26.1 KB
ID:	5071601Click image for larger version

Name:	Tile.png
Views:	116
Size:	37.1 KB
ID:	5071603

Tour of the app (gif)
Click image for larger version

Name:	demo.gif
Views:	152
Size:	1.07 MB
ID:	5071605




Features

Barometer:
● Real-time pressure display digital
● Real-time pressure red hand indicator
● Graph for the past 6 hours
● Pressure trend over the past 6 hours
● Background collecting of pressure
● Notification for possible storms

Altimeter:
● Real-time altitude display digital
● Real-time altitude red hand indicator
● Graph for the past 6 hours
● Auto calibration of altitude based on weather data

TILE:
● Thanks to the Unofficial Tile API: Tile showing pressure and altitude!

Settings:
● Enable / disable storm alert
● Enable / disable automatic calibration of altitude
● Metric / imperial units





Installation instructions

● Only supports Wear OS, not standard Android
● Android version must be 8.0+
0 - If any previous version in installed, go to "Settings" > "Apps & Notifications" > "App info" > "Alti-Barometer" > "App Info" > "Clear data" > Confirm
1 - Download the latest .apk file
2 - Install the .apk with adb (there are tutorials)
3 - Start the app
4 - Grant the Location permission
Done!




Detailed info about the app

Every 5 minutes a the app will get the pressure from the sensor and store the data.
The weather notification is sent if 4 hPa are dropped in the past three hours.
The trend seen in the barometer is calculated in the past 6 hours.
For the first 6 hours the trend is going to be inaccurate because it doesn't have real data to compare.
Altitude is measured using the barometric formula, considering standard the pressure of 1013.25 hPa.




Download

Ver 1.10 Final (installation instructions changed)
Alti-Barometer1.10.apk




Tell me what you think about this app!
The Following 4 Users Say Thank You to calugj For This Useful Post: [ View ] Gift calugj Ad-Free
21st July 2020, 09:46 PM |#2  
OP Member
Thanks Meter: 13
 
More
Reserved
Changelog

1.0 Initial release
● Added barometer tab
● Notification for storms

1.1
● Added altitude tab
● Added settings tab
● Added switch to disable weather alert
● Notifications have a 1.5 hour timeout to avoid multiple consecutive calls

1.2
● Added ambient mode to extend the duration of the screen indefinitely
● Changed the way on how data is stored: now uses a circular queue which saves many CPU cycles (and battery)
● Fixed a bug involving data collection where sometimes were stored multiple reads at once

1.3
● Added the auto calibration of the altitude
The weather API I used to make this work has a limited free plan in terms of calls so I had to set the calibrations every 4 hours.
The original Samsung app has a button that calibrates instantly. For the same reason as above this can't be implemented.
● Added switch to disable auto calibration
● Added "Last Calibrated" info under altimeter
● Fixed a bug involving data collection where it would not collect data during doze

1.4
● The altitude graph only displays rounded integers numbers, now is much clearer
● Fixed a minor bug involving a predefined value where for the first three hours of app running, no notification would display
● Fixed a bug involving calibration

1.5
● Added fully functional tile!!
Thanks to the Unofficial Tile API

1.6
● Tile has now a beautiful UI.
I recreated the old UI for the tile, I think it's much better than the new one!
● Added imperial units toggle.

1.7
● Clicking on the tile brings to the application
● Fixed a bug on the app close

1.8
● Fixed a bug on the calibration caused by the location not refreshing

1.9
● Tuned the location request timings, to make sure the location is gotten every time

1.10
(*) This update only targets to refine at best the application with all of its components. It features a few tweaks to improve user experience. Updating is always suggested, but in this case isn't mandatory.
The installation instructions changed as well
● Added prompt to grant location permission directly on the app: location access can be granted when opening the app (*)
● Reboot is not anymore required after installation (*)
● Changed Y axis representation of altimeter to be a bit more sensitive than before to small changes
● Code cleanup for better optimisation on some cycles

Unless new bugs are found, this will be the last update!
26th July 2020, 01:44 PM |#3  
OP Member
Thanks Meter: 13
 
More
Auto calibration of altitude - explanation of the physics
I think this is cool to share

Air pressure depends on your altitude, but since air pressure changes normally, the readings are not accurate if the instrument is not correctly calibrated.
Manual calibration can be done... but it's just not practical! Automatic calibration is instead much better.

Let's start with the barometric formula:

Ph = P0 × e^(-α × h)
with constant α = (M × g) / (R × T)

The app gets your location, then finds thanks to the weather API the pressure Ph and the elevation h of that location.
Then I can calculate P0, that is the pressure that would be at sea level considering the pressure given by the weather forecast.
This calculation is useful to calibrate the altimeter!

P0 = Ph / e^(-α × h)

Once found P0, I can substitute it in the same formula to finally find the actual calibrated altitude

h = ln(Ph / P0) / - α
Ph is now the reading from the sensor and h is the current altitude

The calibration of the altitude highly depends on how accurate are the weather forecast provided...
From my testing I had a +- 10 m which is considerably good, but it depends from place to place.
26th July 2020, 03:22 PM |#4  
Senior Member
Thanks Meter: 173
 
More
Suunto 7 ( Display resolution 454 x 454)
First install not test but Thanks for now. ( beautiful UI )
26th July 2020, 06:42 PM |#5  
OP Member
Thanks Meter: 13
 
More
Quote:
Originally Posted by tom.android

Suunto 7 ( Display resolution 454 x 454)
First install not test but Thanks for now. ( beautiful UI )


Thank you so much! I'd appreciate a little review here in the comments after you test it so I know if there are some areas that can be improved
Especially the thing i'm most concerned is battery life so if you find problems you know what to do!
29th July 2020, 01:50 PM |#6  
OP Member
Thanks Meter: 13
 
More
New update
● Fixed a minor bug involving a predefined value where for the first three hours of app running, no notification would display
● The altitude graph only displays rounded integers numbers, now is much clearer (no more spikes)
● Fixed a bug involving calibration

To update it is recommended to follow the procedure described in the original post
The Following User Says Thank You to calugj For This Useful Post: [ View ] Gift calugj Ad-Free
29th July 2020, 02:31 PM |#7  
Senior Member
Thanks Meter: 173
 
More
Quote:
Originally Posted by calugj

● Added tile! But for now it's just a static image representing how it will look like when finished....

  1. Can shows get lococation access icon (status) and beep sound in Altimeter and Tile page ?

Thanks
30th July 2020, 11:35 AM |#8  
OP Member
Thanks Meter: 13
 
More
Quote:
Originally Posted by tom.android

  1. Can shows get lococation access icon (status) and beep sound in Altimeter and Tile page ?

Thanks

This project's purpose is to replicate almost identically both in terms of UI and functionality the Samsung Alti-barometer app, which is preinstalled on Samsung smartwatches.
This is the app I'm talking about -> https://galaxystore.samsung.com/gear...alti-barometer

I don't understand what you mean by beep sound (what's the beep for?) and location icon (you mean that the app should display an icon when it gets the location?), especially because I don't think the original app has these features.
30th July 2020, 11:44 AM |#9  
OP Member
Thanks Meter: 13
 
More
Final Update
The latest update features a new UI for the tile.
1st August 2020, 06:01 AM |#10  
Senior Member
Thanks Meter: 173
 
More
Quote:
Originally Posted by calugj

The latest update features a new UI for the tile.

Thanks for your work, Can we access the app from tile and the full app can keep alive (not close itself till we close it.)


from my Suunto 7

and the last quest why altitude num from tile not the same as app itself. (from my picture --3m & --1m)
1st August 2020, 08:37 PM |#11  
OP Member
Thanks Meter: 13
 
More
Quote:
Originally Posted by tom.android

Thanks for your work, Can we access the app from tile and the full app can keep alive (not close itself till we close it.)


from my Suunto 7

and the last quest why altitude num from tile not the same as app itself. (from my picture --3m & --1m)

1) Click on tile added

2) I managed to fix that.
NOTE: Your issue might also be related to always on. If you have always on disabled, after some seconds the display will lock. With this fix, if you turn your wrist (or click a button, or touch the screen), the app will return visible instead of showing the clock.
If you have always on enabled... No issues either because always on is supported and the app will keep open.

3) That's because the tile does not show real time data, while the app does.
This app collects data in the background every five minutes. This data serves for: pressure trend, notification alert and graphs. The value you see in the altimeter and barometer page are instead real time data, polled and computed instantly.
The tile shows the last collected data from the background service so what you see in the tile is at worst five minutes old.
It's not beneficial for battery life to have high refresh rate tiles... and for that there's the application!
The Following User Says Thank You to calugj For This Useful Post: [ View ] Gift calugj Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes