android - How I can use socket on this code? -


i want establish connection between android client , pc server.

but knowledge in socket not yet enough, maybe can me code codes need add. have button named connect create connection between pc server , mobile client if pressed it. there log message if successfull or not. hope can me.

here code:

package ph.roprovider.connection;  import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.button;   public class mainactivity extends appcompatactivity {     @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_main);          button button = (button) findviewbyid(r.id.connect);         button.setonclicklistener(new view.onclicklistener() {             public void onclick(view v) {                 // code here executes on main thread after user presses button             }         });     }  } 

you learn more socket io or socket libraries

http://socket.io/blog/native-socket-io-and-android


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -