Lab Assignment 1: Setting Up Development Environments for
Python and Kivy
Course Code: IIT221
Course Title: Mobile Application Development
Lecturer: Mr. T. Butsa
Total Marks: 20
Duration: 2 Hours
Objective
The goal of this lab is to set up the necessary tools and environments for
mobile app development using Python and Kivy. By the end of this lab,
students will:
1. Install Python and required libraries.
2. Set up Kivy for mobile app development.
3. Create and run a simple "Hello World" app using Kivy.
Lab Tasks
Task 1: Install Python and Required Libraries (5 Marks)
1. Download and install Python from the official
website: https://www.python.org/downloads/.
o Ensure you check the box to Add Python to PATH during
installation.
2. Open a terminal or command prompt and verify the installation:
bash
Copy
python --version
3. Install the required libraries using pip:
bash
Copy
pip install kivy
Deliverable:
Take a screenshot of the terminal showing the installed Python
version and Kivy library.
Submit the screenshot as part of your lab report.
Task 2: Set Up Kivy and Create a "Hello World" App (10 Marks)
1. Create a new Python file named main.py.
2. Write the following code to create a simple "Hello World" app using
Kivy:
python
Copy
from kivy.app import App
from kivy.uix.label import Label
class HelloWorldApp(App):
def build(self):
return Label(text="Hello, World!")
if __name__ == "__main__":
HelloWorldApp().run()
3. Run the app using the following command:
bash
Copy
python main.py
4. Verify that the app opens and displays "Hello, World!" on the screen.
Deliverable:
Take a screenshot of the running "Hello World" app.
Submit the screenshot as part of your lab report.
Task 3: Test the App on an Android Device (5 Marks)
1. Install Buildozer, a tool to package Python apps for Android:
bash
Copy
pip install buildozer
2. Initialize Buildozer in your project directory:
bash
Copy
buildozer init
3. Edit the buildozer.spec file to configure your app (e.g., set the app
name, package name, and requirements).
4. Build the APK file for Android:
bash
Copy
buildozer -v android debug
5. Transfer the generated APK file to your Android device and install it.
Deliverable:
Take a screenshot of the app running on your Android device.
Submit the screenshot as part of your lab report.
Lab Report Submission
Submit a PDF document (to tbutsa@hit.ac.zw) containing:
1. Screenshot of the terminal showing Python and Kivy installation
(Task 1).
2. Screenshot of the "Hello World" app running on your computer (Task
2).
3. Screenshot of the app running on your Android device (Task 3).
4. A brief reflection (100–200 words) on the setup process. Mention
any challenges you faced and how you resolved them.