<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
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
```
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.
Open Command Prompt (Win + R, type cmd, press Enter).
Type:
ipconfig
Look for the IPv4 Address under your Wi-Fi adapter.
192.168.1.100Open a terminal and type:
ifconfig # (or `ip a` on Linux)
Find the inet address under Wi-Fi (wlan0 or en0).
192.168.1.1004. Access the Laptop from Your Phone
Open a web browser (Chrome, Firefox) on your Android phone.
In the address bar, type:
<http://192.168.1.100:8000>
(Replace 192.168.1.100 with your actual laptop’s IP.)
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.
If your phone can’t connect, try these:
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>