Using JmDNS in emulator

by gshetty » Sun, 02 Nov 2008 02:50:31 GMT


Sponsored Links
 Hi,

I am trying to use JmDNS to discover the services available in Bonjour
network. I am running my app in the emulator and my system is
connected to LAN and the ip on my system is assgined through a DHCP
server. However when the JmDNS tries tries to find out the ip address
of localhost it gets 127.0.0.1 and the JmDNS does not work for this ip
address.

What should i do so that the emulator uses the ip address of my system
to detect the services in the LAN.

Regards
gshetty

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



Using JmDNS in emulator

by Charlie Collins » Mon, 03 Nov 2008 08:01:04 GMT


 The emulator is acting as it's own device on it's own network segment
(behind a virtual router), basically.
 http://code.google.com/android/reference/emulator.html #emulatornetworking

So, it's not really on the same "LAN."  The emulator has aliases for
the DNS servers the host machine has, and you can redirect host and
guest addresses and ports with the "redir" command - but if you are
trying to dynamically discover stuff on the network segment IT is on,
you won't "see" much.

Assuming you are trying to write something that would be used in the
real world to somehow work with auto-discovered devices on an IP
network, then you probably want to use the WiFi APIs anyway.  The
providers IP network (non WiFi) won't be useful to you anyway, the
carriers don't usually allow you to access that IP address. Getting a
WiFi IP can be done with WifiInfo -
 http://code.google.com/android/reference/android/net/wifi/package-summary.html. 
(The WiFi IP address should pertain to the segment you are on, which I
am guessing is more what you want.)

Also, though this sounds like an interesting app you are working on,
you probably won't be able to work on it in the emulator.  Rather, you
will need a real device. As far as I know the WiFi stuff still is not
supported in the emulator.  (If someone knows better/more, please
correct me, but last I heard no WiFi from the emulator.)









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


Sponsored Links


Other Threads

1. I couldn't find OTA implementation.

I have to implement OTA for GSM.
I have seen OTA implementation on the Phone App.
But it is just for CDMA.
I need OTA for GSM.
maybe there's OTA implementation for GSM in android full source. I
think.
does anybody know this?
I am in panic now. let me out of here~

-- 

2. Find action, category, mimeType, extras info of All installed Applications

I want to get the list of all installed application and all their
information (appName, package name,class name, action,
categoty,mimetype and extras corresponding to the launch Activity of
all installed applications)

I am building a widget platform(not using Android native widget
platform) which can launch installed applications. When the widget
starts, I want to parse through the list of all insatlled
applications, and get all their infomation.

Sam & Paul, I saw your "finding the name of installed application"
posts on Android Developers discussion,

"
PackageManager pm = this.getPackageManager();
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> list = pm.queryIntentActivities(mainIntent, 0);
        for(ResolveInfo info: list)
        {
          Log.w("App browser",
info.activityInfo.applicationInfo.loadLabel( pm ).toString));
        }
"

The question is that I want ALL info of ALL installed applications.
Including action, categoty,mimetype and extras corresponding to the
launch Activity of all installed applications.

Searched for quite long time, I cannot seem to figure out how to
obtain those info about installed applications.

Thanks,
Kangli

-- 

3. ListView scrolling

4. finding screen origin

5. how to create a new image from multiple tiles

6. IllegalStateException Listview

7. Speech Recognizer (RecognizerIntent.ACTION_RECOGNIZE_SPEECH) Not found