0% found this document useful (0 votes)
188 views64 pages

Intership Report Aditya

An internship report is a summary of what an intern learned during their time at a specific company.035 It should be professionally written and describe the experience, type of role, and skills gained during the internship.3 The report informs the internship manager or educator about the lessons and skills learned and the opportunities they had to apply those skills.
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)
188 views64 pages

Intership Report Aditya

An internship report is a summary of what an intern learned during their time at a specific company.035 It should be professionally written and describe the experience, type of role, and skills gained during the internship.3 The report informs the internship manager or educator about the lessons and skills learned and the opportunities they had to apply those skills.
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/ 64

Android App Development Using Android Studio

Gujarat Technological University, Ahmedabad


AN INTERNSHIP REPORT
On
“Android App Development Using Android Studio”
Subject code: 3170001
BACHELOR OFENGINEERING In
Computer Engineering

Submitted to: Submitted by:

Mrs. Avani N. Patel Aditya Pandit


Assistant Professor 190940107006

Department of Computer Engineering Department of Computer Engineering


VIEAT, Kim (094) VIEAT, Kim (094)

Vidhyadeep Institute of Engineering and Technology

Computer Engineering Department

June 2022

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 I
Android App Development Using Android Studio

Vidhyadeep Institute of Engineering and Technology


Anita Kim, Road, Olpad, Gujarat 394540.

DECLARATION
I hereby declare that this project work is an authentic record of my own work done
under the supervision of my mentor Mr. Darshan Chauhan at 214, Golden Square,
NR.D-Mart, Mota - Varachha, Surat and Internal Guide Mrs. Avani N. Patel,
Assistant Professor, Computer Engineering Department, VIEAT, Anita, Kim. This
project work is only meant for submission to the Computer Engineering
department, Vidhyadeep Institute of Engineering and Technology, as the
requirement of 2-week industrial training. All the data used in calculations is
correct to best of my knowledge and observed practically at the site

Aditya Pandit

(190940107006)

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 II
Android App Development Using Android Studio

CERTIFICATE

This is to certify that project work embodied in this report entitled “Android App
Development Using Android Studio” has been carried out by Pathan Aditya
Pandit (190940107006) at “Infinite Developers, at 303, Atlanta Mall, Mota -
Varachha, Surat” for Bachelors of Engineering at Vidhyadeep Institute of
Engineering & Technology, Kim (094)affiliated by Gujarat Technological
University. This Internship project work has been carried out under my supervision
and to the satisfaction of department. The student work has been accepted for
publication.

Date:

Place:

Signature of Guide Signature of HOD

Mrs. Avani Patel Mr. Tejas Rana

Assistant Professor Head of Department

CE, VIEAT, KIM. CE, VIEAT,KIM.

Signature of External Examiner

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 III


Android App Development Using Android Studio

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 IV
Android App Development Using Android Studio

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 V
Android App Development Using Android Studio

ACKNOWLEDGEMENT

I am greatly thankful to “Vidhyadeep Institute of Engineering and Technology”


for providing us a platform that enhanced our skill and “Gujarat Technological
University” to allow us to represent our skill and interest to the field of Computer
Engineering world.

I would also like to thank Mr. BhavikBhai Jinjala, at 303, Atlanta Mall, Mota -
Varachha, Surat for giving me the opportunity to work on the prestigious project.
The internship opportunity I had with Infinite Developers was a great chance for
learning and professional development. Therefore, I consider myself as a very
lucky individual as I was provide with an opportunity to be a part of it

I express my deepest thanks to place to my Guide Mrs. Avani N. Patel, Assistant


Professor, Computer Engineering Department, VIEAT, Anita, Kim for taking part
in useful decision & giving necessary advices and guidance, motivation, constant
inspiration and above all for her ever-co-operating attitude that enabled us in
bringing up this project in the present form

I would like to thank Mr. Tejas Rana Head of the Computer Engineering
Department, for his valuable advice and providing necessary facilities for our
project work.

I perceive as this opportunity as a big milestone in my career development. I will


strive to use gained skills and knowledge in the best possible way and I will
continue to work on my improvement, in order to desired career objectives

Name Enrollment Number

Aditya pandit 190940107006

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 VI
Android App Development Using Android Studio

EXECUTIVE SUMMARY

The 2-week Summer Internship Program at Infinite Developers Company for


Multistory building is a vital part of the 1-year BE Computer Engineering Course.
Since majority of the students come without any prior work experience, the
Summer Internship adds worth to their CVs by giving each student immense
learning. At Infinite Developers Company, a student can bag an internship
through various means since the company gives us ample opportunities to interact
with industry experts.

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 VII


Android App Development Using Android Studio

ABOUT THE COMPANY


Durvasa InfoTech is a professional IT services firm dedicated to giving the very
best of the IT services with a focus on standard quality work, uniqueness, and best
user experience. Durvasa InfoTech is located in Surat, Gujarat (India), and is
happy to offer its expertise in Professional IT Services and Training. The tried and
true system is based on over 3+ years of cumulative experience shared between
teams. Much of today’s business is transacted over the web or over the phone
without an in-person meeting. By taking care of our busy clients they’re providing
24*7 work support on demand. The firm offers various services like Application
development, Web development, Web designing, Digital Marketing, Project
training, etc.

COMPANY PROJECTS
 App Development
 Website Development
 Software Development
 Digital Marketing
 Search Engine Optimization
 Uiux Design
 Graphics Design
 E-Commerce Development
 Accounting And ERP Solutions
 Game Development

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 VIII


Android App Development Using Android Studio

TABLE OF CONTENTS
Title Page No.
Title page I

Declaration II

Certificate III

Joining letter IV

Completion Certificate V

Acknowledgement VI

Executive Summary VII

About the Company VIII

Company Projects VIII

CONTENTS

Chapter:1 Introduction of Internship 1

1.1 General Introduction 2

1.2 Justification of internship 2

1.3 Aim of the study 2

1.4 Objective of the study 2

1.5 Scope of the study 2

1.6 Need of the study 2

Chapter:2 Android App Development Using Android Studio 3


VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 IX
Android App Development Using Android Studio

Chapter:3 Weekly progress 7


3.1 List of Activities involved 8
3.2 Week-1 Progress 9
3.3 Week-2 Progress 20

Chapter:4 Case study 36


4.1 Description and process 36

Chapter:5 Opportunities 42
5.1 What roles you served? 43
5.2 What work you carried out? 43
5.3 What contribution you made to company? 43

Chapter:6 Learning 44

Chapter:7 Challenges Faced 46

Chapter:8 References 48

Chapter:9 Conclusion 50

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 X
Android App Development Using Android Studio

Chapter: 1 Introduction of Internship

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XI
Android App Development Using Android Studio

Introduction of Internship
1.1 General Introduction of Internship
An internship is a period of work experience offered by an organization for a
limited period of time. The Internship Programs aim to provide our students
the opportunity to consolidate their theoretical foundation through practical
experience. The students can explore their interest in future career
development.
1.2 Justification of internship
An objective for this position should emphasize the skills you already
possess in the area and your interest in learning more Some internship is used
to allow individuals to perform scientific research while others are
specifically designed to allow people to gain first-hand experience working.
1.3 Aim of the study
Internship utilized in a number of different career fields, like engineering,
medical field, economics, advertising and many more which is good for the
students to gain first-hand experience working.
1.4 Objective of the study
This is Summer Internship 2022(B.E. 7th Semester) report which defines my
achievement, work in field of web development and my professional growth
during this 15th days period of time.
1.5 Scope of the study
This internship report gives an experience of a professional work and the
challenging task that is faced by me in Durvasa Infotech which is very good
for me and it is encourage me. As well as it also provides a brief description
of Durvasa Infotech for the students who are interested about Durvasa
Infotech for their professional growth.
1.6 Need of the study
Internship is a way to build the work experience, professional behavior at
the corporate world. It is also helpful for develop the technical as well as
non-technical skills that can be emphasized in the resume for future jobs. It is
also helpful for the fresher’s or developers to improve chance of the higher
position.

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XII


Android App Development Using Android Studio

Chapter: 2 Android App Development Using Studio

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XIII


Android App Development Using Android Studio

Introduction of Android App Development Using Android Studio


Android operating system is the largest installed base among various mobile
platforms across the globe. Hundreds of millions of mobile devices are powered by
Android in more than 190 countries of the world. It conquered around 71% of the
global market share by the end of 2021, and this trend is growing bigger every
other day. The company named Open Handset Alliance developed Android for the
first time that is based on the modified version of the Linux kernel and other open-
source software. Google sponsored the project at initial stages and in the year
2005, it acquired the whole company. In September 2008, the first Android-
powered device was launched in the market. Android dominates the mobile OS
industry because of the long list of features it provides. It’s user-friendly, has huge
community support, provides a greater extent of customization, and a large number
of companies build Android-compatible smartphones. As a result, the market
observes a sharp increase in the demand for developing Android mobile
applications, and with that companies need smart developers with the right skill
set. At first, the purpose of Android was thought of as a mobile operating system.
However, with the advancement of code libraries and its popularity among
developers of the divergent domain, Android becomes an absolute set of software
for all devices like tablets, wearables, set-top boxes, smart TVs, notebooks, etc.

Features of Android
Android is a powerful open-source operating system that open-source provides
immense features and some of these are listed below.

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XIV


Android App Development Using Android Studio

 Android Open Source Project so we can customize the OS based on our


requirements.
 Android supports different types of connectivity for GSM, CDMA, Wi-Fi,
Bluetooth, etc. for telephonic conversation or data transfer.
 Using wifi technology we can pair with other devices while playing games
or using other applications.
 It contains multiple APIs to support location-tracking services such as GPS.
 We can manage all data storage-related activities by using the file manager.
 It contains a wide range of media supports like AVI, MKV, FLV, MPEG4,
etc. to play or record a variety of audio/video.
 It also supports different image formats like JPEG, PNG, GIF, BMP, MP3,
etc.
 It supports multimedia hardware control to perform playback or recording
using a camera and microphone.
 Android has an integrated open-source WebKit layout-based web browser to
support User Interfaces like HTML5, and CSS3.
 Android supports multi-tasking means we can run multiple applications at a
time and can switch between them.
 It provides support for virtual reality or 2D/3D Graphics.

Android Versions
Google first publicly announced Android in November 2007 but was released on
23 SEPTEMBER 2008 to be exact. The first device to bring Android into the
market was the HTC Dream with the version Android 1.0. Since then, Google
released a lot of android versions such as Apple Pie, Banana Bread, Cupcake,
Donut, Éclair, Froyo, Gingerbread, Jellybeans, Kitkat, Lollipop, marshmallow,
Nougat, Oreo, etc. with extra functionalities and new features.

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XV
Android App Development Using Android Studio

Programming Languages used in Developing Android Applications


1. Java
2. Kotlin
Developing the Android Application using Kotlin is preferred by Google, as Kotlin
is made an official language for Android Development, which is developed and
maintained by JetBrains. Previously before Java is considered the official language
for Android Development. Kotlin is made official for Android Development in
Google I/O 2017.

Advantages of Android Development


 The Android is an open-source Operating system and hence possesses a vast
community for support.
 The design of the Android Application has guidelines from Google, which
becomes easier for developers to produce more intuitive user applications.
 Fragmentation gives more power to Android Applications. This means the
application can run two activities on a single screen.
 Releasing the Android application in the Google play store is easier when it
is compared to other platforms.
Disadvantages of Android Development
 Fragmentation provides a very intuitive approach to user experience but it
has some drawbacks, where the development team needs time to adjust to
the various screen sizes of mobile smartphones that are now available in the
market and invoke the particular features in the application.
 The Android devices might vary broadly. So the testing of the application
becomes more difficult.
 As the development and testing consume more time, the cost of the
application may increase, depending on the application’s complexity and
features.

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XVI


Android App Development Using Android Studio

Chapter: 3 Weekly progresses

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XVII


Android App Development Using Android Studio

Weekly progresses
3.1 List of Activities involved

1st Date Name Of Activity


W 20/06/2022 Introduction Of Android Studio. And Project Selection.

E
21/06/2022 Research On Selected Project(Reminder App).
E
22/06/2022 Create The Main Screen (activity_main.xml) and MainActivity.java to add
K functionality.

23/06/2022 Create The Splash Screen InterFace(splash_activity.xml) And Create


Splash_Activity.java

24/06/2022 Start Working on activity_reminder.xml to add Task and Also Start Working On
ReminderActivity.java

25/06/2022 Done Workink On ReminderActivity .java And activity_reminder .xml and Start
working on AlarmBrodcast.java

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XVIII
Android App Development Using Android Studio

2nd Date Name Of Activity


W 27/06/2022 AlarmBrodcast.java done and start working on dbManager.java.

E
28/06/2022 dbManager.java and notification layout is done and start working on
E notificationmessage.java .

K 29/06/2022 notificationmessage.java is done and start working on model.java.

30/06/2022 model.java and Start working on myAdapter.java is done to help to dbManger.

01/07/2022 Single_reminder_file.xml and Notification_layout.xml Is done to display the list

02/07/2022 Adding the Feature to remove the list on long click by RecyclerViewInterface and
my Adapter.

3.2 Week-1 Progress


20 June 2022(Day 1) Introduction Of Android Studio. And Project Selection.

Android Studio is the official Integrated Development Environment (IDE) for


Android app development, based on IntelliJ IDEA. On top of IntelliJ's powerful
code editor and developer tools, Android Studio offers even more features that
enhance your productivity when building Android apps, such as:

 A flexible Gradle-based build system


 A fast and feature-rich emulator
 A unified environment where you can develop for all Android devices
 Apply Changes to push code and resource changes to your running app without
restarting your app

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XIX


Android App Development Using Android Studio

 Code templates and GitHub integration to help you build common app features and
import sample code
 Extensive testing tools and frameworks
 Lint tools to catch performance, usability, version compatibility, and other
problems
 C++ and NDK support
 Built-in support for Google Cloud Platform, making it easy to integrate Google
Cloud Messaging and App Engine
Project structure
Each project in Android Studio contains one or more modules with source code
files and resource files. Types of modules include:
 Android app modules
 Library modules
 Google App Engine modules
By default, Android Studio displays your project files in the Android project view,
as shown in figure 1. This view is organized by modules to provide quick access to
your project's key source files.
All the build files are visible at the top level under Gradle Scripts and each app
module contains the following folders:
 manifests: Contains the AndroidManifest.xml file.
 java: Contains the Java source code files, including JUnit test code.
 res: Contains all non-code resources, such as XML layouts, UI strings, and bitmap
images.

Project Selection

After the Introction of the Android Studio , It was the Time to select the project so
I visit couple of site related android project and choose couple of projects and
make the list and ask the instructor for advise and choose the “Reminder App.”

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XX
Android App Development Using Android Studio

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XXI


Android App Development Using Android Studio

21/06/2022(Day 2) Research On Selected Project(Reminder App).

On day 2 I did research On the Selected Project(Reminder App),like what kind of


Interface I want, what kind of view I want etc.

About Simple Task Reminder Application


1. Registering a new task and taking time and date to schedule the job.
2. Displaying all the tasks in the form of a list.
3. Keeping reminders for the task through notifications

You should design a home screen with a list of reminders and a screen to take user
input about his reminders. Below you can find a clear explanation of how the flow
of the application should be:

1. Showing Reminders using Recycler View or List View.


2. Embedding a floating action button on the home screen. Using this, the user
can add new tasks.
3. Adding reminders to Sqlite Database.
4. Setting the alarm Using Alarm Manager and Notification Manager.
5. Showing Notification using Notification Manager and pending Intent.
6. Updating the Manifest file with the necessary declarations and permissions.

RecyclerView:
In Android, RecyclerView is a sophisticated and versatile version of ListView and
GridView. It’s used for displaying plenty of knowledge sets that may be scrolled
expeditiously by maintaining a restricted variety of views.

SQLite Database:
SQLite information is an ASCII text file electronic database. It allows you to
perform the CRUD operations such as Create, Read, Update and delete.

Alarm Manager:
Android AlarmManager permits you to access the system alarm. With the
assistance of AlarmManager, you’ll be able to schedule your tasks.

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XXII


Android App Development Using Android Studio

Notification Manager:
Notification Manager helps to place notifications into the status bar of your device.
The user can expand the notification by going to the notification tray of your
device

22/0602022(Day 3) Create The Main Screen (activity_main.xml) and


MainActivity.java to add functionality.

activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@color/cardview_dark_background"
android:layout_height="match_parent"
tools:context=".MainActivity">

<Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/teal_700"
android:title="Reminders"
android:titleTextColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/create_reminder"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:layout_marginEnd="30dp"
android:layout_marginBottom="50dp"
android:src="@drawable/plus_icon" />

</RelativeLayout>
VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXIII
Android App Development Using Android Studio

MainActivity.java
package com.reminder.reminder;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;

import com.google.android.material.floatingactionbutton.FloatingActionButton;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

FloatingActionButton mCreateRem;
RecyclerView mRecyclerview;
ArrayList<Model> dataholder = new ArrayList<Model>();
myAdapter adapter;

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

mRecyclerview = (RecyclerView) findViewById(R.id.recyclerView);


mRecyclerview.setLayoutManager(new
LinearLayoutManager(getApplicationContext()));
mCreateRem = (FloatingActionButton)
findViewById(R.id.create_reminder);
mCreateRem.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(),
ReminderActivity.class);
startActivity(intent);
}
});

Cursor cursor = new


dbManager(getApplicationContext()).readallreminders();
while (cursor.moveToNext()) {
Model model = new Model(cursor.getString(1), cursor.getString(2),
cursor.getString(3));
dataholder.add(model);
}

adapter = new myAdapter(dataholder);


mRecyclerview.setAdapter(adapter);
VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXIV
Android App Development Using Android Studio

@Override
public void onBackPressed() {
finish();
super.onBackPressed();

Output:

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XXV


Android App Development Using Android Studio

23/06/2022(Day 4) Create The Splash Screen InterFace(splash_activity.xml)


And Create Splash_Activity.java

splash_activity.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=".splashActivity">

<View
android:id="@+id/view"
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_marginBottom="60dp"
android:background="@drawable/add_alert"
android:backgroundTintMode="add"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Reminder App"
android:textSize="30sp"
android:textColor="@color/cardview_dark_background"
app:layout_constraintTop_toBottomOf="@+id/view"
android:layout_marginTop="12dp"
android:gravity="center"/>

</androidx.constraintlayout.widget.ConstraintLayout>

Splash_Activity.java
package com.reminder.reminder;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import com.reminder.reminder.MainActivity;

public class splashActivity extends AppCompatActivity {

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXVI
Android App Development Using Android Studio

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

int secondsDelayed = 1;
new Handler().postDelayed(new Runnable() {
public void run() {
startActivity(new Intent(getApplicationContext(),
MainActivity.class));
finish();
}
}, secondsDelayed * 500);
}
}

Output:

24/06/2022(Day 5) Start Working on activity_reminder.xml to add Task and


Also Start Working On ReminderActivity.java

activity_reminder.xml
<?xml version="1.0" encoding="utf-8"?>
<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:background="@color/cardview_dark_background"
android:layout_height="match_parent"
VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXVII
Android App Development Using Android Studio

android:gravity="center"
android:orientation="vertical"
app:backgroundTint="@null"
tools:context=".ReminderActivity">

<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
app:cardCornerRadius="20dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cardview_dark_background"
android:orientation="vertical"
app:backgroundTint="@null">

<TextView
android:layout_width="380dp"
android:layout_height="wrap_content"
android:text="Add Reminder Here..."
android:textSize="30dp"
android:textColor="@color/cardview_light_background"
android:background="@color/teal_700"
android:backgroundTintMode="add"
android:textStyle="bold"
android:layout_margin="10dp"/>

<EditText
android:id="@+id/editTitle"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_margin="10dp"
android:textColor="@color/cardview_light_background"
android:hint="Enter The Task" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<Button
android:id="@+id/btnDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="0.5"
android:text="date" />

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXVIII
Android App Development Using Android Studio

<Button
android:id="@+id/btnTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="0.5"
android:text="time" />

</LinearLayout>

<Button
android:id="@+id/btnSbumit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Save" />

</LinearLayout>

</androidx.cardview.widget.CardView>

</LinearLayout>

ReminderActivity.java
package com.reminder.reminder;

import androidx.appcompat.app.AppCompatActivity;

import android.app.AlarmManager;
import android.app.DatePickerDialog;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TimePicker;
import android.widget.Toast;

import com.reminder.reminder.AlarmBrodcast;
import com.reminder.reminder.MainActivity;
import com.reminder.reminder.dbManager;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXIX
Android App Development Using Android Studio

public class ReminderActivity extends AppCompatActivity {

Button mSubmitbtn, mDatebtn, mTimebtn;


EditText mTitledit;
String timeTonotify;

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

mTitledit = (EditText) findViewById(R.id.editTitle);


mDatebtn = (Button) findViewById(R.id.btnDate);
mTimebtn = (Button) findViewById(R.id.btnTime);
mSubmitbtn = (Button) findViewById(R.id.btnSbumit);

mTimebtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
selectTime();
}
});

mDatebtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
selectDate();
}
});

mSubmitbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String title = mTitledit.getText().toString().trim();
String date = mDatebtn.getText().toString().trim();
String time = mTimebtn.getText().toString().trim();

if (title.isEmpty()) {
Toast.makeText(getApplicationContext(), "Please Enter
text", Toast.LENGTH_SHORT).show();
} else {
if (time.equals("time") || date.equals("date")) {
Toast.makeText(getApplicationContext(), "Please
select date and time", Toast.LENGTH_SHORT).show();
} else {
processinsert(title, date, time);

}
}

}
});
}

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XXX


Android App Development Using Android Studio

private void processinsert(String title, String date, String time) {


String result = new dbManager(this).addreminder(title, date, time);
setAlarm(title, date, time);
mTitledit.setText("");
Toast.makeText(getApplicationContext(), result,
Toast.LENGTH_SHORT).show();
}

private void selectTime() {


Calendar calendar = Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
TimePickerDialog timePickerDialog = new TimePickerDialog(this, new
TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int i, int i1) {
timeTonotify = i + ":" + i1;
mTimebtn.setText(FormatTime(i, i1));
}
}, hour, minute, false);
timePickerDialog.show();
}

private void selectDate() {


Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
DatePickerDialog datePickerDialog = new DatePickerDialog(this, new
DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker datePicker, int year, int month,
int day) {
mDatebtn.setText(day + "-" + (month + 1) + "-" + year);
}
}, year, month, day);
datePickerDialog.show();
}

public String FormatTime(int hour, int minute) {

String time;
time = "";
String formattedMinute;

if (minute / 10 == 0) {
formattedMinute = "0" + minute;
} else {
formattedMinute = "" + minute;
}

if (hour == 0) {
time = "12" + ":" + formattedMinute + " AM";

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXXI
Android App Development Using Android Studio

} else if (hour < 12) {


time = hour + ":" + formattedMinute + " AM";
} else if (hour == 12) {
time = "12" + ":" + formattedMinute + " PM";
} else {
int temp = hour - 12;
time = temp + ":" + formattedMinute + " PM";
}

return time;
}

private void setAlarm(String text, String date, String time) {


AlarmManager am = (AlarmManager)
getSystemService(Context.ALARM_SERVICE);

Intent intent = new Intent(getApplicationContext(),


AlarmBrodcast.class);
intent.putExtra("event", text);
intent.putExtra("time", date);
intent.putExtra("date", time);

PendingIntent pendingIntent =
PendingIntent.getBroadcast(getApplicationContext(), 0, intent,
PendingIntent.FLAG_ONE_SHOT);
String dateandtime = date + " " + timeTonotify;
DateFormat formatter = new SimpleDateFormat("d-M-yyyy hh:mm");
try {
Date date1 = formatter.parse(dateandtime);
am.set(AlarmManager.RTC_WAKEUP, date1.getTime(), pendingIntent);
Toast.makeText(getApplicationContext(), "Alaram",
Toast.LENGTH_SHORT).show();

} catch (ParseException e) {
e.printStackTrace();
}

Intent intentBack = new Intent(getApplicationContext(),


MainActivity.class);
intentBack.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intentBack);

}
}

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXXII
Android App Development Using Android Studio

Output:

25/06/2022 (Day 6) Done Workink On ReminderActivity .java And


activity_reminder .xml and Start working on AlarmBrodcast.java

AlarmBrodcast.java
package com.reminder.reminder;

import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.widget.RemoteViews;

import androidx.core.app.NotificationCompat;

public class AlarmBrodcast extends BroadcastReceiver {


@Override
public void onReceive(Context context, Intent intent) {

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXXIII
Android App Development Using Android Studio

Bundle bundle = intent.getExtras();


String text = bundle.getString("event");
String date = bundle.getString("date") + " " +
bundle.getString("time");

Intent intent1 = new Intent(context, NotificationMessage.class);


intent1.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent1.putExtra("message", text);

PendingIntent pendingIntent = PendingIntent.getActivity(context, 1,


intent1, PendingIntent.FLAG_ONE_SHOT);
NotificationManager notificationManager = (NotificationManager)
context.getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder mBuilder = new
NotificationCompat.Builder(context, "notify_001");

RemoteViews contentView = new RemoteViews(context.getPackageName(),


R.layout.notification_layout);
contentView.setImageViewResource(androidx.core.R.id.action_image,
R.drawable.ic_baseline_add_alert_24);
PendingIntent pendingSwitchIntent =
PendingIntent.getBroadcast(context, 0, intent, 0);
contentView.setOnClickPendingIntent(R.id.flashButton,
pendingSwitchIntent);
contentView.setTextViewText(R.id.message, text);
contentView.setTextViewText(R.id.date, date);
mBuilder.setSmallIcon(R.drawable.ic_baseline_add_alert_24);
mBuilder.setAutoCancel(true);
mBuilder.setOngoing(true);
mBuilder.setAutoCancel(true);
mBuilder.setPriority(Notification.PRIORITY_HIGH);
mBuilder.setOnlyAlertOnce(true);
mBuilder.build().flags = Notification.FLAG_NO_CLEAR |
Notification.PRIORITY_HIGH;
mBuilder.setContent(contentView);
mBuilder.setContentIntent(pendingIntent);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {


String channelId = "channel_id";
NotificationChannel channel = new NotificationChannel(channelId,
"channel name", NotificationManager.IMPORTANCE_HIGH);
channel.enableVibration(true);
notificationManager.createNotificationChannel(channel);
mBuilder.setChannelId(channelId);
}

Notification notification = mBuilder.build();


notificationManager.notify(1, notification);

}
}

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXXIV
Android App Development Using Android Studio

27/06/2022(Day 7)AlarmBrodcast.java done and start working on


dbManager.java.

dbManager.java
package com.reminder.reminder;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class dbManager extends SQLiteOpenHelper {


private static final String dbname = "reminder";

public dbManager(@Nullable Context context) {


super(context, dbname, null, 1);
}

@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
String query = "create table tbl_reminder(id integer primary key
autoincrement,title text,date text,time text)";
sqLiteDatabase.execSQL(query);
}

@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

String query = "DROP TABLE IF EXISTS tbl_reminder";


sqLiteDatabase.execSQL(query);
onCreate(sqLiteDatabase);

public String addreminder(String title, String date, String time) {


SQLiteDatabase database = this.getReadableDatabase();

ContentValues contentValues = new ContentValues();


contentValues.put("title", title);
contentValues.put("date", date);
contentValues.put("time", time);

float result = database.insert("tbl_reminder", null, contentValues);

if (result == -1) {
return "Failed";
} else {
return "Successfully inserted";
VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXXV
Android App Development Using Android Studio

}
/* public int deletereminder(int id){
SQLiteDatabase database = getWritableDatabase();
return database.delete("tbl_reminder","id=?",new
String[]{String.valueOf(id)});
}*/

public Cursor readallreminders() {


SQLiteDatabase database = this.getWritableDatabase();
String query = "select * from tbl_reminder order by id desc";
Cursor cursor = database.rawQuery(query, null);
return cursor;
}
}

28/06/2022 (Day 8) dbManager.java and notification layout is done and start


working on notificationmessage.java .

notificationmessage.java
package com.reminder.reminder;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

public class NotificationMessage extends AppCompatActivity {


Button mflashButton;
TextView textView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notification_message);
mflashButton =(Button) findViewById(R.id.flashButton);
textView = findViewById(R.id.tv_message);
Bundle bundle = getIntent().getExtras();
textView.setText(bundle.getString("message"));

mflashButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(getApplicationContext(), "Reminder Is
Disable!!", Toast.LENGTH_SHORT).show();
}

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXXVI
Android App Development Using Android Studio

});

}
}

29/06/2022 (Day 9) notificationmessage.java is done and start working on


model.java.

model.java
package com.reminder.reminder;

public class Model {


String title, date, time;

public Model() {
}

public Model(String title, String date, String time) {


this.title = title;
this.date = date;
this.time = time;
}

public String getTitle() {


return title;
}

public void setTitle(String title) {


this.title = title;
}

public String getDate() {


return date;
}

public void setDate(String date) {


this.date = date;
}

public String getTime() {


return time;
}

public void setTime(String time) {


this.time = time;
}
}

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXXVII
Android App Development Using Android Studio

30/06/2022 (Day 10) model.java and Start working on myAdapter.java is


done to help to dbManger.

myAdapter.java
package com.reminder.reminder;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.database.sqlite.SQLiteDatabase;
import android.provider.CalendarContract;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;

public class myAdapter extends RecyclerView.Adapter<myAdapter.myviewholder> {


private RecyclerViewInterface recyclerViewInterface;
ArrayList<Model> dataholder = new ArrayList<Model>();
Context context;
private myAdapter adapter;

public myAdapter(ArrayList<Model> dataholder) {


this.dataholder = dataholder;
this.context = context;
}

@NonNull
@Override
public myviewholder onCreateViewHolder(@NonNull ViewGroup parent, int
viewType) {
View view =
LayoutInflater.from(parent.getContext()).inflate(R.layout.single_reminder_fil
e, parent, false);
return new myviewholder(view);
}

@Override
public void onBindViewHolder(@NonNull myviewholder holder,
@SuppressLint("RecyclerView") int position) {
holder.mTitle.setText(dataholder.get(position).getTitle());
holder.mDate.setText(dataholder.get(position).getDate());
holder.mTime.setText(dataholder.get(position).getTime());

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXXVIII
Android App Development Using Android Studio

/*holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(view.getContext(), "Click " ,
Toast.LENGTH_SHORT).show();
}
});*/
holder.itemView.setOnLongClickListener(new View.OnLongClickListener()
{
@Override
public boolean onLongClick(View view) {
/* AlertDialog.Builder builder = new
AlertDialog.Builder(context)
.setTitle("Remove Task")
.setMessage("Are you sure you want to remove ?")
.setCancelable(false)
.setIcon(R.drawable.ic_baseline_delete_24)
.setPositiveButton("Yes", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface
dialogInterface, int i) {
dbManager dbManager = new dbManager(context);
int result =
dbManager.deletereminder(holder.itemView.getId());
if(result>0){*/
dataholder.remove(position);
notifyItemRemoved(position);
Toast.makeText(view.getContext(), "Removed!! " ,
Toast.LENGTH_SHORT).show();
/*}
else {
Toast.makeText(view.getContext(), "Failed
to Removed!! At Position" + position, Toast.LENGTH_SHORT).show();
}

}
})
.setNegativeButton("No", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface
dialogInterface, int i) {

}
});
builder.show();*/

return true;
}
});
}

@Override
public int getItemCount() {

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XXXIX
Android App Development Using Android Studio

return dataholder.size();
}

static class myviewholder extends RecyclerView.ViewHolder {


TextView mTitle, mDate, mTime;
/* private myAdapter adapter;*/

public myviewholder(@NonNull View itemView) {


super(itemView);

mTitle = (TextView) itemView.findViewById(R.id.txtTitle);


mDate = (TextView) itemView.findViewById(R.id.txtDate);
mTime = (TextView) itemView.findViewById(R.id.txtTime);
/*itemView.findViewById(R.id.remove).setOnClickListener(view -> {
adapter.dataholder.remove(getAdapterPosition());
adapter.notifyItemRemoved(getAdapterPosition());
});*/

}
}
/* public myviewholder linkAdapter(myAdapter adapter){
this.adapter = adapter;
return linkAdapter(this);
}*/
}

01/07/2022 (Day 11) Single_reminder_file.xml and Notification_layout.xml Is


done to display the list

Single_reminder_file.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"

android:layout_margin="10dp"
app:cardCornerRadius="10dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">

<TextView
android:id="@+id/txtTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title"
android:textSize="20dp"

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XL
Android App Development Using Android Studio

android:textStyle="bold" />

<TextView
android:id="@+id/txtDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Date"
android:textSize="20dp"
android:textStyle="italic" />

<TextView
android:id="@+id/txtTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Time"
android:textSize="20dp"
android:textStyle="italic" />

</LinearLayout>

</androidx.cardview.widget.CardView>

Output:

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XLI


Android App Development Using Android Studio

Notification_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
android:backgroundTintMode="add"
android:layout_width="fill_parent"
android:layout_height="64dp"
android:padding="10dp">

<Button
android:id="@+id/flashButton"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="Disable" />

<ImageView
android:id="@+id/icon"
android:layout_width="60dp"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="-10dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="@color/white"
android:src="@drawable/ic_baseline_add_alert_24" />

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/icon"
android:backgroundTintMode="add">

<TextView
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:backgroundTintMode="add"
android:layout_marginLeft="20dp"
android:text="Flashlight"
android:textColor="@color/cardview_light_background"
android:textSize="13sp" />

<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XLII


Android App Development Using Android Studio

android:layout_below="@+id/message"
android:layout_alignParentLeft="true"
android:layout_marginTop="3dp"
android:layout_marginLeft="20dp"
android:text="90% Charging"
android:textColor="@color/cardview_light_background"
android:textSize="13sp" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>

Output:

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XLIII


Android App Development Using Android Studio

02/07/2022 (Day 12) Adding the Feature to remove the list on long click by
RecyclerViewInterface and my Adapter.

RecyclerViewInterface.java
package com.reminder.reminder;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.database.sqlite.SQLiteDatabase;
import android.provider.CalendarContract;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;

public class myAdapter extends RecyclerView.Adapter<myAdapter.myviewholder> {


private RecyclerViewInterface recyclerViewInterface;
ArrayList<Model> dataholder = new ArrayList<Model>();
Context context;
private myAdapter adapter;

public myAdapter(ArrayList<Model> dataholder) {


this.dataholder = dataholder;
this.context = context;
}

@NonNull
@Override
public myviewholder onCreateViewHolder(@NonNull ViewGroup parent, int
viewType) {
View view =
LayoutInflater.from(parent.getContext()).inflate(R.layout.single_reminder_fil
e, parent, false);
return new myviewholder(view);
}

@Override
public void onBindViewHolder(@NonNull myviewholder holder,
@SuppressLint("RecyclerView") int position) {
holder.mTitle.setText(dataholder.get(position).getTitle());
holder.mDate.setText(dataholder.get(position).getDate());
holder.mTime.setText(dataholder.get(position).getTime());

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XLIV
Android App Development Using Android Studio

/*holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(view.getContext(), "Click " ,
Toast.LENGTH_SHORT).show();
}
});*/
holder.itemView.setOnLongClickListener(new View.OnLongClickListener()
{
@Override
public boolean onLongClick(View view) {
/* AlertDialog.Builder builder = new
AlertDialog.Builder(context)
.setTitle("Remove Task")
.setMessage("Are you sure you want to remove ?")
.setCancelable(false)
.setIcon(R.drawable.ic_baseline_delete_24)
.setPositiveButton("Yes", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface
dialogInterface, int i) {
dbManager dbManager = new dbManager(context);
int result =
dbManager.deletereminder(holder.itemView.getId());
if(result>0){*/
dataholder.remove(position);
notifyItemRemoved(position);
Toast.makeText(view.getContext(), "Removed!! " ,
Toast.LENGTH_SHORT).show();
/*}
else {
Toast.makeText(view.getContext(), "Failed
to Removed!! At Position" + position, Toast.LENGTH_SHORT).show();
}

}
})
.setNegativeButton("No", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface
dialogInterface, int i) {

}
});
builder.show();*/

return true;
}
});
}

@Override
public int getItemCount() {
return dataholder.size();

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XLV


Android App Development Using Android Studio

static class myviewholder extends RecyclerView.ViewHolder {


TextView mTitle, mDate, mTime;
/* private myAdapter adapter;*/

public myviewholder(@NonNull View itemView) {


super(itemView);

mTitle = (TextView) itemView.findViewById(R.id.txtTitle);


mDate = (TextView) itemView.findViewById(R.id.txtDate);
mTime = (TextView) itemView.findViewById(R.id.txtTime);
/*itemView.findViewById(R.id.remove).setOnClickListener(view -> {
adapter.dataholder.remove(getAdapterPosition());
adapter.notifyItemRemoved(getAdapterPosition());
});*/

}
}
/* public myviewholder linkAdapter(myAdapter adapter){
this.adapter = adapter;
return linkAdapter(this);
}*/
}

myAdapter.java
package com.reminder.reminder;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.database.sqlite.SQLiteDatabase;
import android.provider.CalendarContract;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;

public class myAdapter extends RecyclerView.Adapter<myAdapter.myviewholder> {


private RecyclerViewInterface recyclerViewInterface;
ArrayList<Model> dataholder = new ArrayList<Model>();
Context context;
private myAdapter adapter;

public myAdapter(ArrayList<Model> dataholder) {


this.dataholder = dataholder;

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XLVI
Android App Development Using Android Studio

this.context = context;
}

@NonNull
@Override
public myviewholder onCreateViewHolder(@NonNull ViewGroup parent, int
viewType) {
View view =
LayoutInflater.from(parent.getContext()).inflate(R.layout.single_reminder_fil
e, parent, false);
return new myviewholder(view);
}

@Override
public void onBindViewHolder(@NonNull myviewholder holder,
@SuppressLint("RecyclerView") int position) {
holder.mTitle.setText(dataholder.get(position).getTitle());
holder.mDate.setText(dataholder.get(position).getDate());
holder.mTime.setText(dataholder.get(position).getTime());

/*holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(view.getContext(), "Click " ,
Toast.LENGTH_SHORT).show();
}
});*/
holder.itemView.setOnLongClickListener(new View.OnLongClickListener()
{
@Override
public boolean onLongClick(View view) {
/* AlertDialog.Builder builder = new
AlertDialog.Builder(context)
.setTitle("Remove Task")
.setMessage("Are you sure you want to remove ?")
.setCancelable(false)
.setIcon(R.drawable.ic_baseline_delete_24)
.setPositiveButton("Yes", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface
dialogInterface, int i) {
dbManager dbManager = new dbManager(context);
int result =
dbManager.deletereminder(holder.itemView.getId());
if(result>0){*/
dataholder.remove(position);
notifyItemRemoved(position);
Toast.makeText(view.getContext(), "Removed!! " ,
Toast.LENGTH_SHORT).show();
/*}
else {
Toast.makeText(view.getContext(), "Failed

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XLVII
Android App Development Using Android Studio

to Removed!! At Position" + position, Toast.LENGTH_SHORT).show();


}

}
})
.setNegativeButton("No", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface
dialogInterface, int i) {

}
});
builder.show();*/

return true;
}
});
}

@Override
public int getItemCount() {
return dataholder.size();
}

static class myviewholder extends RecyclerView.ViewHolder {


TextView mTitle, mDate, mTime;
/* private myAdapter adapter;*/

public myviewholder(@NonNull View itemView) {


super(itemView);

mTitle = (TextView) itemView.findViewById(R.id.txtTitle);


mDate = (TextView) itemView.findViewById(R.id.txtDate);
mTime = (TextView) itemView.findViewById(R.id.txtTime);
/*itemView.findViewById(R.id.remove).setOnClickListener(view -> {
adapter.dataholder.remove(getAdapterPosition());
adapter.notifyItemRemoved(getAdapterPosition());
});*/

}
}
/* public myviewholder linkAdapter(myAdapter adapter){
this.adapter = adapter;
return linkAdapter(this);
}*/
}

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
XLVIII
Android App Development Using Android Studio

Output:

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 XLIX


Android App Development Using Android Studio

Chapter: 4 Case study

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 L
Android App Development Using Android Studio

Case study
4.1 Description and process

Link of Sqlite database case Study

https://www.simplilearn.com/tutorials/sql-tutorial/what-is-sqlite#what_is_sqlite

 Sqlite Database

 What Is SQLite?

SQLite is an embedded, server-less relationa databasemanagement. It


is an in-memory open-source library with zero configuration and does
not require any installation. Also, it is very convenient as it’s less than
500kb in size, which is significantly lesser than other database
management systems.

 History of SQLite

2000 D. Richard Hipp designed SQLite to fulfill the purpose


of ‘no administration required’ for operating a program.
2000 In August, SQLite 1.0 was released with the GNU
database manager.
2011 Hipp announced to add the UNQl interface to the
SQLite database to develop UNQLite (Document-
oriented database).

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 LI
Android App Development Using Android Studio

 Why Use SQLite?

o SQLite is an open-source software. The software does not


require any license after installation.
o SQLite is serverless as it doesn't need a different server process
or system to operate.
o SQLite facilitates you to work on multiple databases on the
same session simultaneously, thus making it flexible.
o SQLite is a cross-platform DBMS that can run on all platforms,
including macOS, Windows, etc.
o SQLite doesn't require any configuration. It needs no setup or
administration

 When to Use SQLite?

o SQLite is used to develop embedded software for devices like


televisions, cell phones, cameras, etc.
o It can manage low to medium-traffic HTTP requests.
o SQLite can change files into smaller size archives with lesser
metadata.
o SQLite is used as a temporary dataset to get processed with
some data within an application.
o Beginners use SQLite for learning and training purposes, as it
requires no installation and configuration.

 AlarmManager
 public class AlarmManager
extends Object
 This class provides access to the system alarm services. These
allow you to schedule your application to be run at some point
in the future. When an alarm goes off, the Intent that had been
registered for it is broadcast by the system, automatically
starting the target application if it is not already running.
Registered alarms are retained while the device is asleep (and
can optionally wake the device up if they go off during that
time), but will be cleared if it is turned off and rebooted.

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 LII


Android App Development Using Android Studio

 The Alarm Manager holds a CPU wake lock as long as the


alarm receiver's onReceive() method is executing. This
guarantees that the phone will not sleep until you have finished
handling the broadcast. Once onReceive() returns, the Alarm
Manager releases this wake lock. This means that the phone
will in some cases sleep as soon as your onReceive() method
completes. If your alarm receiver called Context.startService(),
it is possible that the phone will sleep before the requested
service is launched. To prevent this, your BroadcastReceiver
and Service will need to implement a separate wake lock policy
to ensure that the phone continues running until the service
becomes available.
 Note: The Alarm Manager is intended for cases where you
want to have your application code run at a specific time, even
if your application is not currently running. For normal timing
operations (ticks, timeouts, etc) it is easier and much more
efficient to use Handler.

 NotificationManager
 public class NotificationManager
extends Object
 Class to notify the user of events that happen. This is how you tell the
user that something has happened in the background.
 Notifications can take different forms:
o A persistent icon that goes in the status bar and is accessible
through the launcher, (when the user selects it, a designated
Intent can be launched),
o Turning on or flashing LEDs on the device, or
o Alerting the user by flashing the backlight, playing a sound, or
vibrating.
 Each of the notify methods takes an int id parameter and optionally
a String tag parameter, which may be null. These parameters are used
to form a pair (tag, id), or (null, id) if tag is unspecified. This pair
identifies this notification from your app to the system, so that pair

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 LIII


Android App Development Using Android Studio

should be unique within your app. If you call one of the notify
methods with a (tag, id) pair that is currently active and a new set of
notification parameters, it will be updated. For example, if you pass a
new status bar icon, the old icon in the status bar will be replaced with
the new one. This is also the same tag and id you pass to
the cancel(int) or cancel(java.lang.String, int) method to clear this
notification.

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 LIV


Android App Development Using Android Studio

Chapter: 5 Opportunities

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 LV
Android App Development Using Android Studio

Opportunities
5.1 What roles you served?

Duration of the 2-weeks of the internship is not a proper time period of web
development project, due to this duration I have only follows the instruction and
performed the task which is given by the supervisor.

5.2 What work you carried out?

I carried out the knowledge of the java, sqlite, alarm manager and notification
manager and how to use them in Application Development and create Reminder
App in 2-weeks of my internship journey.

5.3 What contribution you made to company?

I have not made any type of contribution because it was only internship session of
the 2-weeks. But I am very happy to be a part of the internship of the Durvasa
Infotech.

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 LVI


Android App Development Using Android Studio

Chapter: 6 Learning

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 LVII


Android App Development Using Android Studio

Learning

 Many things that I have learning Like Sqlitq,Alarm Manager and


Notification Manager how to use it to develop the Android Application.

 To learn which type of technical challenges given in technical interview.


 How to speed up the typing skill without autosuggestion.
 To learn how to work on short period of time or time limits.
 To learn how to complete the challenges or task in given particular time (in
minutes).

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
LVIII
Android App Development Using Android Studio

Chapter: 7 Challenges Faced

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 LIX


Android App Development Using Android Studio

Challenges Faced

 Main challenge that I was faced is that to complete the whole work
regarding to the Alaram Manager And NotificationManager and create my
own Application with the them because the time duration is only 2-weeks
 After Adding The Alaram Manger some Time Application Crashing over
And over.

 In starting time I faced the typing speed

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 LX
Android App Development Using Android Studio

Chapter: 8 References

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 LXI


Android App Development Using Android Studio

References
https://developer.android.com/reference/android/app/AlarmManager

https://developer.android.com/reference/android/app/NotificationManager

https://data-flair.training/

https://www.geeksforgeeks.org/android-architecture/

https://developer.android.com/studio?gclid=Cj0KCQjwzqSWBhDPARIsAK38LY
9trNOCEFssynLJGsaOdRS7fAjRbbIBjEb6QU7wQJR7CH3b_jocOLYaAqJWEA
Lw_wcB&gclsrc=aw.ds

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 LXII


Android App Development Using Android Studio

Chapter:9 Conclusion

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006 LXIII


Android App Development Using Android Studio

Conclusion
 This Internship is very good and very important for me because it’s
providing an extra and more understandable knowledge in web
development.
 It was a great experience for me in which I learning something new which I
don’t know before the Internship.

VIEAT/BE/7-SEM/INTERNSHIP: 190940107006
LXIV

You might also like