Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8089035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:16:38+00:00 2026-06-05T19:16:38+00:00

The scenario is, i’m developing an android app that uses the internet. This is

  • 0

The scenario is, i’m developing an android app that uses the internet. This is a business app. The company will provide android phones to all the employees. Now their requirement is that they don’t want employees to use the internet by other means than by their business app, which requires internet access.

In short i need to develop an app that disable the internet (wifi, mobile data etc.) and allow internet only when user is using this App.

Is this possible? How to achieve this? A service that will always be keeping a check on network connectivity?

Any help is appreciated.

UPDATE:

Im using BroadcastReciever, that detects Connection State and disables the Wifi. How can i detect Connected state of mobile Data, i mean what is the intent filter action to detect mobile data connection and then disable it accordingly, i have tried

<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:16:41+00:00Added an answer on June 5, 2026 at 7:16 pm

    This is something not suggestable but if you still want to do so,

    in onCreate of each activity which uses Internt write this code,

    WifiManager wifiManager = (WifiManager)this.context.getSystemService(Context.WIFI_SERVICE);
    wifiManager.setWifiEnabled(true);
    

    and in onPause of that activty write,

    WifiManager wifiManager = (WifiManager)this.context.getSystemService(Context.WIFI_SERVICE);
    wifiManager.setWifiEnabled(false);
    

    this is to do for WIFI for GPRS/EDGE/3G you might will have to enable disable Airplane mode same way.

    UPDATE TO DO IT FROM EVERYWHERE

    Take one SharedPreference and put one boolean isAppRunning = true every time you go in onCreate() of any of your activity and put False everytime in each activity’s onDestroy() method.

    Now, Create one broadcast receiver that listend to NETWORK_STATE_CHANGED action and in that receiver’s onReceive() check for the SharedPreference value,

    If SP boolean variable is True then Let the WIFI get enabaled and If it’s false means your app is not running then toggle the WIFI off again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: An MVC3 app that uses constructor injection to provide services for a given
Scenario: At our company, we have enabled httpCompression for our website. This website (call
Scenario 1 (That Works) This is a POC i created. I have a script
Scenario: Ruby on Rails app that returns JSON to an iOS application using json-framework
Scenario: I have a console application that needs to access a network share with
Scenario: Most smartphones have a high resolution camera that generates photos that may range
Scenario: I start out in my app's main page. I navigate to sub-page A,
Scenario: I am calling a function that returns a field that the user enters
Scenario: I am working on a Android project where in one particular openGL page,
Scenario: I have an application that has a config table which stores the config

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.