[APP] Amazfit Internet Companion - Generic internet companion app for Pace/Stratos

Search This thread

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
8,427
7,691
253
23
Salford, Greater Manchester, UK
quinny898.co.uk
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 your phone's internet connection.

It DOES NOT allow any old Android app on the watch to access the internet over Bluetooth.

Usage
Simply download the latest release to your PHONE (again, this is a phone app, NOT a watch app), and install it as you would any other APK (you may need to enable unknown sources). Run the app at least once for it to work, and that's it!

You can also install the app over ADB, with your PHONE plugged into your PC, NOT your watch, using:

Code:
adb install -r AmazfitInternetCompanion-1.0.2.apk

The app can be hidden from your app drawer, to access it again (for debugging or to restart the service if it fails), simply add it as a shortcut to your homescreen, or if you're using Android 6.0 or above, go to the app info for the app and use the settings icon there

Developers
If you are using the internet functions of the AmazfitCommunication library (LocalURLRequest), you need to have your users install the latest build of this app on their phone. Either include your own guide of how to do that (linking to the apk on the GitHub repo), or simply link them here

Alternatively, feel free to use this as a base app to make your own companion app, note how the actual listening and sending of data is done in a foreground service to allow it to work without this app being open

Screenshot
This isn't really needed but here's what the companion app's UI looks like. Basic isn't it?

 
Last edited:

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
8,427
7,691
253
23
Salford, Greater Manchester, UK
quinny898.co.uk
:victory: Seems quite easy :D
So there are no conflicts with Amazfit apk?

It's separate, so it runs a separate service for it

When making the library, I had two attempts before the one that worked. The first used reflection on the Amazfit App (on the phone, WearBLE on the watch). This worked, but the channel listener didn't, so you just had to send and pray. The second used some dex2jar and some reflection, which didn't work at all really.

Because all the code was reversed and is separate from the Amazfit App, it just communicates with it as if it were the same app. I don't know why Huami allows this really, but I'm not complaining!
 

Squall-sama

Member
Apr 3, 2009
22
1
0
here is a logcat related to amazfit:
04-21 20:51:39.848 4292-4292/? D/AppInstallReceiver: trackEvent: AppEvent{properties={appId=com.kieronquinn.app.amazfitinternetcompanion, appLabel=Amazfit Internet Companion}, type=app_install}
04-21 20:51:39.865 1430-2407/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.kieronquinn.app.amazfitinternetcompanion flg=0x4000010 (has extras) } to com.quickbird.speedtestmaster/co.allconnected.lib.ad.receiver.HomeAdBroadcastReceiver
04-21 20:51:42.132 1430-9051/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.kieronquinn.app.amazfitinternetcompanion flg=0x4000010 (has extras) } to org.fdroid.fdroid/.receiver.PackageManagerReceiver
04-21 20:51:42.209 1430-1445/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.kieronquinn.app.amazfitinternetcompanion flg=0x4000010 (has extras) } to ru.yandex.market/com.yandex.auth.SystemEventHandler
04-21 20:51:50.535 1430-2918/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.kieronquinn.app.amazfitinternetcompanion cmp=com.kieronquinn.app.amazfitinternetcompanion/.LaunchActivity} from uid 10021 pid 3594
04-21 20:51:50.553 1430-1525/? D/RestartProcessManager: Update Total Launch Times :com.kieronquinn.app.amazfitinternetcompanion
04-21 20:51:50.553 1430-1525/? D/RestartProcessManager: updateSelf : com.kieronquinn.app.amazfitinternetcompanion, size : 30
04-21 20:51:50.553 1430-1525/? D/RestartProcessManager: Increase Total Launch Time : com.kieronquinn.app.amazfitinternetcompanion, times : 1, index : 29
04-21 20:51:50.553 1430-1525/? D/RestartProcessManager: Last Running Package : com.kieronquinn.app.amazfitinternetcompanion , start time 1524318710553
04-21 20:51:50.553 1430-9502/? D/EmbryoManager: Embryo claimed. com.kieronquinn.app.amazfitinternetcompanion, pid=3739
04-21 20:51:50.569 1430-2918/? I/ActivityManager: START u0 {cmp=com.kieronquinn.app.amazfitinternetcompanion/.MainActivity} from uid 10313 pid 3739
04-21 20:51:50.571 1430-1525/? D/RestartProcessManager: Duration is too short, ignore : 18 in com.kieronquinn.app.amazfitinternetcompanion
04-21 20:51:50.580 1430-1525/? D/RestartProcessManager: Update Total Launch Times :com.kieronquinn.app.amazfitinternetcompanion
04-21 20:51:50.580 1430-1525/? D/RestartProcessManager: updateSelf : com.kieronquinn.app.amazfitinternetcompanion, size : 30
04-21 20:51:50.580 1430-1525/? D/RestartProcessManager: Increase Total Launch Time : com.kieronquinn.app.amazfitinternetcompanion, times : 1, index : 29
04-21 20:51:50.580 1430-1525/? D/RestartProcessManager: Last Running Package : com.kieronquinn.app.amazfitinternetcompanion , start time 1524318710580
04-21 20:51:50.635 1430-9502/? I/ActivityManager: Start proc 6053:com.kieronquinn.app.amazfitinternetcompanion:background/u0a313 for service com.kieronquinn.app.amazfitinternetcompanion/.ForegroundService
04-21 20:51:50.661 6053-6053/? D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Connect TransportService, Now Is Connected : false, Is Connecting : false
04-21 20:51:50.663 6053-6053/? D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Connect TransportService : Success
04-21 20:51:50.666 6053-6053/? D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnServiceConnected!!
04-21 20:51:50.666 6053-6053/? D/AmazMod: [D]: AmazfitTestInternal -> onServiceConnected
04-21 20:51:50.666 6053-6053/? D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Transport Service Connected : Bundle[{component=ComponentInfo{com.huami.watch.hmwatchmanager/com.huami.watch.transport.DataTransportService}}]
04-21 20:51:50.667 3473-3473/? D/NotificationListener: onNotificationPosted# hash: 179919202 sbn: StatusBarNotification(pkg=com.kieronquinn.app.amazfitinternetcompanion user=UserHandle{0} id=1 tag=null key=0|com.kieronquinn.app.amazfitinternetcompanion|1|null|10313: Notification(channel=foreground_service pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x0 color=0x00000000 vis=PRIVATE))
04-21 20:51:50.668 3473-3473/? D/NotificationListener: onNotificationPosted# hash: 179919202 sbn: StatusBarNotification(pkg=com.kieronquinn.app.amazfitinternetcompanion user=UserHandle{0} id=1 tag=null key=0|com.kieronquinn.app.amazfitinternetcompanion|1|null|10313: Notification(channel=foreground_service pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x62 color=0x00000000 vis=PRIVATE))
04-21 20:51:50.669 3720-3720/com.huami.watch.hmwatchmanager D/TimeFilter: com.kieronquinn.app.amazfitinternetcompanion -> 1524318710654
04-21 20:51:50.669 3720-3720/com.huami.watch.hmwatchmanager D/EdoNotificationService: posted: 0|com.kieronquinn.app.amazfitinternetcompanion|1|null|10313
04-21 20:51:50.670 3720-3720/com.huami.watch.hmwatchmanager E/music: Blocked onNotificationPosted StatusBarNotification(pkg=com.kieronquinn.app.amazfitinternetcompanion user=UserHandle{0} id=1 tag=null key=0|com.kieronquinn.app.amazfitinternetcompanion|1|null|10313: Notification(channel=foreground_service pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x0 color=0x00000000 vis=PRIVATE))
04-21 20:51:50.680 3720-3720/com.huami.watch.hmwatchmanager D/AmazMod: [D]: Noti-Manager -> <com.kieronquinn.app.amazfitinternetcompanion> isInUserWhitelist : false, isSmartFilterON : true, isInSmartFilterWhitelist : false
04-21 20:51:50.680 3720-3720/com.huami.watch.hmwatchmanager D/AmazMod: [D]: Noti-Manager -> <com.kieronquinn.app.amazfitinternetcompanion> isInWhitelist : false, isInUserBlacklist : false
04-21 20:51:50.681 3720-4264/com.huami.watch.hmwatchmanager D/AmazMod: [D]: Trans-Service -> Register ChannelListener, Module : com.kieronquinn.app.amazfitinternetcompanion, [email protected]be
04-21 20:51:50.681 3720-4264/com.huami.watch.hmwatchmanager D/AmazMod: [D]: Trans-Service -> Register DataListener, Module : com.kieronquinn.app.amazfitinternetcompanion, [email protected]
04-21 20:51:50.684 3720-3720/com.huami.watch.hmwatchmanager D/TimeFilter: com.kieronquinn.app.amazfitinternetcompanion -> 1524318710654
04-21 20:51:50.867 1430-1554/? I/ActivityManager: Displayed com.kieronquinn.app.amazfitinternetcompanion/.MainActivity: +269ms (total +296ms)
04-21 20:51:59.163 3720-3720/com.huami.watch.hmwatchmanager D/EdoNotificationService: not removed: 0|com.kieronquinn.app.amazfitinternetcompanion|1|null|10313
04-21 20:52:08.165 1430-1526/? I/WindowManager: Failed to capture screenshot of Token{b02784d ActivityRecord{e84cbe4 u0 com.kieronquinn.app.amazfitinternetcompanion/.MainActivity t1178}} appWin=Window{f350cb2 u0 com.kieronquinn.app.amazfitinternetcompanion/com.kieronquinn.app.amazfitinternetcompanion.MainActivity} drawState=4
04-21 20:52:08.243 1430-1525/? D/RestartProcessManager: increase duration : 17588 for com.kieronquinn.app.amazfitinternetcompanion
 

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
8,427
7,691
253
23
Salford, Greater Manchester, UK
quinny898.co.uk
here is a logcat related to amazfit:
04-21 20:51:39.848 4292-4292/? D/AppInstallReceiver: trackEvent: AppEvent{properties={appId=com.kieronquinn.app.amazfitinternetcompanion, appLabel=Amazfit Internet Companion}, type=app_install}
04-21 20:51:39.865 1430-2407/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.kieronquinn.app.amazfitinternetcompanion flg=0x4000010 (has extras) } to com.quickbird.speedtestmaster/co.allconnected.lib.ad.receiver.HomeAdBroadcastReceiver
04-21 20:51:42.132 1430-9051/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.kieronquinn.app.amazfitinternetcompanion flg=0x4000010 (has extras) } to org.fdroid.fdroid/.receiver.PackageManagerReceiver
04-21 20:51:42.209 1430-1445/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.kieronquinn.app.amazfitinternetcompanion flg=0x4000010 (has extras) } to ru.yandex.market/com.yandex.auth.SystemEventHandler
04-21 20:51:50.535 1430-2918/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.kieronquinn.app.amazfitinternetcompanion cmp=com.kieronquinn.app.amazfitinternetcompanion/.LaunchActivity} from uid 10021 pid 3594
04-21 20:51:50.553 1430-1525/? D/RestartProcessManager: Update Total Launch Times :com.kieronquinn.app.amazfitinternetcompanion
04-21 20:51:50.553 1430-1525/? D/RestartProcessManager: updateSelf : com.kieronquinn.app.amazfitinternetcompanion, size : 30
04-21 20:51:50.553 1430-1525/? D/RestartProcessManager: Increase Total Launch Time : com.kieronquinn.app.amazfitinternetcompanion, times : 1, index : 29
04-21 20:51:50.553 1430-1525/? D/RestartProcessManager: Last Running Package : com.kieronquinn.app.amazfitinternetcompanion , start time 1524318710553
04-21 20:51:50.553 1430-9502/? D/EmbryoManager: Embryo claimed. com.kieronquinn.app.amazfitinternetcompanion, pid=3739
04-21 20:51:50.569 1430-2918/? I/ActivityManager: START u0 {cmp=com.kieronquinn.app.amazfitinternetcompanion/.MainActivity} from uid 10313 pid 3739
04-21 20:51:50.571 1430-1525/? D/RestartProcessManager: Duration is too short, ignore : 18 in com.kieronquinn.app.amazfitinternetcompanion
04-21 20:51:50.580 1430-1525/? D/RestartProcessManager: Update Total Launch Times :com.kieronquinn.app.amazfitinternetcompanion
04-21 20:51:50.580 1430-1525/? D/RestartProcessManager: updateSelf : com.kieronquinn.app.amazfitinternetcompanion, size : 30
04-21 20:51:50.580 1430-1525/? D/RestartProcessManager: Increase Total Launch Time : com.kieronquinn.app.amazfitinternetcompanion, times : 1, index : 29
04-21 20:51:50.580 1430-1525/? D/RestartProcessManager: Last Running Package : com.kieronquinn.app.amazfitinternetcompanion , start time 1524318710580
04-21 20:51:50.635 1430-9502/? I/ActivityManager: Start proc 6053:com.kieronquinn.app.amazfitinternetcompanion:background/u0a313 for service com.kieronquinn.app.amazfitinternetcompanion/.ForegroundService
04-21 20:51:50.661 6053-6053/? D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Connect TransportService, Now Is Connected : false, Is Connecting : false
04-21 20:51:50.663 6053-6053/? D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Connect TransportService : Success
04-21 20:51:50.666 6053-6053/? D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnServiceConnected!!
04-21 20:51:50.666 6053-6053/? D/AmazMod: [D]: AmazfitTestInternal -> onServiceConnected
04-21 20:51:50.666 6053-6053/? D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Transport Service Connected : Bundle[{component=ComponentInfo{com.huami.watch.hmwatchmanager/com.huami.watch.transport.DataTransportService}}]
04-21 20:51:50.667 3473-3473/? D/NotificationListener: onNotificationPosted# hash: 179919202 sbn: StatusBarNotification(pkg=com.kieronquinn.app.amazfitinternetcompanion user=UserHandle{0} id=1 tag=null key=0|com.kieronquinn.app.amazfitinternetcompanion|1|null|10313: Notification(channel=foreground_service pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x0 color=0x00000000 vis=PRIVATE))
04-21 20:51:50.668 3473-3473/? D/NotificationListener: onNotificationPosted# hash: 179919202 sbn: StatusBarNotification(pkg=com.kieronquinn.app.amazfitinternetcompanion user=UserHandle{0} id=1 tag=null key=0|com.kieronquinn.app.amazfitinternetcompanion|1|null|10313: Notification(channel=foreground_service pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x62 color=0x00000000 vis=PRIVATE))
04-21 20:51:50.669 3720-3720/com.huami.watch.hmwatchmanager D/TimeFilter: com.kieronquinn.app.amazfitinternetcompanion -> 1524318710654
04-21 20:51:50.669 3720-3720/com.huami.watch.hmwatchmanager D/EdoNotificationService: posted: 0|com.kieronquinn.app.amazfitinternetcompanion|1|null|10313
04-21 20:51:50.670 3720-3720/com.huami.watch.hmwatchmanager E/music: Blocked onNotificationPosted StatusBarNotification(pkg=com.kieronquinn.app.amazfitinternetcompanion user=UserHandle{0} id=1 tag=null key=0|com.kieronquinn.app.amazfitinternetcompanion|1|null|10313: Notification(channel=foreground_service pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x0 color=0x00000000 vis=PRIVATE))
04-21 20:51:50.680 3720-3720/com.huami.watch.hmwatchmanager D/AmazMod: [D]: Noti-Manager -> <com.kieronquinn.app.amazfitinternetcompanion> isInUserWhitelist : false, isSmartFilterON : true, isInSmartFilterWhitelist : false
04-21 20:51:50.680 3720-3720/com.huami.watch.hmwatchmanager D/AmazMod: [D]: Noti-Manager -> <com.kieronquinn.app.amazfitinternetcompanion> isInWhitelist : false, isInUserBlacklist : false
04-21 20:51:50.681 3720-4264/com.huami.watch.hmwatchmanager D/AmazMod: [D]: Trans-Service -> Register ChannelListener, Module : com.kieronquinn.app.amazfitinternetcompanion, [email protected]be
04-21 20:51:50.681 3720-4264/com.huami.watch.hmwatchmanager D/AmazMod: [D]: Trans-Service -> Register DataListener, Module : com.kieronquinn.app.amazfitinternetcompanion, [email protected]
04-21 20:51:50.684 3720-3720/com.huami.watch.hmwatchmanager D/TimeFilter: com.kieronquinn.app.amazfitinternetcompanion -> 1524318710654
04-21 20:51:50.867 1430-1554/? I/ActivityManager: Displayed com.kieronquinn.app.amazfitinternetcompanion/.MainActivity: +269ms (total +296ms)
04-21 20:51:59.163 3720-3720/com.huami.watch.hmwatchmanager D/EdoNotificationService: not removed: 0|com.kieronquinn.app.amazfitinternetcompanion|1|null|10313
04-21 20:52:08.165 1430-1526/? I/WindowManager: Failed to capture screenshot of Token{b02784d ActivityRecord{e84cbe4 u0 com.kieronquinn.app.amazfitinternetcompanion/.MainActivity t1178}} appWin=Window{f350cb2 u0 com.kieronquinn.app.amazfitinternetcompanion/com.kieronquinn.app.amazfitinternetcompanion.MainActivity} drawState=4
04-21 20:52:08.243 1430-1525/? D/RestartProcessManager: increase duration : 17588 for com.kieronquinn.app.amazfitinternetcompanion

There's no crash in there, please either post the whole thing as an attachment or just filter by error instead
 

Squall-sama

Member
Apr 3, 2009
22
1
0
Thank you. I've updated the GitHub and added a new release for the build too

It's really strange, but I can send requests only to your test page - http://quinny898.co.uk/test.txt
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Connect TransportService, Now Is Connected : false, Is Connecting : false
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Connect TransportService : Success
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnServiceConnected!!
D/AmazMod: [D]: AmazfitTestInternal -> onServiceConnected
[D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Transport Service Connected : Bundle[{component=ComponentInfo{com.huami.watch.wearservices/com.huami.watch.transport.DataTransportService}}]
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnChannelChanged Available : true
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> TransportService Now Is Connected : true
[D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Send : [Transport://com.kieronquinn.app.amazfitinternetcompanion/com.huami.watch.companion.transport.amazfitcommunication.HTTP_REQUEST, Time=1524342777511, Data=8], null
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnDataReceived Action : com.huami.watch.companion.transport.amazfitcommunication.HTTP_PINGBACK
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnDataReceived Action : com.huami.watch.companion.transport.amazfitcommunication.HTTP_RESULT

But if I send request to any other resources I don't get
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnDataReceived Action : com.huami.watch.companion.transport.amazfitcommunication.HTTP_RESULT
 
Last edited:

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
8,427
7,691
253
23
Salford, Greater Manchester, UK
quinny898.co.uk
It's really strange, but I can send requests only to your test page - http://quinny898.co.uk/test.txt
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Connect TransportService, Now Is Connected : false, Is Connecting : false
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Connect TransportService : Success
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnServiceConnected!!
D/AmazMod: [D]: AmazfitTestInternal -> onServiceConnected
[D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Transport Service Connected : Bundle[{component=ComponentInfo{com.huami.watch.wearservices/com.huami.watch.transport.DataTransportService}}]
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnChannelChanged Available : true
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> TransportService Now Is Connected : true
[D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> Send : [Transport://com.kieronquinn.app.amazfitinternetcompanion/com.huami.watch.companion.transport.amazfitcommunication.HTTP_REQUEST, Time=1524342777511, Data=8], null
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnDataReceived Action : com.huami.watch.companion.transport.amazfitcommunication.HTTP_PINGBACK
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnDataReceived Action : com.huami.watch.companion.transport.amazfitcommunication.HTTP_RESULT

But if I send request to any other resources I don't get
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnDataReceived Action : com.huami.watch.companion.transport.amazfitcommunication.HTTP_RESULT

The pingback is only to tell the watch it's received the request and to not show an error, the fact it's returning HTTP_RESULT means it's working
 

Squall-sama

Member
Apr 3, 2009
22
1
0
The pingback is only to tell the watch it's received the request and to not show an error, the fact it's returning HTTP_RESULT means it's working

So, main issue - when I try to send request to any resources I got only
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnDataReceived Action : com.huami.watch.companion.transport.amazfitcommunication.HTTP_PINGBACK

And I don't get
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnDataReceived Action : com.huami.watch.companion.transport.amazfitcommuni cation.HTTP_RESULT

Only txt files or site with small text returns HTTP_RESULT. What can I do?
 

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
8,427
7,691
253
23
Salford, Greater Manchester, UK
quinny898.co.uk
So, main issue - when I try to send request to any resources I got only
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnDataReceived Action : com.huami.watch.companion.transport.amazfitcommunication.HTTP_PINGBACK

And I don't get
D/AmazMod: [D]: Transporter-Classic[com.kieronquinn.app.amazfitinternetcompanion] -> OnDataReceived Action : com.huami.watch.companion.transport.amazfitcommuni cation.HTTP_RESULT

Only txt files or site with small text returns HTTP_RESULT. What can I do?

Post the full logcat with the big files, and also remember that this is being converted and sent over bluetooth, so it's slow and you need to give it time
 

Squall-sama

Member
Apr 3, 2009
22
1
0
Code:
localURLConnection.setDoOutput(false);

Should fix it, but I left an error in the companion app where it ignores the databundle for doInput/doOutput and always has them set to true. Build 1.0.2 on GitHub fixes this.

Unfortunately nothing has changed after updating InternetCompanion and add localURLConnection.setDoOutput(false) in code. Still don't get response. https://jsonplaceholder.typicode.com/posts/1 - try this resource with your lib for example.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    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 your phone's internet connection.

    It DOES NOT allow any old Android app on the watch to access the internet over Bluetooth.

    Usage
    Simply download the latest release to your PHONE (again, this is a phone app, NOT a watch app), and install it as you would any other APK (you may need to enable unknown sources). Run the app at least once for it to work, and that's it!

    You can also install the app over ADB, with your PHONE plugged into your PC, NOT your watch, using:

    Code:
    adb install -r AmazfitInternetCompanion-1.0.2.apk

    The app can be hidden from your app drawer, to access it again (for debugging or to restart the service if it fails), simply add it as a shortcut to your homescreen, or if you're using Android 6.0 or above, go to the app info for the app and use the settings icon there

    Developers
    If you are using the internet functions of the AmazfitCommunication library (LocalURLRequest), you need to have your users install the latest build of this app on their phone. Either include your own guide of how to do that (linking to the apk on the GitHub repo), or simply link them here

    Alternatively, feel free to use this as a base app to make your own companion app, note how the actual listening and sending of data is done in a foreground service to allow it to work without this app being open

    Screenshot
    This isn't really needed but here's what the companion app's UI looks like. Basic isn't it?

    1
    Attached logs with errors after opening the app

    Seems OnePlus managed to break yet another SystemUI thing in the form of adaptive icons as notifications. Try the attached APK, see if that works
    1
    This version works fine on my phone! Thanks ! It's time to create some app for pace.
    1
    I know I'm a little behind on the uptake here, but do you mind if I inquire as to why the Amazfit Pace/Stratos can't access the internet directly? They both claim to be Wi-Fi enabled, but I assume they utilize some sort of a multipurpose bluetooth/Wi-Fi transceiver? Sorry if you've already explained this elsewhere, but I can't seem to find the information anywhere. If you could link me to a location where this is explained in more detail, that would be very much appreciated!

    They can access the internet over WiFi, but that requires them to be connected directly, which is not always possible (for example my train times app, stations in the UK have WiFi but there's a captive portal that won't work with the watch). Using this method also allows it to work over mobile data, as the watch doesn't have a connection itself
    1
    Oh, I see! Thanks for the quick response.

    One more thing - if you don't mind me picking your brain, as you seem very knowledgeable on this subject - certain apps (like the Spotify full and Wear apks), I've heard do not function on Amazfit's modified Android OS. Do you know why this would be?

    Missing framework code. If you add the framework and the AmbientPrebuilt APK they'll load (as long as they work on Android 5.1), but won't connect to a phone
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone