Android application to access LAN network

Hi,

I am interested to develop an android application through which i can access the Local area network i.e LAN.

I want to test my application using android emulator.
I have following questions regarding the same.
1. How to build such application which when installed on and android phone, can access the LAN?
2. How to connect the android phone to the LAN?
3. Can we test our application in android emulator?
4. Please provide any complete sample tutorial to build such network application if available.

Eagerly waiting for your valuable advice.
Thanks in advance for your help.