Develop A Dynamic To Do App Using Flask
Develop A Dynamic To Do App Using Flask
[Document subtitle]
[DATE]
[Company name]
[Company address]
MIC
RO PROJECT
REPORT ON
CMRINSTITUTEOF TECHNOLOGY
(UGCAUTONOMUS)
(Approved by AICTE, Affiliated to JNTU, Kukatpally, Hyderabad)
Kandlakoya, Medchal Road, Hyderabad
2024-2025
CMR INSTITUTE OF TECHNOLOGY
(UGCAUTONOMUS)
(Approved by AICTE, Affiliated to JNTU, Kukatpally, Hyderabad)
Kandlakoya, Medchal Road, Hyderabad.
CERTIFICATE
This is tocertifythataMicroProjectentitledwith:“DevelopadynamicToDoApp”is being
Submitted By
M.Varun Kumar (22R01A0508)
R.Rahul (22R01A67B9)
M.Lavan Reddy (22R01A67A9)
We express our thanks to all staff members and friends for all the help and
coordination extended in bringing out this Project successfully in time.
Finally, we are very much thankful to our parents and relatives who guided directly or
indirectly for successful completion of the project.
CONTENTS
7. References 11
INTRODUCTION
This Android app is a basic to-do list application that allows users to add and remove tasks. It
provides a straight forward user interface with an input field for entering tasks, an "Add
Task" button to add tasks to the list, and a List View to display the tasks.
Adding Tasks:
Users can type a task in the provided input field and click the "Add Task" button to add it to
the list.
Removing Tasks:
To remove a task, users can long-press on the task in the list, triggering the removal
functionality.
How To Use:
• Run the app on your Android device or emulator.
• Enter a task, click "Add Task", and see it appear in the list.
• Remove tasks by tapping on them.
This simple app is designed for learning purposes and serves as a starting point for
understanding fundamental concepts in Android app development, including user interface
elements and event handling.
FLOWCHART
Start of program
|
|
Initialize Task list
|
|
Display Empty Screen
(Input Field, Button and
Empty List)
|
|
User Enters a Task and
Clicks on “Add Task”
|
|
Add Task to List
|
|
Update Displayed list
|
|
User Long-Presses task
To remove from list
|
|
Remove Task from List
|
|
Update Displayed List
|
|
End of Program
This simple flow chart provides a high-level over view of how the app works, from the start
to the end of the program.
REQUIREMENTS
Hardware Requirements:
Computer:
A modern computer with decent processing power.
Memory (RAM):
At least 8 GB RAM for a smooth development experience.
Disk Space:
Keep 4-8 GB of free space on your computer.
Processor:
A multi-core processor, preferably 64-bit.
Software Requirements:
Operating System:
Windows10, Mac OS 10.14 or later, or Ubuntu 18.0 4 or later.
Android Studio:
Download and install Android Studio.
Follow the setup instructions for your operating system.
APP.PY CODE :
app = Flask(_name_)
@app.route('/')
def index():
return render_template('index.html', tasks=tasks)
@app.route('/add', methods=['POST'])
def add_task():
task_description = request.form['task']
hours = request.form['hours']
minutes = request.form['minutes']
ampm = request.form['ampm']
return redirect('/')
@app.route('/complete/<int:task_id>', methods=['POST'])
def complete_task(task_id):
if 0 <= task_id < len(tasks):
tasks[task_id]['completed'] = not tasks[task_id]['completed']
return redirect('/')
if _name_ == '_main_':
app.run(debug=True)
index.html :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>To-Do List</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #0085f1;
}
div {
background-color: rgb(7, 255, 218);
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 400px;
text-align: center;
}
ul {
list-style-type: none;
padding: 0;
}
li {
padding: 10px;
margin: 5px 0;
transition: background-color 0.3s, text-decoration 0.3s;
}
li.completed {
text-decoration: line-through;
color: gray;
}
button {
margin-top: 10px;
}
select {
margin: 0 5px;
}
</style>
</head>
<body>
<div>
<h1>To-Do List</h1>
<form action="/add" method="POST">
<input type="text" name="task" placeholder="Add a new task"
required>
<select name="hours" required>
{% for hour in range(1, 13) %}
<option value="{{ hour }}">{{ hour }}</option>
{% endfor %}
</select>
<select name="minutes" required>
{% for minute in range(0, 60, 5) %}
<option value="{{ '%02d' | format(minute) }}">{{ '%02d' |
format(minute) }}</option>
{% endfor %}
</select>
<select name="ampm" required>
<option value="AM">AM</option>
<option value="PM">PM</option>
</select>
<button type="submit">Add Task</button>
</form>
{% for task in tasks %}
<li class="{{ 'completed' if task.completed else '' }}">
<form action="/complete/{{ loop.index0 }}" method="POST"
style="display: inline;">
<label>
<input type="checkbox" onchange="this.form.submit()" {% if
task.completed %}checked{% endif %}>
{{ task.task }} - {{ task.time }}
</label>
</form>
</li>
{% endfor %}
</ul>
</div>
</body>
</html>
OUTPUT
CONCLUSION
In summary, the dynamic to-do app for Android, coded in Java, provides a user-friendly
interface for adding and removing tasks. The app's dynamic List View ensures real-time
updates, demonstrating key Android development concepts. Developers must meet hardware
and software requirements, including JDK and Android Studio installation. This app serves as
a foundational example for beginners, offering room for expansion and customization in
future projects.
REFERENCES