Monitor network traffic stat in capacitor android application? - ionic-framework

Is there a way to get traffic stat (both rx and tx) from inside a capacitor android application?
I want to show user inside my application, how much internet has been used by my specific application in GB or MB.
Thanks in advance.

Related

Flutter MiBand services

I'm trying to read data from Xiaomi MiBand 5 with Flutter app.
So far I've managed to connect to band and read heart rate.
I found which service and UUID is responsible for heart rate and now I'm trying to find which services are responsible for other values.
After discovering all services, it seems that there are 12 of them :
1800, 1801, 180a, 1530, 1811, 1802, 180d, fee0, fee1, 180f, 1812, 3802
180d is responsible for heart rate and I managed to read data from it.
But how can I read steps count?
The list of Bluetooth SIG adopted services are available at:
https://www.bluetooth.com/specifications/gatt/services/
I suspect some of those are custom services. The Bluetooth Base UUID is
0000xxxx-0000-1000-8000-00805F9B34FB
Examples include:
0x180F -> Battery Service UUID (128-bit UUID: 0000180F-0000-1000-8000-00805F9B34FB)
If the value doesn't follow the base UUID then it will be a custom service.
There are some generic scanning and exploration tools to explore the services being provided by devices.
On mobile phones, the nRF Connect app is a good choice:
https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-mobile
On desktops machines, if you have a recent version of the Chrome browser then use the url chrome://bluetooth-internals/#devices to scan and inspect devices.

How to run a service/daemon in Android TV Oreo at all times?

I want to build an application for the Android TV platform. Part of this app is a service/daemon, which must start when the device boots, and must always run when the Android TV is powered on, even in stand-by.
Why do I want this service/daemon to run at all times? Part of my project is an application for portable devices (such as a smartphones and/or tablets), which will send commands via TCP to the Android TV app. Based on the kind of TCP message, the app will perform an action (power device on/off, push my app to the foreground etc.).
I have tried different code examples, but Android TV Oreo just kills this service after a while. I think these code examples were made before the Android Oreo restrictions.
An application like Kodi for the Android TV, has a web service that is always running in the background. Even on Oreo. but I can't figure it out how they have done that. Does anyone have some tips for me?
Edit: Yatse Remote Starter does what I want for Kodi, what I want to do with my app. It starts on boot, runs even in stand-by. https://play.google.com/store/apps/details?id=tv.yatse.android.remotestarter&hl=en. Still I would like to know how, so I can do it myself as well. Thanks in advance!
Many android apps and services are running simultaneously. To lower the chance of problems which cause poor user experience, Android 8.0 apps has two ways to limit what an app can do:
Background Service Limitations: While an app is idle, there are limits
to its use of background services. This does not apply to foreground
services, which are more noticeable to the user.
Broadcast Limitations: With limited exceptions, apps cannot use their
manifest to register for implicit broadcasts. They can still register
for these broadcasts at runtime, and they can use the manifest to
register for explicit broadcasts targeted specifically at their app.
Therefore, you need to create a ForegroundService in order to continue processing of your app. You can check this SO post regarding this issue.

How can I connect a golo4 obd2 device with IBM IoT platform without using a mobile application?

I'm using IBM Bluemix Services to develop a real time application. While developing the application I need to analyse the device data (Golo4 obd2 device) on the IoT platform. Please guide me to the step-by-step information regarding the connection of the device.
I don't have one of those devices but from a quick google it seems the only way to connect it to the web is via a mobile app they provide. Perhaps you can ask the manufacture or check the instruction manual? There is no way to analyze the data in bluemix if you can't get it from the car to bluemix. It is a common architecture for this to be via a phone (bluetooth to the phone and then wifi or mobile network to the WWW). Which is why it becomes important to consider the impact on the phone's battery life and the cost to the user of the amount of data transferred and minimize both.

Browser - USB interface.

I have a Garmin 800 GPS device. To upload data from it, all I need to to is plug it into a USB port & install a browser plugin and I can browse the device from a web page.
What is it that facilitates this? In a very broad question, where should I go/what should I be searching for to learn more about it and potentially implement it myself?
Thanks!
The browser is NOT going to connect to your USB device, nor it is going to know anything about the type of connection you are using. I don't have Garmin 800 GPS myself, but I can tell you that technically (most likely) the actual connection will be handled by your OS and you will be browsing the files on USB-connected HDD device or (less likely) the Garmin 800 GPS will be running an http server that you will be accessing via the browser.
The details of the URL that you are using to access the GPS data will give you a clue to the access type.

iOS: How to read current network activity level programmatically on iPad/iPhone?

I want to determine how many packets or bytes are traveling in & out of my iOS device at any moment. How can that be done?
Thanks.
You don't have access to that information. Your app is sandboxed from other applications.