listener - In Android how do you get an activity to continually listen for a message from a server? -
i've tried searching around , can't find answer makes sense.
basically when activity first starts should connect server , continually listen message. when gets it, it'll parse , if it's particular message, close connection , other stuff. should able close if user pushes button.
i tried searching around , can't tell if should use servlets or services or (edit: or how use them). know needs on it's own thread.
so should use?
edit: i'm not sure how use servers/services/etc. make happen
an intentservice
you're gonna want. it's easiest implement , it's perfect network operations. automatically handles running service in own thread. once establish connection server, should stay open until respond message server.
Comments
Post a Comment