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

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!

Related

Google Cloud Messaging

Anyone tried it ? What are the first impressions ?
http://developer.android.com/guide/google/gcm/index.html
pandata000 said:
Anyone tried it ? What are the first impressions ?
http://developer.android.com/guide/google/gcm/index.html
Click to expand...
Click to collapse
Why should anybody want this?
Well, it depends from the app, iOS has push notifications (which are almost the same), and this one will be good if you want to send messages to users app remotely - for example alerting them for event or something ....
pandata000 said:
Well, it depends from the app, iOS has push notifications (which are almost the same), and this one will be good if you want to send messages to users app remotely - for example alerting them for event or something ....
Click to expand...
Click to collapse
But you could have done this without google... push notifications do not require a server by google (however you need one, but that shouldn't be the problem these days)
iOS and Windows Phone both have an OS dependant push notification service. That's simple because you have (or had) no internet connection from background apps on those OSs - so the only way to reach an app is via push using apple/microsoft servers - android does not have this restriction - so why give your/your user's data to google?
MaR-V-iN said:
....... the only way to reach an app is via push using apple/microsoft servers - android does not have this restriction - so why give your/your user's data to google?
Click to expand...
Click to collapse
To avoid having background tasks and permanent connections that would degrade the performance of the device.
However, I don't feel that sending a push message that just tells the user that there's new stuff in the app hurts or discloses any private info. Even, thanks to Android, you could use the push notification to "awake" the app, then the app connects silently to your own server to get the info it needs, without google knowing, and closing the connection right after.
mocelet2000 said:
To avoid having background tasks and permanent connections that would degrade the performance of the device.
Click to expand...
Click to collapse
That's not correct - you just give away the background task / permanent connection to another application, it's still needed. Moreover, with using this "service" you force your users to have gapps installed (and currently also JB, as gcm is currently only available in the newest Google APIs)
mocelet2000 said:
However, I don't feel that sending a push message that just tells the user that there's new stuff in the app hurts or discloses any private info.
Click to expand...
Click to collapse
If its only a tickle to notify the app that there is sth to update its not a privacy problem. But gcm allows you to send 4k of payload - this could be a private or chat message. (google gives such an example: http://developer.android.com/guide/google/gcm/adv.html#payload )
mocelet2000 said:
Even, thanks to Android, you could use the push notification to "awake" the app,
Click to expand...
Click to collapse
That's right, but the question is if I - as a user for now - want this. Should the app developer (and Google!) be able to start apps on my phone to do things?
mocelet2000 said:
without google knowing
Click to expand...
Click to collapse
I'm not going to tell you that google will know about it - it's up to you to find this out.
I agree, being not universal is a problem. But I prefer just an open connection to a notification server than many connections and multiple background services that developers might have not optimized.
Regarding what Google knows or not, it actually has nothing to do with GCM
mocelet2000 said:
I agree, being not universal is a problem. But I prefer just an open connection to a notification server than many connections and multiple background services that developers might have not optimized.
Click to expand...
Click to collapse
GCM does not stop developers from doing **** with their background services.
You might be right, that one connection is better than many, however it is important to see, that most traffic on android devices today is with google servers - even if your mails are not there. All this traffic is not done with a single connection, but often many parallel connections. So google should optimize thier own things, else this is useless to me, as i do not need those google apps and i would have less connections with every other app using their own connection than with google apps installed.
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums & Read the Forum Rules
Thanks ✟
Moving to Q&A
MaR-V-iN said:
GCM does not stop developers from doing **** with their background services.
You might be right, that one connection is better than many, however it is important to see, that most traffic on android devices today is with google servers - even if your mails are not there. All this traffic is not done with a single connection, but often many parallel connections. So google should optimize thier own things, else this is useless to me, as i do not need those google apps and i would have less connections with every other app using their own connection than with google apps installed.
Click to expand...
Click to collapse
However GCM is just an additional option for developers, which itself is good. The C2DM was a poor try to make things done. I hope this time its better
pandata000 said:
However GCM is just an additional option for developers, which itself is good. The C2DM was a poor try to make things done. I hope this time its better
Click to expand...
Click to collapse
GCM is just an additional option for developers who want to make their apps incompatible with AOSP. However as there still are developers out there that do not know what AOSP is, they do not know that using GCM makes them incompatible. So GCM is not good at all, because it may be used "accidentally" by those developers.
So GCM is even worse than the pendants for iOS or WP, because there the push service is available for everyone.
MaR-V-iN said:
GCM is just an additional option for developers who want to make their apps incompatible with AOSP. However as there still are developers out there that do not know what AOSP is, they do not know that using GCM makes them incompatible. So GCM is not good at all, because it may be used "accidentally" by those developers.
So GCM is even worse than the pendants for iOS or WP, because there the push service is available for everyone.
Click to expand...
Click to collapse
Agree ! But without any other alternatives, it's still an option
pandata000 said:
Agree ! But without any other alternatives, it's still an option
Click to expand...
Click to collapse
There is an alternative: write your own stuff. A push server is not that complicated. As you propably already got a server (because i dont think you want to send GCM pings from your home ) you got all you need, to not use GCM.
Hello
Google Cloud Messaging apparently not working on my device. Reported by a web service (not from Google but using GCM). Why?
My Google account fully configured and all used services assigned and working.
Where's the problem??
This is used by a few big developers. In their own apps. One of the biggest being AOKP with their AOKP push app.
Wayne Tech Nexus
In new Cyanogenmod Google CloudMessaging been used. CM 10 encodes SMS and these SMS been send per Google Cloud Messaging. CM is Open Source so you can get tipps from there

Endomondo App

Anybody know if this app will run with the gear without being bluetooth connected?
NinjaMom said:
Anybody know if this app will run with the gear without being bluetooth connected?
Click to expand...
Click to collapse
It will not. It will say Failed to connect to service. I had hoped to use Endomondo as a standalone fitness tracker without my phone but that is not possible. S Health is the only app I've found that can work without a phone.
Endomondo (and S Health of course) can read the heart rate from the Gear S while Runtastic and Strava cannot. Hopefully an update will bring full standalone functionality.
jeffmplsmn said:
It will not. It will say Failed to connect to service. I had hoped to use Endomondo as a standalone fitness tracker without my phone but that is not possible. S Health is the only app I've found that can work without a phone.
Endomondo (and S Health of course) can read the heart rate from the Gear S while Runtastic and Strava cannot. Hopefully an update will bring full standalone functionality.
Click to expand...
Click to collapse
It blows my mind all the data that the s health app will show you on the watch, but not in the app on the phone.
Also wish s health would give audible notifications at every mile like endomondo does.
+1 On Endomondo bringing full standalone functionality. To me the potential of this watch is its capabilities to be able to do more standalone tasks. The watch just came out so support for it may take a little time. The watch certainly has the capabilities to accomplish more than what it does out of the box, but we need developers support in order to take it to the next level. Hopefully more developers get on board.
Sent from my SM-P607T using Tapatalk
NinjaMom said:
Anybody know if this app will run with the gear without being bluetooth connected?
Click to expand...
Click to collapse
No it will not work without the phone
@NeatSheep
paitobp said:
+1 On Endomondo bringing full standalone functionality. To me the potential of this watch is its capabilities to be able to do more standalone tasks. The watch just came out so support for it may take a little time. The watch certainly has the capabilities to accomplish more than what it does out of the box, but we need developers support in order to take it to the next level. Hopefully more developers get on board.
Click to expand...
Click to collapse
^^ this. I would imagine the development team didn't design it for use as a stand alone app as prior to the GS, there was no standalone capability. I bet they are working on it now.
pdqgp said:
^^ this. I would imagine the development team didn't design it for use as a stand alone app as prior to the GS, there was no standalone capability. I bet they are working on it now.
Click to expand...
Click to collapse
I hope they get it fully working with the watch soon!
NinjaMom said:
Anybody know if this app will run with the gear without being bluetooth connected?
Click to expand...
Click to collapse
But, how can I understand this
This app could only be linked to one Android app, which means that our PRO users must use our Free app when using Gear S! But fear not – when you download the Free version and log in with the account associated with your PRO app, all your PRO features will be automatically unlocked.
?
The pro features work on the free app if you use the same account that is associated with your pro account.
So, I understand that it will not work with stand alone. I have a sim card in my watch, shouldn't the phone be able to connect to the watch, even when it is not within bluetooth range by using cellular data? I get the sam error, can't connect to service.
Endmondo will not work unless Bluetooth connected to the phone unfortunately.

[APP] please recommend substitution of app: network log

Hey guys, I've been seeking an alternate of Network Log (you can find it on Google Play Store) for quite a while but with no luck, so come out to ask if anyone knows one suitable for me .
I have to say Network Log is almost worthy for purchasing (although it is not a paid app), considering the job it's done in categorizing by protocols, by apps, displaying packets by size and time, graphing as a timeline, and that made it an excellent choice for analyzing apps consuming data and draining battery, but unfortunately the app owner doesn't respond to bug summit or emails.
The thing is, Network Log no longer works after Android 6.0, while others in the market relies on system-built-in VPN function to capture data, which is not suitbale for people like me in China using proxies to reach out to world .
So if anyone knows apps that can capture packets (not necessarily able to decrypt contents) and display by apps, just to make it easy to let me see the amounts and frequency Android apps uses the Internet, I‘ll be thankful that you recommend them to me (again it cannot be using Android VPN function since Shadowsocks is already using VPN, so I think the app maybe require root permission but I'm OK)
check...
will somebody know that???

Pace - basic dev questions

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

Help decompiling an app

I purchased some smart medical devices by a company called Contec to help monitor my grandfather's health. The devices are great, but the app itself (com.contec.phms) is abysmal - it will collect readings from the devices via Bluetooth, but there is no way to export the data to take to the doctor. I have tried contacting the app developers, but I have yet to hear back.
I am pretty handy with Linux, but I can't figure out how to interface with these products without the app. I'm not much of an Android developer, but I know enough to hack small changes to existing apps. If I could decompile this app, I'm sure I could trace the data and at least figure out a way to export to CSV. I have tried a few common decompilers, but I can't get the app to cleanly build in Android Studio. I don't know if this is against forum rules, but could someone help?

Categories

Resources