0% found this document useful (0 votes)
49 views11 pages

MAD Report ASTN PDF

MAD Report ASTN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views11 pages

MAD Report ASTN PDF

MAD Report ASTN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Latthe Education Society's Polytechnic, Sangli

Department of computer engineering

Micro-Project Report

Subject: Mobile Application Development

Title:Notes app.

Submitted by

Roll No Student Name Enrollment No

223313 Ayush Borgave 2000430226

223314 Sarthak Shriram 2000430215

223315 Tejas chougule 2000430227

223316 Nihar kinikar 2000430229


Latthe Education Society’s Polytechnic, Sangli
Department of Computer Engineering

CERTIFICATE
This is to certify that this micro project is submitted in partial fulfillment
of progressive assessment in the course Mobile Application Development
(22617) of sixth semester Diploma in Computer Engineering for the
academic year 2022-23 as prescribed in the curriculum.

Roll No Student Name Enrollment No

223313 Ayush Borgave 2000430226

223314 Sarthak Shriram 2000430215

223315 Tejas chougule 2000430227

223316 Nihar kinikar 2000430229

Course coordinator
● Rationale
Notes app is used for making short text notes, updating when you need them, and trash
when you are done. It can be used for various functions as you can add your to-do list in
this app, some important notes for future reference, etc. The app is very useful in some
cases like when you want quick access to the notes. Likewise, here let’s create an
Android App to learn how to create a simple NotesApp. So in this article let’s build a
Notes App in which the user can add any data, remove any data as well as edit any data.
A sample GIF is given below to get an idea about what we are going to do in this article.
Note that we are going to implement this project using the Java language

● Aim of Micro-Project
The aim of this project is to build a Notes app using android studio.

● Course Outcomes Achieved

 Display messages on screen using mobile application development tools


 Demonstrate use of Classes and Objects.
 Develop functions for given problem.
 Design classes for given problem

● Actual Methodology Followed


In this micro-project we will prepare a GUI for a Notes app. We will use various
classes and object methods for the app. We will use the various layouts for designing
the GUI.
● Actual Resources Used

Sr. No. Name of Resource Specification Quantity Remark

01 Laptop i3, 8Gb Ram, 1TB HDD 1

02 Text editor Android studio 1

03 java Jdk 9.0 1


● Source code
MainActivity.java
package com.example.notes;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import java.util.ArrayList;
import java.util.HashSet;

public class MainActivity extends AppCompatActivity {

static ArrayList<String> notes = new ArrayList<>();


static ArrayAdapter arrayAdapter;

@Override
public boolean onCreateOptionsMenu(Menu menu) {

MenuInflater menuInflater = getMenuInflater();


menuInflater.inflate(R.menu.add_note_menu, menu);

return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
super.onOptionsItemSelected(item);

if (item.getItemId() == R.id.add_note) {

// Going from MainActivity to NotesEditorActivity


Intent intent = new Intent(getApplicationContext(), NoteEditorActivity.class);
startActivity(intent);
return true;
}

return false;
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

ListView listView = findViewById(R.id.listView);


SharedPreferences sharedPreferences =
getApplicationContext().getSharedPreferences("com.example.notes",
Context.MODE_PRIVATE);
HashSet<String> set = (HashSet<String>) sharedPreferences.getStringSet("notes",
null);

if (set == null) {

notes.add("Example note");
} else {
notes = new ArrayList(set);
}

// Using custom listView Provided by Android Studio


arrayAdapter = new ArrayAdapter(this,
android.R.layout.simple_expandable_list_item_1, notes);

listView.setAdapter(arrayAdapter);

listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long
l) {

// Going from MainActivity to NotesEditorActivity


Intent intent = new Intent(getApplicationContext(), NoteEditorActivity.class);
intent.putExtra("noteId", i);
startActivity(intent);

}
});

listView.setOnItemLongClickListener(new
AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> adapterView, View view, int
i, long l) {

final int itemToDelete = i;


// To delete the data from the App
new AlertDialog.Builder(MainActivity.this)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle("Are you sure?")
.setMessage("Do you want to delete this note?")
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
notes.remove(itemToDelete);
arrayAdapter.notifyDataSetChanged();
SharedPreferences sharedPreferences =
getApplicationContext().getSharedPreferences("com.example.notes",
Context.MODE_PRIVATE);
HashSet<String> set = new HashSet(MainActivity.notes);
sharedPreferences.edit().putStringSet("notes", set).apply();
}
}).setNegativeButton("No", null).show();
return true;
}
});
}
}

NoteEditer.java
package com.example.notes;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
import java.util.HashSet;

public class NoteEditorActivity extends AppCompatActivity {


int noteId;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_note_editor);

EditText editText = findViewById(R.id.editText);

// Fetch data that is passed from MainActivity


Intent intent = getIntent();

// Accessing the data using key and value


noteId = intent.getIntExtra("noteId", -1);
if (noteId != -1) {
editText.setText(MainActivity.notes.get(noteId));
} else {

MainActivity.notes.add("");
noteId = MainActivity.notes.size() - 1;
MainActivity.arrayAdapter.notifyDataSetChanged();

editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
{

// add your code here


}

@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
MainActivity.notes.set(noteId, String.valueOf(charSequence));
MainActivity.arrayAdapter.notifyDataSetChanged();
// Creating Object of SharedPreferences to store data in the phone
SharedPreferences sharedPreferences =
getApplicationContext().getSharedPreferences("com.example.notes",
Context.MODE_PRIVATE);
HashSet<String> set = new HashSet(MainActivity.notes);
sharedPreferences.edit().putStringSet("notes", set).apply();
}

@Override
public void afterTextChanged(Editable editable) {

// add your code here


}
});
}
}

activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ListView
android:id="@+id/listView"
android:layout_width="409dp"
android:layout_height="601dp"
android:layout_marginTop="80dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center_horizontal"
android:text="Notes App"
android:textColor="@android:color/holo_green_dark"
android:textSize="30sp"
app:layout_constraintBottom_toTopOf="@+id/listView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

Activity_note_editor.xml

<?xml;version="1.0";encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".NoteEditorActivity">

<EditText
android:id="@+id/editText

android:layout_width="0dp"
android:layout_height="0dp"
android:ems="10"
android:gravity="top|left"
android:inputType="textMultiLine"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

● Output
App Home

Add Note
After adding note

Delete Note
● Skill developed / Learning out of This Micro-Project
From this micro-project I developed the following skills :

 Creating Notes app using android studio


 Handling Intent in android.
 To get the input from user and store them in device.
 The input/notes can also updated and deleted when user want.

● Application of this Micro-Project


 This application has easy user interface.

 This application can be used as lightweight notes apps that avoid


paperwork.

● Actual Date of Execution

Sr. No. Details of activity Actual start Actual end Name of Responsible
date date team member

01 Preparing project of 1 apr, 2023 10 apr, 2023 Ayush Borgave


android Notes app Sarthak Shriram
Tejas chougule
Nihar Kinikar

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy