MAD MP
MAD MP
MAD MP
MICRO PROJECT
Academic year: 2022-2023
Certificate
Seal of
Institution
Annexure - I
Proposed Methodology:
1. Literature survey.
2. Collect information through different sources
3. Analysis of data.
4. Compilation of collected data.
Roll No Individual
Sr. Process and Total
Name of Students Presentation
No. Product
(04) (10)
assessment (06)
01 1904
Jash Mhatre
02 1905
Satvik Pereira
03 1906
Stalin Rodrigues
Title:
RATIONALE. Android application development is one of the rising and growing trend in the industry of
mobile. This course examines the principles of mobile application design and covers the
necessary concepts which are required to understand mobile based applications and develop
Android based Applications in particular. After completing this course students will design
and build a variety of real-time Apps using Android.
Sr.
Name of resources/Material Specifications Qty Remarks
No.
Processor: i3
1. Computer 1
RAM : 4.00 GB
2. Microsoft Word Word -2016
3. Printer Hp Laser Jet 1
4. Book/Site name
Title:
Institute Code: 0093/1738 Academic year: 2022-2023
Program: CO Course & Code: MAD(22617)
Name of Candidate: Roll No:
Semester: FIFTH Name of Faculty: Prof.Ajay Chawda
2 Literature Survey .
Information Collection
3 Completion of the
Target as per project
proposal
4 Analysis of Data and
representation
5 Quality of
Prototype/Model/Conte
nt
6 Report Preparation
(B) Individual Presentation/Viva Out of 4
7 Presentation .
8 Viva
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/recyclerview"
android:layout_above="@id/addnewnotebtn"
android:layout_below="@id/notestitle"/>
<com.google.android.material.button.MaterialButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Add new note"
android:id="@+id/addnewnotebtn"
android:textColor="#00B0FF"
android:backgroundTint="@color/white"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
MainActivity.java file:
package com.example.note_app;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import io.realm.Realm;
import io.realm.RealmChangeListener;
import io.realm.RealmResults;
import io.realm.Sort;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.google.android.material.button.MaterialButton;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
addNoteBtn.setOnClickListener(new View.OnClickListener() {
@Override
startActivity(new Intent(MainActivity.this,AddNoteActivity.class));
});
Realm.init(getApplicationContext());
Realm realm = Realm.getDefaultInstance();
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(myAdapter);
notesList.addChangeListener(new RealmChangeListener<RealmResults<Note>>() {
@Override
myAdapter.notifyDataSetChanged();
});
}
rounded_corner.xml file:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white"/>
<corners android:radius="8dp"></corners>
</shape>
activity_add_note.xml:
<LinearLayout 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"
android:orientation="vertical"
android:background="#00B0FF"
android:padding="20dp"
tools:context=".AddNoteActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/titletextview"
android:textColor="@color/white"
android:textSize="25dp"
android:textStyle="bold"
android:gravity="center"
android:layout_margin="20dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp"
android:layout_margin="10dp"
android:background="@drawable/rounded_corner">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/titleinput"
android:hint="Title"
android:background="#3000B0FF"
android:padding="10dp"
android:layout_margin="10dp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/descriptioninput"
android:hint="Decription"
android:background="#3000B0FF"
android:padding="10dp"
android:layout_margin="10dp"
android:lines="10"
android:gravity="top"/>
</LinearLayout>
<com.google.android.material.button.MaterialButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/savebtn"
android:text="SAVE NOTE"
android:layout_gravity="center"
android:backgroundTint="@color/white"
android:textColor="#00B0FF"/>
</LinearLayout>
Note.java file:
import io.realm.RealmObject;
String title;
String description;
long createdTime;
return title;
this.title = title;
return description;
this.description = description;
return createdTime;
this.createdTime = createdTime;
}
AddNoteActivity.java file:
import androidx.appcompat.app.AppCompatActivity;
import io.realm.Realm;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.material.button.MaterialButton;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_note);
Realm.init(getApplicationContext());
saveBtn.setOnClickListener(new View.OnClickListener() {
@Override
note.setTitle(title);
note.setDescription(description);
note.setCreatedTime(createdTime);
realm.commitTransaction();
Toast.makeText(getApplicationContext(),"Note saved",Toast.LENGTH_SHORT).show();
finish();
});
item_view.xml file:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/rounded_corner"
xmlns:tools="http://schemas.android.com/tools">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/titleoutput"
android:textSize="20dp"
android:textColor="@color/black"
tools:text="My title"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/descriptionoutput"
android:layout_below="@id/titleoutput"
android:textColor="#393939"
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/timeoutput"
android:layout_below="@id/descriptionoutput"
android:textSize="12dp"
android:gravity="end"
android:textColor="#858484"
</RelativeLayout>
MyAdapter.java file:
import android.content.Context;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.PopupMenu;
import android.widget.TextView;
import android.widget.Toast;
import org.w3c.dom.Text;
import java.text.DateFormat;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import io.realm.Realm;
import io.realm.RealmResults;
Context context;
RealmResults<Note> notesList;
this.context = context;
this.notesList = notesList;
@NonNull
@Override
@Override
holder.titleOutput.setText(note.getTitle());
holder.descriptionOutput.setText(note.getDescription());
holder.timeOutput.setText(formatedTime);
holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
menu.getMenu().add("DELETE");
menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
if(item.getTitle().equals("DELETE")){
realm.beginTransaction();
note.deleteFromRealm();
realm.commitTransaction();
Toast.makeText(context,"Note deleted",Toast.LENGTH_SHORT).show();
return true;
});
menu.show();
return true;
});
@Override
return notesList.size();
TextView titleOutput;
TextView descriptionOutput;
TextView timeOutput;
super(itemView);
titleOutput = itemView.findViewById(R.id.titleoutput);
descriptionOutput = itemView.findViewById(R.id.descriptionoutput);
timeOutput = itemView.findViewById(R.id.timeoutput);
}
Output :