简体   繁体   English

如何以编程方式禁用 android 中其他应用程序的网络使用?

[英]how to disable network usage for other application in android programmatically?

i have bought new android 10 just some days ago.几天前我刚刚购买了新的 android 10。 i was using android nought for a long time.我使用 android 很久了。 i was looking in the setting and i found that i can restrict particular application for using mobile data.我正在查看设置,我发现我可以限制特定应用程序使用移动数据。

i tried and turned off mobile data for many application and i found that, restricted apps were not able to access interent and my battery life has become much more longer.我尝试关闭了许多应用程序的移动数据,我发现受限应用程序无法访问互联网,我的电池寿命变得更长了。

i am android developer and i had created an application like Alarm manager which notifies user on battery charging on specific percentage than had added something like battery saver, which basically does nothign except showing ad.我是 android 开发人员,我创建了一个像警报管理器这样的应用程序,它通知用户电池充电的特定百分比,而不是添加了像电池保护程序这样的东西,除了显示广告之外基本上没有任何作用。 so i decided that how can i add this mobile data restriction feature to my app.所以我决定如何将这个移动数据限制功能添加到我的应用程序中。

i tried to google it but found nothing, i guess i need to make my application Admin, i don't have much idea about admin but i know that i would be able to make as many changes as i want in my application.我试图用谷歌搜索,但什么也没找到,我想我需要让我的应用程序成为管理员,我对管理员不太了解,但我知道我可以在我的应用程序中进行尽可能多的更改。

is any body has idea what can i do in this situation.有没有人知道在这种情况下我能做什么。 i have not seen any simliar app on play store as well.我也没有在 Play Store 上看到任何类似的应用程序。 but it could be possible that i would have missed those apps.但我可能会错过这些应用程序。

I don't think you can toggle connectivity for other apps from your own app, doesn't seem like the system would allow that.我不认为您可以从自己的应用程序切换其他应用程序的连接性,系统似乎不允许这样做。 You COULD look into a VPN app that can inspect network connectivity, and block requests from specific apps.您可以研究一个可以检查网络连接并阻止来自特定应用程序的请求的 VPN 应用程序。 But I'm not sure how much battery that would save you.但我不确定这将为您节省多少电池。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Android中以编程方式在网络上查找其他WiFi设备的IP地址 - How to find IP address of OTHER WiFi Devices on network programmatically in android Android:如何以编程方式确定 android 中的网络速度 - Android: How to determine Network speed in android programmatically 如何在Android中以编程方式增加RAM使用率? - How to increase RAM usage programmatically in Android? Android如何计算网络使用数据包/数据 - Android How to calculate network usage packet/data 如何以编程方式忘记android中的无线网络? - How to forget a wireless network in android programmatically? 如何在android中以编程方式启用或禁用隐身键盘? - How to enable or disable incognito keyboard programmatically in android? 如何在Android中以编程方式禁用拼写更正 - How to disable spelling corrections programmatically in Android 如何在Android中以编程方式禁用移动数据连接? - How to disable mobile data connection in android programmatically? 以编程方式在Android上禁用GPS - Disable GPS on Android Programmatically Android 8+ - 如何在 android 中以编程方式连接到 wifi 网络? - Android 8+ -How to connect to wifi network programmatically in android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM