Pace - basic dev questions - Amazfit

Hi,
Long time .NET developer, I have suddenly found interest in exploring development for Amazfit Pace. I have a few basic questions and I'd appreciate your help.
1. How do I access the smartwatch features from my code? I don't suppose Android exposes a standardized API for accessing pedometer, barometer, sleep and other data on the device. I would expect it from Wear OS, but since Pace is running Android 5.1, how do I access for example the current pressure or steps for the day?
2. Can my app use Internet? If the watch is Bluetooth connected to the phone, if I make an Internet request from the app, would it succeed?
Thanks

hyankov said:
Hi,
Long time .NET developer, I have suddenly found interest in exploring development for Amazfit Pace. I have a few basic questions and I'd appreciate your help.
1. How do I access the smartwatch features from my code? I don't suppose Android exposes a standardized API for accessing pedometer, barometer, sleep and other data on the device. I would expect it from Wear OS, but since Pace is running Android 5.1, how do I access for example the current pressure or steps for the day?
2. Can my app use Internet? If the watch is Bluetooth connected to the phone, if I make an Internet request from the app, would it succeed?
Thanks
Click to expand...
Click to collapse
1.) It does. There's a sensor API you can use. Check my Step Notify app for an example of using the pedometer: https://forum.xda-developers.com/smartwatch/amazfit/app-step-notify-fitbit-esque-step-t3741724
2.) Yes, it can use either the WiFi on the watch or you can use the communication library to go via Bluetooth and use the phone's internet connection: https://forum.xda-developers.com/smartwatch/amazfit/dev-library-amazfit-communication2-t3779946

Related

[Q] Context Simulation: Decision Help

Hello together,
I`m writing currently my master thesis with the topic "Context Simulator For Mobile Business Application". The goal is, to test how an Android application reacts during changing context conditions: How reacts an application, if the battery is almost empty? How reacts an application, if internet connection breaks down during data transmission? How reacts an application, if a SD-Card is available/not available? ...
I want to simulate all of these factors on the PC and send the data to my android device. Some more examples:
- Simulating sensor data for accelerometer, gyroscope, ...
- GPS
- Camera and microphone (if an application requests a camera image, it should receive a image from my simulator)
- Fake connection for Wi-Fi, HDSPA, EDGE
- Fake time, time zone and date
- Simulate a specific battery level
- Fake calendar entries
------------------ My approaches ------------------
No 1:
Extend an existing custom rom with my features => Some calls should not transfer to OS (example: GPS) but to my simulator on PC. Also send data (example: battery level) to android OS. For example to pretend a low battery level.
No 2:
Write my own sandbox application (I haven`t found information to this topic so far). In this sandbox application, I`m going to start my application to test. So it is possible, to fetch all request from this System under test and I can decide if I want to transfer them to Android OS or to my simulator.
No 3:
Develop my own library, which will be included from my system under test. This library extends some android classes (e.g. Activity, Location Manager, Sensor Manager). My extensions classes will transmit the request to my simulator instead to the OS.
I`m afraid, I only have limited functionalities when I`m using this approach.
No 4:
Take sensor simulator from open intents as basic and extend it as good as possible.
-------- About Me --------
I only have few experience in Android development, but a lot experience in Java development. I know, I should read now a lot about custom roms, ... Unfortunately this thesis should be finish at the end of march.
------- What I want from you -------
Advice. I hope you understand my problem. Which is the best way to realize this project? I would like to have as much functionalities as possible. My prototype doesn`t need to support all context factors, but I should consider all factors in my system design.
I wanted to attached two graphics, but unfortunately I`m not allowed to. These are two possibilities and I`m not sure, which one is better (and also, if they are possible):
http ://s7.directupload.net/images/131212/bnpuo8gh.png
http ://s7.directupload.net/images/131212/e7u8dv4r.png
Thanks a lot,
Michael

[DEV/LIBRARY]Amazfit Communication: 2 way communication for Pace/Stratos inc internet

Amazfit Communication Library
The Amazfit Communication Library is a reverse engineered and modified version of the Huami "Transporter" class (and its subclass "TransporterClassic"), along with its dependencies. This allows both sending and receiving data on both the phone and the watch, using the same library.
Bascially, this allows apps on the watch to access data via a companion app on the phone. To make this easier, this library comes hand in hand with the "AmazfitInternetCommunication" app, which can be installed on the phone and allows apps on the watch to access the internet and perform simple requests, with data in response.
However, you can use this library with your own companion app on the phone to access any data the phone app has access to, for example a companion app on the phone with access to calendar appointments would allow a watch app to display events on a calendar, on the watch.
Usage
See the GitHub repo for the latest code and guide for addition of the library. You can also compile it if you wish.
Amazfit Internet Companion
Amazfit Internet Companion is a generic and open source internet companion app for the Amazfit Pace and Stratos. It allows apps developed with the Amazfit Communication library to access the internet over Bluetooth via a phone's internet connection. As a developer, rather than having to develop your own companion app, you can simply have your users install the companion app and it'll handle the rest, so long as you use the internet functions in the library (LocalURLRequest). Link them to the thread or use your own guide, linking to the latest APK from the repo to use this.
Alternatively, you can develop your own companion app. This could be used for loads of things, for example a companion app could provide a watch app with the calendar events on the phone, provided the phone app had the right permissions and formatted the data correctly. If you want to make your own companion app, feel free to use the Internet Companion app as a base
Hi Quinny, thanks for your great work. Did you make tests of how much this affects the battery life, egg with your train app?
Is it possible to run this in as a background service on watch?
Klaus3d said:
Hi Quinny, thanks for your great work. Did you make tests of how much this affects the battery life, egg with your train app?
Is it possible to run this in as a background service on watch?
Click to expand...
Click to collapse
I've not done proper tests but I've had it running for a few days with no noticeable effect on the life. Yes, you should be able to use a background service on the watch, if you need an app on the watch to always be available for receiving information from the phone - but bear in mind that the watch only has 512MB of RAM, so a running service is more taxing on the watch compared to a phone. You may be better off with a background service on the phone that stores the information you wish to send to the watch, which then responds to the watch app when it's run - an ondemand request if you will
Quinny899 said:
I've not done proper tests but I've had it running for a few days with no noticeable effect on the life. Yes, you should be able to use a background service on the watch, if you need an app on the watch to always be available for receiving information from the phone - but bear in mind that the watch only has 512MB of RAM, so a running service is more taxing on the watch compared to a phone. You may be better off with a background service on the phone that stores the information you wish to send to the watch, which then responds to the watch app when it's run - an ondemand request if you will
Click to expand...
Click to collapse
So if the watch can get any data from the phone, does that mean I can run Wear apps, like the Hangouts Wear app, on the watch and use it as it works on a regular Wear device? If so that would be incredible.
still work for watches in 2020?
hello, I know it's been a while since the last time this topic was discussed, does anyone know how to inform without this package still working today? I recently purchased an amazfit verge and since my house is completely automated, I want to develop an app for personal use ... thanks!
delphiover said:
hello, I know it's been a while since the last time this topic was discussed, does anyone know how to inform without this package still working today? I recently purchased an amazfit verge and since my house is completely automated, I want to develop an app for personal use ... thanks!
Click to expand...
Click to collapse
Still works, not tested it on the Verge though. Should work the same, they use the same framework I think.
Quinny899 said:
Still works, not tested it on the Verge though. Should work the same, they use the same framework I think.
Click to expand...
Click to collapse
cool, thanks for the reply!

Amazfit pace API

Hi,
do someone have some experience with developing mobile app for Amafit pace ? Is there some documentation for BT api ? Is there possibility to get data like heart rate, steps etc.. ?
Thanks for help.
Start here:
https://forum.xda-developers.com/smartwatch/amazfit/pace-basic-dev-questions-t3811865
Most, if not all, health data can be accessed via the the watchface interface.

App Request : Habitica checklist

Hello everyone.
Amazfit has focused pretty much exclusively on sports and fitness,
I believe for people work in offices, students who have tons of different goals other than basically running,
a checklist app is very essential , and to my understanding, achievable .
Is it possible to port Habitica sync (a gamification of daily tasks) bars to amazfit pace (A1612 ,ver. 2.9.5.0) ?
so that we can swipe to clear tasks,dailies,habits goals from watch interface.
If not possible , is there a workaround method to interact with Habitica thru watch?
uptill now, I have been trying to connect things up with IFTTT, clapier , and some third party codes.
you need a MIPS android 5.1.1 cient of theirs for that, or to write a client that will work with their API directly.

Sensor management on Tizen

I'd like to develop an application for a smart watch which will periodically turn on & off sensors on the watch/band, ala microphone/camera/etc, record their activity, do minimal processing and store the result on the watch/band. This result will be uploaded to the mobile phone when a bluetooth connection is established.
To my best understanding, this can only be done with Tizen/WearOS/FitbitOS, not with other watch operating systems such as Huami's ones (Amazfit/Xiami MI/etc). This also means that it's a (big) watch and not a (small) band that is suitable for the above.
Is this correct and how to do this otherwise if it's wrong?
How much of a hassle it is to do this in Tizen for a seasoned professional programmer who is a complete noob in Tizen/smartwatches/mobile devices?
Can we develop a headless app that runs constantly?
Are there any tutorials on the subject?

Categories

Resources