Journal App Report
Journal App Report
A MINI-PROJECT REPORT
Mobile Application Development (18CSMP68)
On
RELIVE-THE JOURNAL APP
Submitted in partial fulfilment for the award of the degree of Bachelor of
Engineering
in
By
VENNALA M REDDY (1GD18CS055)
VISHNU A(1GD18CS056)
GIRISH M
Assistant Professor,
Department of CSE, GCEM
i
GOPALAN COLLEGE OF ENGINEERING AND MANAGEMENT
(Accredited by NAAC, 2(f) status by UGC & ISO 9001:2015 certified)
Approved by All India Council for Technical Education (AICTE), New Delhi
Affiliated to Visvesvaraya Technological University (VTU), Belagavi, Karnataka
Recognised by Govt. of Karnataka
CERTIFICATE
This is to certify that the mini-project report entitled “RELIVE-THE JOURNAL APP”
is a bonafide work carried out by VENNALA M REDDY (1GD18CS055) & VISHNU
A(1GD18CS056) in partial fulfilment of requirement of VI semester, Bachelor of
Engineering in Computer Science and Engineering of the Visvesvaraya Technological
University, Belgaum during the year, 2020-21. The project report has been approved as it
satisfies the academic requirement in respect of project work prescribed for the said degree.
ii
DECLARATION
iii
ACKNOWLEDGEMENT
Our mini-project report is the result of the encouragement of many people who
helped shape it and provided feedback, direction and valuable support. It is with hearty
gratitude that I acknowledge their contribution to my project.
We are really thankful to our guide Dr. J. SOMASEKAR, Professor and Head of
Computer Science and engineering, GCEM for constant support extended towards me
during the course of this technical seminar. Help and advice instilled the drive in me to
complete the technical seminar on time.
Finally, we would like to extend our thanks to Almighty, friends and family who supported
us and provided us with suggestions to make the project better.
iv
ABSTRACT
This is a basic Journal (android) app developed in android studio. We use firebase
authentication, database and storage facilities. The user can login using their credentials
and update their dairy. Being a mobile application influences not only the type of
information people seek, but also the way they attempt to access it. It provides an easy and
simple interface for the user.
A personal diary may include the person's experiences, thoughts or feelings. Diaries have
made it more convenient to write down the events happening to the author as it happens. In
this paper, a diary application was developed for an Android Smartphone. The application
is developed using Java language in Android Studio and Firebase for backend database and
storage facilities. Firebase is a cloud computing and development platform of google. The
user has the ability to write entries and read entries. In order to store data, we use firebase’s
firestore which is a storage facility provided by firebase. User authentication is done using
email/password. Any number of users can create an account using valid credentials and can
log in to their account. Authentication is also provided by firebase. It is also used as the
database and as storage for the images the user loads.
v
LIST OF FIGURES
vi
LIST OF TABLES
1 SOFTWARE REQUIREMENTS 3
2 HARDWARE REQUIRMENTS 3
3 TEST CASES 23
vii
TABLE OF CONTENTS
ACKNOWLEDGEMENT…………………………………………………………iv
ABSTRACT………………………………………………………………………...v
LIST OF FIGURES………………………………………………………………..vi
LIST OF TABLES…………………………………………………………………vii
CHAPTERS PAGE NO
Chapter 1
INTRODUCTION.............................................................................................................. 1
1.1 JAVA……………………………………………………........................................ 1
Chapter 2
viii
Chapter 3
Chapter 4
IMPLEMENTATION ....................................................................................................... 9
Chapter 5
TESTING ................................................................................................................................... 23
Chapter 6
SCREENSHOTS ........................................................................................................................ 24
CONCLUSION .......................................................................................................................... 27
REFRENCES ............................................................................................................................. 28
ix
Relive – The Journal App
CHAPTER-1
INTRODUCTION
1.1 Java
Android is one of the most popular mobile device platforms. The Android platform allows
developers to write managed code using Java to manage and control the Android device.
Android Studio is a popular IDE developed by Google for developing applications that are
targeted at the Android platform. Note that Android Studio has replaced Eclipse as the IDE
of choice for developing Android applications. This article presents a discussion on how to
get started using the Android Studio for developing Android applications. Android Studio
contains tools such as the Android Virtual Device Manager and the Android Device
Monitor. It also contains Gradle, which helps you configure your Android application
seamlessly.
This project is to create a journal application with a cloud server and users to enable the
users to add entries. To develop an instant diary solution to enable users to seamlessly
create an entry in form of a post, which can serve as a remainder or as a note. The project
should be very easy to use enabling even a novice person to use it.
1. To develop an instant diary solution to enable users to seamlessly create an entry in form
of a post, which can serve as a remainder or as a note.
2. The project should be very easy to use enabling even a novice person to use it.
CHAPTER-2
SOFTWARE AND HARDWARE REQUIREMENTS
Database Firebase
RAM 8.00 GB
CHAPTER-3
ANALYSIS AND DESIGN
Project design is a crucial stage in a project’s life cycle because it identifies key elements
and sets the overall tone. For your project to be successful, you must first understand the
steps involved in project design, as well as how to document them.
Creating a project design can help you avoid pitfalls down the road and also set a reasonable
budget from the outset. Software development projects can be highly technical and
complex. These project designs have a broad range: from simple diagrams or descriptions
of requirements and functions to long, detailed documents outlining every technical
specification of the application or system.
LinearLayout
RelativeLayout
Button
EditText
ProgressBar
AutoCompleteTextView
CardView
RecyclerView
ContraintLayout
ImageView
These are the attributes that we used. They helped in the login, sign up and to view the
posts in the list view. We added a separate menu file to create the menu which had the
logout option. On clicking which the user will be able to logout.
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
Authentication:
After adding firebase and authentication dependency to the Android application, the user
can create login id by the following code [6]:
FirebaseAuth auth=FirebaseAuth.getInstance();
auth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(new OnCompleteListener())
@Override
if(task.isSuccessful())
FirebaseUser user=task.getResult().getUser();
String email=user.getEmail();
//…
});
Database:
Firebase real-time database feature is very easy to use. Once the Firebase and database dependency
added to the app,unstructured data can be added to database by the following code [7]:
DatabaseReference myref=database.getReference(“node”);
Storage
The files like images, audio, video etc can be stored in the app. The data stored is highly secured
and is robust in nature means it resumes from the last point if any network error occurs. The steps
below are to be followed to use storage feature in Android application:
Once the Firebase and storage dependency are added to the application, create instance of
FirebaseStorage storageobject =FirebaseStorage.getInstance();
An object class or a map can be used to insert new data .Once the object is created, navigate
the Firebase reference tothe position where a child can be added.
If a list is created and does not have a specific names for each child, the push() method can
be used before the setValue() is called.
CHAPTER-4
IMPLEMENTATION
Before starting with ReLive, it is important to understand how the app works! The Key
Concepts page of the application’s documentation can help you with that:
Now that we have both username and UID, a collection is created in the database named as
User’s where each UID and its associated username is saved. The UID can be found by
means of email in the authentication area of the FireBase.
You can also view all the registered users in the ReLive’ Dashboard.
1. getSupportActionBar()
Support library version of android.app.Activity.getActionBar. Retrieve a reference to this
activity's ActionBar.
2. setDisplayHomeAsUpEnabled(boolean showHomeAsUp)
Set whether home should be displayed as an "up" affordance. Set this to true if selecting
"home" returns up by a single level in your UI rather than back to the top level or front
page. To set several display options at once, see the setDisplayOptions methods.
3. Init()
Init method is a predefined method to initialize an object after its creation. Init method is
a life cycle method for servlets for java. It is started by the browser when java program is
loaded and run by the browser. Init method is a predefine method to initialize an object
after its creation.
4. FetchCountryWiseData()
Method to retriew country wise data JSON from the URL
5. OnRefreshListener()
Classes that wish to be notified when the swipe gesture correctly triggers a refresh should
implement this interface.
6. setRefreshing(boolean refreshing)
Notify the widget that refresh state has changed. Do not call this when refresh is triggered
by a swipe gesture. Refreshing-Whether or not the view should show refresh progress.
8. toLowerCase()
The java string toLowerCase() method converts all characters of the string into lowercase
letter. There are two types of toLowerCase() method. Signature: public String
toLowerCase(Locale loc) and public String toLowerCase() Parameter: loc- locale value to
be applied.
9. Handler()
A handler is basically a message queue. You post a message to it, and it will eventually
process it by calling its run method and passing the message to it. Since these run calls will
always occur in the order of messages received on the same thread, it allows you to serialize
events.
10. getIntent()
when called in an Activity, gives you a reference to the Intent which was used to launch
this Activity. There are two primary forms of intents you will use. Explicit Intents have
specified a component (via setComponent(ComponentName) or setClass(Context, Class)),
which provides the exact class to be run.
12. startAnimation()
Android Animation is used to give the UI a rich look and feel. Animations in android apps
can be performed through XML or android code.
13. onListItemClick()
The method is used to process the clicks on android ListView item.
14. finish()
Method is called to kill your activity instance after you did what you have to do with the
activity.
15. LoadStateData()
Method to retriew country wise data JSON from the URL
17. setOnClickListener()
One of the most usable methods in android is setOnClickListener method which helps us
to link a listener with certain attributes. setOnClickListener is a method in Android
basically used with buttons, image buttons etc. You can initiate this method easily like,
public void setOnClickListener(View.OnClickListner)
18. CheckForUpdate()
This plugin checks whether updates are available, and prompts the user to launch the
updater if so.
19. getPackageManager()
It is a method of Context. You can use this method inside an Activity (because an Activity
is a Context), but if you are calling it elsewhere, you need to pass a Context. In a fragment
you may also have access to the getActivity() function, which returns the Acitivity-Context.
20. create()
Creates an AlertDialog with the arguments supplied to this builder. Calling this method
does not display the dialog. If no additional processing is needed, show() may be called
instead to both create and display the dialog.
21. clearChart()
Resets and clears the data object. Specified by clearChart in class BaseChart.
22. onBackPressed():
If we have Override onBackPressed() method then we have to call finish() explicitly to
destroy activity. Finish: If we implement finish() method it intended to close current
Activity. If our application don't have top backstack will redirect to android Home Screen.
23. getWindow()
We have a managed reference to our activity in a view, which we can retrieve using
getContext(). Cast it to Activity and can use any methods from the activity, such as
getWindow().
• Volley- To load JSON data from the API into the Android app.
• Card View- It represented within the grid layout to create a separate card into four
sections.
• Recycler View- To show data in form list that is to display various state and district cases.
• Swipe Refresh Layout- To refresh the page or the layout to the current running data to
progress and to update the app to recent track.
• Firebase- To implement the versioning feature and to update real-time database whenever
app updates the version name will directly appear in the app.
Every app project must have an AndroidManifest.xml file (with precisely that name) at the
root of the project source set. The manifest file describes essential information about your
app to the Android build tools, the Android operating system, and Google Play.
While building our app into the final application package (APK), the Android build tools
use the package attribute for two things:
• It applies this name as the namespace for our app's generated covid19tracker.java class
(used to access our app resources).
• It uses this name to resolve any relative class names that are declared in the manifest file.
For each app component that we created in our app, must declare a corresponding XML
element in the manifest file:
An app component can have any number of intent filters (defined with the <intent- filter>
element), each one describing a different capability of that component. A number of
manifest elements have icon and label attributes for displaying a small iconand a text label,
respectively, to users for the corresponding app component.
To perform network operations in our application, our manifest must include the following
permissions:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Before adding networking functionality to our app, we need to ensure that data and
information within our app stays safe when transmitting it over a network. To do so, follow
these networking security best practices:
• Minimize the amount of sensitive or personal user data that we transmit over the network.
• Consider creating a network security configuration, which lets our app trust custom
certificate authorities (CAs) or restrict the set of system CAs that it trusts for secure
communication.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.aar.dairio">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher2_round"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher2_round"
android:supportsRtl="true"
android:theme="@style/Theme.Dairio">
<activity android:name=".PostJournalActivity"></activity>
<activity android:name=".MainActivity">
<intent-filter>
</intent-filter>
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
</application>
</manifest>
<LinearLayout
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="match_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="18dp"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/grad_bg"
tools:context=".MainActivity">
<TextView
android:id="@+id/Title"
android:layout_width="371dp"
android:layout_height="wrap_content"
android:fontFamily="@font/almendra_display"
android:text="@string/Title3"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="46sp"
android:textStyle="bold" />
<RelativeLayout
android:id="@+id/relayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="90dp"
app:cardCornerRadius="8dp"
app:cardElevation="6dp"
app:cardUseCompatPadding="true">
<TextView
android:id="@+id/tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/tagtext2"
android:textSize="19sp" />
</androidx.cardview.widget.CardView>
</RelativeLayout>
<Button
android:id="@+id/startButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/letsgo"
android:background="@android:color/transparent"
android:textColor="@color/ecolor4b"/>
</LinearLayout>
package com.aar.dairio;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.firestore.CollectionReference;
import com.google.firebase.firestore.EventListener;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.FirebaseFirestoreException;
import com.google.firebase.firestore.QueryDocumentSnapshot;
import com.google.firebase.firestore.QuerySnapshot;
import java.util.Objects;
import util.JournalApi;
import javax.annotation.Nullable;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Objects.requireNonNull(getSupportActionBar()).setElevation(0);
firebaseAuth = FirebaseAuth.getInstance();
@Override
currentUser = firebaseAuth.getCurrentUser();
if (currentUser != null) {
currentUser = firebaseAuth.getCurrentUser();
collectionReference
.whereEqualTo("userId", currentUserId)
.addSnapshotListener(new EventListener<QuerySnapshot>() {
@Override
@Nullable FirebaseFirestoreException e) {
if (e != null) {
return;
String name;
if (!queryDocumentSnapshots.isEmpty()) {
journalApi.setUserId(snapshot.getString("userId"));
journalApi.setUsername(snapshot.getString("username"));
startActivity(new Intent(MainActivity.this,
JournalListActivity.class));
finish();
});
}else {
};
getStartedButton.setOnClickListener(new View.OnClickListener() {
@Override
//we go to LoginActivity
startActivity(new Intent(MainActivity.this,
LoginActivity.class));
finish();
});
@Override
super.onStart();
currentUser = firebaseAuth.getCurrentUser();
firebaseAuth.addAuthStateListener(authStateListener);
@Override
super.onPause();
if (firebaseAuth != null) {
firebaseAuth.removeAuthStateListener(authStateListener);
CHAPTER 5
TESTING
System testing is the stage of implementation, which is aimed at ensuring that the system
works accurately and efficiently before live operation commences. Testing is vital to the
success of the system. Testing is the process of executing a program with the explicit
intention of finding errors that is making the program fail. The tester may analysts,
programmer or a specialist trained for software testing, is actually trying to make the
program fail. Analysts know that an effective testing program does not guarantee system
reliability. Therefore, reliability must be designed into the system.
Test cases:
CHAPTER 6
SCREENSHOTS
CONCLUSION
It has been an interesting journey through the development of this project. At the beginning
we used our limited knowledge to implement only the basic features. However, through the
months of development, new issues and bugs led to new ideas which led to newer methods
of implementation which, in turn, led to us learning even more features of the Android
Studio and apply more creative and efficient ways to perform the functions. We used Oreo
version of android which helped us in adding flexibility to the various parts of the program,
making the further addition of newer features easier and less time consuming which, again,
led to the possibility of adding even more features. This sequential chain reaction of
progress and ideas has enabled to learn so much through the months of working on this
project and we have done our best to add as many features as we could and provide a user
interface that is easy and intuitive to use.
Before concluding, it is worth mentioning that this project would never have been possible
without the tremendous amount of encouragement by the staff and guides of our
department.
REFRENCES
1. Erik Hellman, "Android Programming - Pushing the Limits", 1" Edition, Wiley India
2014.
2. Dawn Griffiths and David Griffiths, "Head First Android Development", 1" Edition
3.Bill Phillips, Chris Stewart and Kristin Marsicano. "Android Programming: The Big
Nerd Ranch Guide", 3rd Edition, Big Nerd Ranch Guides, 2017.
4. http://developerfirebase/android.com.