title: What's the core difference between fragment and activity? Which code can be written in fragment?
body: <p>I have three tabs with three fragments each and one main activity, and i want to create the socket to send the message over wifi network, so where should i write the code for it? In that particular fragment class or main activity?</p>