Enable/Disable Networking in Emulator

by Matt Payne » Wed, 23 Sep 2009 02:36:28 GMT


Sponsored Links
 According to the emulator docs, you should be able to enable/disable
networking with the F8 key. I doesn't work for me and I'm trying to
determine why.

I'm developing on OSX Leopard. I've also tried in a virtual Windows
instance (Windows 2008 server running in Parallels). No luck in either
case.

I've tried the obvious stuff like fn + F8, etc.

Should there be any sort of visual cue that networking has gone online
or offline when F8 is pressed?

Thanks for any help.

Matt


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



Enable/Disable Networking in Emulator

by Roman ( T-Mobile USA) » Wed, 23 Sep 2009 04:56:42 GMT


 Matt,

I noticed that if you enable the airplane mode (on the real device
networking is disabled), that you can still do networking on the
emulator.

Maybe your observations not being able to switch off networking via
the function keys is related to the airplane mode problem.

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
T  Mobile stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.





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


Sponsored Links


Other Threads

1. Button Mashing Alert Dialog

Hi All

So I have a fairly simple droid app.
Part of it is a waterfall of alertdialog boxes makeing sure everything
is ready to show the final display.

Example
Check GPS
If (no GPS){
alert.show}

The alert has one button that first dismisses the dialog, then
performs the check again, and displays another dialog box if GPS is
still not enabled.

This all works great if I go at a normal pace.
But if I button mash the alert dialog button, eventually I get many
alert dialog buttons on top of each other.

The program still works, ya just gotta close all of them.

Here is some example

    gps_init_alt_bld = new AlertDialog.Builder(this);
    gps_init_alt_bld.setMessage("GPS Not Initialized Yet.")
    .setCancelable(false)
    .setPositiveButton("Check GPS Status Again.", new
DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
                // Action for 'Yes' Button
                if (latitude == 0 || longitude == 0)
                {
                        gps_initialized=false;

                        gps_init_alert = gps_init_alt_bld.create();
                        // Title for AlertDialog
                        gps_init_alert.setTitle("GPS Is Needed!");
                        // Icon for AlertDialog
                        gps_init_alert.setIcon(R.drawable.icon);
                        try{
                        gps_init_alert.show();
                        }
                        catch(Exception eeee){
                                //Log.d("alert","Could NOTTTT THROW INIT 
ALERT2");
                                }
                }
                else
                {
                        gps_initialized=true;
                        dialog.dismiss();
                        onStart();
                }
        }
    });

gps_init_alert = gps_init_alt_bld.create();
//Title for AlertDialog
gps_init_alert.setTitle("GPS Is Needed!");
//Icon for AlertDialog
gps_init_alert.setIcon(R.drawable.icon);

//Log.d("POSITION", "Staring Check Init");
if (latitude == 0 || longitude == 0)
{
        gps_initialized=false;
        try{
        gps_init_alert.show();
        }
        catch(Exception eeeeee){
                //Log.d("alert","Could NOTTTT THROW INIT ALERT");
                }

}

-- 

2. Custom ViewGroup

I am new to Android, and I am trying to understand how to create a
custom ViewGroup.  I created MyViewGroup as follows:

public class MyViewGroup extends ViewGroup {

        public MyViewGroup(Context context) {
                super(context);
                // TODO Auto-generated constructor stub
        }

        @Override
        protected void onLayout(boolean changed, int l, int t, int r, int b)
        {
        }
}

Then in my main class I do the following:

public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TextView tv = new TextView(this);
        MyViewGroup vg = new MyViewGroup(this);
        tv.setText("Some Text");
        tv.layout(0, 30, 200, 40);
        vg.addView(tv);
        setContentView(vg);
    }
}

Now when I run this, my text "Some Text" is shown, but the bottom is
cut off.  It is like the view group in which it is placed is not
filling the entire screen.  Is this what is happening?  If so, how do
I control the sizeof of my MyViewGroup view?

Thanks.

-- 

3. SMDK6410 android lcd porting

4. 100 ms stuttering(lag) in games.

5. Request: Don't make us use Ant

6. Reliable way to programmatically open options menu on startup

7. Install to sd and alarms