tethering

How to get Tethering and Mobile Hotspot data usage in Android using NetworkStatusManager or TrafficStat

梦想的初衷 提交于 2021-01-28 09:14:54
问题 I have an Android application which displaying data usage per app by NetworkStatusManager, but I can't get data usage for Tethering and Mobile Hotspot. How should I do this? 回答1: You need to query by UID and pass in the tethering UID: android.app.usage.NetworkStats.Bucket.UID_TETHERING like so: networkStatsManager.queryDetailsForUid(ConnectivityManager.TYPE_MOBILE, subscriberId, startDate, endDate, android.app.usage.NetworkStats.Bucket.UID_TETHERING); 来源: https://stackoverflow.com/questions

How to check internet access (INCLUDING tethering!) on Android?

你。 提交于 2020-01-07 02:33:30
问题 I am looking for a piece of code that would check network connectivity, of an Android device, including tethering, not only the wireless channels. I have spent hours online looking for such a thing, but without any result! All the functions I found out manage only wireless net tests. Nothing with tethering. So is it at least possible? Do you have some corresponding? 回答1: this checks if Tethering is enabled. Cut from a class I changed to get adbWireless working over a tethered connection: //

Reverse tethering Android

南楼画角 提交于 2020-01-05 03:59:05
问题 I've tried to use different reverse thetering instructions for Android but no one had helped me. I've got connection for several second (30 sec) and then connection dissappeared. In connection manager I've seen wired unmanaged connection for my phone I'm using Linux How can I fix problem with dissapearing reversed internet. Is it problem with Linux configuration? 回答1: If you use HTC mobile, the android need an (windows) driver to active "Internet Transmission", if not driver here, you will

Enable USB Tethering Android Programmatically without user Interaction

爷,独闯天下 提交于 2020-01-03 03:37:07
问题 I am developing an application that requires USB Tethering. I am using the following code to do so Intent tetherSettings = new Intent(); tetherSettings.setClassName("com.android.settings", "com.android.settings.TetherSettings"); startActivity(tetherSettings); But this code is opening the Tethering Setting so the user can Enable the USB tethering by clicking on it. Is it possible to enable the tethering without any user interaction? 回答1: No, Android is very security-aware and will not enable

Disable wifi tethering on android

余生颓废 提交于 2019-12-23 04:42:11
问题 I've found on stackoverflow the code that activates wifi-tethering programmatically on android... but how can I disable programmatically wifi tethering? Is available something like setWifiApDisable ? 回答1: This should disable the wifi tethering. protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); setWifiTetheringEnabled(false); } private void setWifiTetheringEnabled(boolean enable) { WifiManager wifiManager =

Is there a way to check whether tethering is active?

孤人 提交于 2019-12-18 16:55:16
问题 can I check programmaticall wheter the android device has tethering activated? I just watched the WifiManager class. All vatraibles from the WifiInfo show the same values as iff the WIFI is turned off on the device. Thnaks, best regards 回答1: Try using reflection, like so: WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); Method[] wmMethods = wifi.getClass().getDeclaredMethods(); for(Method method: wmMethods){ if(method.getName().equals("isWifiApEnabled")) { try { method

Changing Android hotspot settings

别来无恙 提交于 2019-12-18 12:02:24
问题 With the release of API level 26, my app's core functionality broke, this being, changing the users' hotspot setting within the application. To get and set this configuration I am using the following functions from the WifiManager hidden api: getWifiApConfiguration and setWifiApConfiguration . Method getWifiApConfiguration = wifiManager.getClass().getMethod("getWifiApConfiguration"); getWifiApConfiguration.invoke(wifiManager); This is working with devices prior to Android O, but in this

Enable bluetooth tethering android programmatically

…衆ロ難τιáo~ 提交于 2019-12-18 04:18:09
问题 I am trying to make an application like "Bluetooth auto tethering" on play store. I read on the forum that Android is very security-aware and will not enable this setting without user interaction. I need some explanations about how enable bluetooth tethering. Thank you 回答1: I don't know if this is still an issue or not, but I found that using the connect method in the reflection call works. Working off of the code that pmont used from the link in Lorelorelore's answer: BluetoothAdapter

detect hotspot enabling in iOS with private api's

左心房为你撑大大i 提交于 2019-12-17 10:58:20
问题 ok so i want to detect weather the user has enabled hotspot/tethering or not in a iOS device. I can use private api's knowing it wont make it to the app store. i was trying to go through private api's list/ runtime headers but there are too many to decide which might be helpful. or if i could get to know where UIApplicationWillChangeStatusBarFrameNotification gets fired from in private api's(probably called for active call and activated hotspot etc) i tried this detect personal hotspot and

Delphi apps won't tether on Windows 10

蓝咒 提交于 2019-12-11 02:21:45
问题 How do I get Windows 10 or its firewall to allow my Delphi 10.2 tethering app to get access to the internet? When either the desktop or the mobile app is run on Windows 10, there is no request for permission from the firewall and tethering fails. In contrast, the Delphi mobile Photowall tethering example runs fine on Android and iPad, tethering with the matching desktop application on Windows 7 and MacOS. On Windows 7 and Macintosh, the firewall asks for permission when the app is run. 回答1: