Menu

jmDN S 3.4.1 on Nexus S can't add service

Help
Paolo
2011-09-29
2013-01-24
  • Paolo

    Paolo - 2011-09-29

    Hi,

    I've try to use  jmDNS  3.4.1 first in a Java Application and it worjs correctly. After I try to use jmDNS  3.4.1 on an Android (2.2) app.

    It works on the emultator, but not in my phone.

    I've a Nexus S with Android 2.3.6.

    I've try to use ZeroConf app and it doesn't find any services.

    This is my activity code:

    _

    public class DiscoverServices extends Activity implements ServiceTypeListener {

        @Override
        public void serviceTypeAdded(ServiceEvent event) {
            System.out.println("Service type added: " + event.getType());
        }

        @Override
        public void subTypeForServiceTypeAdded(ServiceEvent event) {
            System.out.println("SubType for service type added: " + event.getType());
        }
       
       
        @Override
        public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.main);
        }
       
       
    @Override
    protected void onResume() {
    super.onResume();
       try
       {
       JmDNS jmdns = JmDNS.create();
    jmdns.addServiceTypeListener(this);

    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
      
        }
    }   

    _

    My phone is correctly connected on wi-fi.

    Any ideas? Is it a known issue?

     
  • Pierre Frisch

    Pierre Frisch - 2011-09-29

    I am no Android expert but I think there are a few things you need to get authorization. I would check the firewall and the application manifest. I my memory senses my right I think someone posted an example on the list a year ago.

    Pierre

     
  • Paolo

    Paolo - 2011-09-29

    Thank you Mr. Pierre.

    There are my permissions on Manifest:

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
      <uses-permission android:name="android.permission.READ_PHONE_STATE"/>

    I haven't install any firewall, so I can't tell you about this.

    Any ideas?

    Thanks!!

     

Log in to post a comment.