Using JmDNS in emulator

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

Sponsored Links

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 and the JmDNS does not work for this ip

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



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. #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 - 
(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. Chronometer with Android 2.1 issue

I have an app that plays Podcasts for I have released
it to the public via Google Code (
guys/) and I have received complaints from Nexus One owners and have
even confirmed myself in the 2.1 emulator, that whenever I click "Play
Podcast" I get a Force Close. Works perfectly fine on any other

I have narrowed down the issue to these two lines of code involving
the Chronometer.


The two other things that happen when you click "Play Podcast"  is the
creation of a notification in the notification slide window, and plays
a streaming mp3 file.

What could cause this to force close in specifically Android 2.1?


2. Pre Order Indosat Android Exp

Ehem kayaknya ada yg kurang nih.

Salam kenal semua, sy lg rencana ambil android, kebetulan ada promo
ini, lumayan juga nih... banyak pilihan variasi harga...

 Indosat Android Expo

Dapatkan handset android dengan harga khusus di Indosat Android Expo,
expo khusus android yang pertama di Indonesia.

HTC Hero

Harga normal: Rp 5.250.000
Harga Pre-Order: Rp 4.999.000

Bonus Pre-Order:
Aplikasi GPS Teleatlas dengan lisensi 1 tahun penuh

 indosat android motorola

Motorola Milestone

Harga normal: Rp 6.250.000
Harga Pre-Order: Rp 5.999.000

Bonus Pre-Order:
Aplikasi GPS Teleatlas dengan lisensi 1 tahun penuh

 indosat android samsung        Samsung Galaxy Spica

Harga normal: Rp 3.499.000
Harga Pre-Order: Rp 2.999.000

Bonus Pre-Order:

   * 2 ekslusive Samsung Galaxy Spica Android T-Shirt
   * Starter Pack
   * Layanan Paket Data unlimited 1 bulan

 indosat android LG     LG GW 620

Harga normal: Rp 4.399.000
Harga Pre-Order: Rp 3.499.000

Bonus Pre-Order:
Buletooth Handsfree Prada

 indosat android huawei         Huawei U8230

Harga normal: Rp 3.799.000
Harga Pre-Order: Rp 3.499.000

Bonus Pre-Order:
Free SD Card berisi 20 Top Aplikasi, Pouch dan Gimmick2 menarik.

"Indonesian Android Community [id-android]"

3. Touch Keyboard

4. Req. Apk Doc2Go..

5. PopupWindow on activity start

6. SQLiteDiskIOException happens when querying 4000 rows data with order by japanese kanji

7. LinearLayout Questions