<aside> 💡

Driver Lab

This lab turns your laptop into a local web server, allowing your Android phone to access files from it using a web browser.

1. Connect Both Devices to the Same Wi-Fi


2. Start a Python HTTP Server on Your Laptop

  1. Open a terminal or command prompt on your laptop.
  2. Navigate to the folder you want to share using:

Example: If you want to share your Downloads folder:

```bash
cd path/to/folder

```

```bash
cd ~/Downloads  # macOS/Linux
cd C:\Users\YourName\Downloads  # Windows

```
  1. Run the following command to start a web server:

    python -m http.server 8000
    
    

3. Find Your Laptop’s IP Address

Your phone needs to know your laptop’s IP address to connect.

On Windows

  1. Open Command Prompt (Win + R, type cmd, press Enter).

  2. Type:

    ipconfig
    
    
  3. Look for the IPv4 Address under your Wi-Fi adapter.

On macOS/Linux

  1. Open a terminal and type:

    ifconfig  # (or `ip a` on Linux)
    
    
  2. Find the inet address under Wi-Fi (wlan0 or en0).


4. Access the Laptop from Your Phone

  1. Open a web browser (Chrome, Firefox) on your Android phone.

  2. In the address bar, type:

    <http://192.168.1.100:8000>
    
    

    (Replace 192.168.1.100 with your actual laptop’s IP.)

  3. You should now see a list of files from your laptop’s shared folder!

5. Stop the Server (When Done)

When you’re finished, stop the server by going back to your laptop’s terminal and pressing:

Ctrl + C

Now in the real world, the servers that store the information we access are configured to be online all the time.

Why Use This?


⚠️ Troubleshooting

If your phone can’t connect, try these:

  1. Make sure your phone & laptop are on the same Wi-Fi.
  2. Disable firewalls (Windows Defender, macOS Firewall) temporarily.
  3. Try a different port (e.g., 8080 instead of 8000):

Then, access:

```bash
python -m http.server 8080

```

```
<http://192.168.1.100:8080>

```

Would you like help setting up anything specific? 😊

</aside>