Diabling WiFI or 3G for a given application

by MichelleC » Fri, 07 Jan 2011 02:32:30 GMT


Sponsored Links
 I have a requirement to disable WiFI (or 3G) for a given application
and can install my own system.img on a rooted phone.
For example I wanted to always go 3G for Google Maps.

I was looking at the source code for ConnectivityManager.java. Would
this be where I would change the code. Also is it
possible to obtain the application Id from a method in the
ConnectivityManager class.

Thanks for any insight.

Michelle

-- 



Other Threads

1. process closing unexeptedly in emulator

hi all,
i tried to write a SOAP application where a .net server is running a
method Add in local host and returns an integer value 2000
here is the code for android to connect to local server via SOAP
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import java.*;


import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;


     public class Test extends Activity {
          private Button okButton;

           private int a;
          private static final String SOAP_ACTION = "http://
10.0.2.2:8000/target.asmx/Add";
          private static final String METHOD_NAME = "Add";
          private static final String NAMESPACE = "http://
tempuri.org";
          private static final String URL = "http://10.0.2.2:8000/
target.asmx";

         @Override
         protected void onCreate(Bundle icicle) {
             super.onCreate(icicle);
             setContentView(R.layout.main);


            okButton = (Button) findViewById(R.id.but);
             okButton.setOnClickListener(new View.OnClickListener() {

                 public void onClick(View view) {
                  //   setResult(RESULT_OK);

                     a= mymethod();

                 }
             });
             TextView tv=new TextView(this);
             tv.setText(a);
             setContentView(tv);

         }
         public static int  mymethod() {
           SoapObject request = new SoapObject(NAMESPACE,
METHOD_NAME);


           SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
           envelope.dotNet = true;
           envelope.setOutputSoapObject(request);
           HttpTransportSE androidHttpTransport = new HttpTransportSE
(URL);
           int a=0;

           try {
                androidHttpTransport.call(SOAP_ACTION, envelope);
                  a=(Integer)envelope.getResponse();
           } catch (Exception e) {
                e.printStackTrace();
           }
         return a;


         }
     }

when trying to run in emulator giving error as "PROCESS STOPPED
UNEXCEPTEDLY".....please tell me where is the mistake..... thank you
in advance..

--~--~---------~--~----~------------~-------~--~----~

2. This errors on Second Acvivity

in your sheikanswer.java - try replacing:

TextView txtView = (TextView) this.findViewById(R.id.text);

with

TextView txtView = (TextView) this.findViewById(R.id.sheikanswer);

fix issue?


On Apr 19, 8:25am, "Kevin J. Brooks" <bear123434...@comcast.net>



--~--~---------~--~----~------------~-------~--~----~

3. Help in installing ADT for eclipse

4. Anything like isWifiEnabled and setWifiEnabled for 3g an 2g/gprs?

5. Can not install the Developer Tools

6. Can't install Eclipses plugin on a Mac.

7. How do you pass a reference to non-serializable class to a new Activity?