Interconnecting emulators by networ

by Dries Harnie » Sun, 31 Jan 2010 04:14:39 GMT


Sponsored Links
 Hello,

As part of my work on the Android platform I needed emulators to 'see'
each other.
I asked around on the #android IRC channel and apparently this was the
best place to announce my patches.

Currently, emulators are all separated from the real world because
they are in a private subnet, not connected to the outside world.
These patches install a second network card which allows emulators to
talk among themselves.

I have uploaded the patches to Gerrit:

https://review.source.android.com/13244
This patch enables the extra network card in the OS and sets up
multicast routing on this card.

https://review.source.android.com/13243
This patch enables the -my-ip option in the emulator. If this option
is not given, the emulator works exactly like it does now.

During development I also noticed that the "socket" networking of QEMU
is broken. I have fixed this in a separate patch but I did not know
how to make the other patches depend on it:

https://review.source.android.com/13107
This patch fixes networking for QEMU network cards using the "socket"
driver.

If this was not the correct place to publish this information, please
let me know and steer me in the right direction :)

Regards,
Dries Harnie

-- 



Other Threads

1. audio streaming from https site

Hi all
        i am developing multimedia player in android which will play
songs using live audio streaming from different sites. but i am unable
to stream songs which are on HTTPS site.
i am solving this issue from 3 days. i could not find any solution's
on net. has anyone some idea to solve this issue.  please help


thanks in advance i will be very grateful to him

-- 

2. android

Hi all,

I'm running 0.9 in Eclipse 3.3/ADT.
I have a very stripped down one-class app (converted from m5) which
ought to be
presenting a map (that works ok) and then drawing an overlay (it
doesn't).
In onCreate(), a simple overlay (TOverlay) is created and added to
_mapView.getOverlays().
Lastly, mapUpdateHandler.sendEmptyMessage() is called, which should
invalidate the mapView,
and hence cause the overlay to be drawn.


I've copied the code below, and then copied the manifest.
The code has a few System.out.println's to determine flow of control.
All these appear in the LogCat output except the one in the overlay:
"TOverlay.draw".
At the very end I've copied the LogCat output.  One can see the
printlns:


09-09 15:18:06.332: INFO/System.out(695): o2:1
09-09 15:18:06.352: INFO/System.out(695): mUH:msg=101
09-09 15:18:06.352: INFO/System.out(695): mUH:101
09-09 15:18:06.352: INFO/System.out(695): o3: 1


But not the desired "TOverlay.draw"


Any suggestions will be greatly appreciated.
Thanks in advance,
Ken


-------------- Java ----------
package com.herenow.android.quester;


import java.util.List;


public class Quester extends MapActivity
{
        private static final double INIT_CENTER_LAT = 42.3908245;
        private static final double INIT_CENTER_LONG = -71.130993;
        private MapView _mapView;


    @Override
    public void onCreate(Bundle icicle)
    {
        super.onCreate(icicle);
        setContentView(R.layout.main);
        _mapView = new MapView(this, "dummyapikey");
        GeoPoint p = new GeoPoint((int) (INIT_CENTER_LAT * 1000000),
(int) (INIT_CENTER_LONG * 1000000));
        MapController mc = _mapView.getController();


        TOverlay tOver = new TOverlay(_mapView);
        List<Overlay> overlays = _mapView.getOverlays();
        overlays.add(tOver);


        mc.animateTo(p);
        mc.setZoom(15);
        setContentView(_mapView);


        mapUpdateHandler.sendEmptyMessage(101);
List<Overlay> o2 = _mapView.getOverlays();
System.out.println("o2:"+o2.size());
    }
    private Handler mapUpdateHandler
        = new Handler(){
                @Override
                public void handleMessage(Message msg) {
                        System.out.println("mUH:msg="+msg.what);
                    switch (msg.what) {
                          case 101:
                   //         _mapView.invalidate();
                            _mapView.postInvalidate();
                            System.out.println("mUH:101");
                                       break;
                             }
List <Overlay> o3 = _mapView.getOverlays();
System.out.println("o3: "+o3.size());
                     super.handleMessage(msg);
                }
            };


    public class TOverlay extends Overlay
    {
        private Paint plotPaint = new Paint();
        private MapView mapView;


        public TOverlay(MapView mapView){
                this.mapView = mapView;
                plotPaint.setColor(Color.BLUE);
        }


        public synchronized void draw(Canvas canvas, boolean b)
        {
            super.draw(canvas, mapView, b);
System.out.println("TOverlay.draw");


            int lat = (int)(INIT_CENTER_LAT*1E6);
                int lng = (int)(INIT_CENTER_LONG*1E6);
            GeoPoint geopoint = new GeoPoint(lat, lng);


            Point screenCoords = new Point();
            mapView.getProjection().toPixels(geopoint, screenCoords);
            canvas.drawCircle(screenCoords.x, screenCoords.y, 12,
plotPaint);
        }
    }


    public boolean isRouteDisplayed(){
        return false;
    }


}


--------------- Manifest -------------
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.herenow.android.quester">
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:icon="@drawable/icon">
        <activity android:name=".Quester" android:label="@string/
app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <uses-library android:name="com.google.android.maps" />
    </application>
</manifest>

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

3. Add Chrome-lite plugin.

4. How to receive gps enabled/disabled?

5. Immediate need for SQL Server Developer @GA

6. Create a SIP application

7. How to create array object of SharedPreference to store various data