Escolar Documentos
Profissional Documentos
Cultura Documentos
Social Media App is under the software Android Studio. The front-end is handled by the
Extensible Markup language, Java and back-end is handled by the Firebase .The database is
required for the software . The plan of implementation goes as follows:
Goal: The goal of this application is the people can interact with each other through
this application.
Deadlines: The Gantt Chart showed timelines to when the module had to be started
and when submitted.
Gathering Resources: This phase included where one had to gather software and
hardware in order to make the application.
Taking References: This phase included taking help from tutorials and people to
develop the application.
Development: This is the phase where the application was actually developed using
respective software, here Android studio is used.
Error Solving: This included solving the errors wherever generated.
Testing: Testing was where the software was verified whether the functionalities are
working as expected or not, if not, they were changed and tested again.
5.2 Coding Details
The details explained here are the main code modules that make the application
working, some of which perform special functionalities. The code is in the Xml
and Java in android studio.
Homeactivity.java:
public class SignInFragment extends Fragment {
private static SignInFragment signInFragment = null;
private TextView textViewHintSignUp,textViewSignUp,forgetPasswordTextView;
private Button buttonSignIn;
private EditText editTextEmail, editTextPassword;
private ProgressDialog progressDialog;
private FirebaseAuth firebaseAuth;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle
savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
firebaseAuth = FirebaseAuth.getInstance();
initView(view);
initViewListeners();
textViewSignUp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
textViewClick();
}
});
buttonSignIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (checkValidation()){
progressDialog = new ProgressDialog(getContext());
progressDialog.setTitle("Please wait while logging in.. ");
progressDialog.setCancelable(false);
progressDialog.setIndeterminate(true);
progressDialog.show();
allowingUserToLogin();
}
}
});
forgetPasswordTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Objects.requireNonNull(getActivity())
.getSupportFragmentManager()
.beginTransaction()
.replace(R.id.loginContainer,ResetPasswordFragment.getInsta
nce())
.commit();
}
});
}
if (email.isEmpty()){
editTextEmail.setError(Constants.EMAIL_ERROR);
return false;
}
if (password.isEmpty()){
editTextPassword.setError(Constants.PASSWORD_ERROR);
return false;
}
return true;
}
@Override
public void onFailure(String message) {
Toast.makeText(getContext(),"Error Occurred While Login
"+message,Toast.LENGTH_SHORT).show();
progressDialog.dismiss();
}
});
signInAsyncTask.execute();
}
editTextEmail = view.findViewById(R.id.edtTextEmail);
editTextPassword = view.findViewById(R.id.edtTextPassword);
buttonSignIn = view.findViewById(R.id.btnSignIn);
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_sign_in, container, false);
}
@Override
public void onStart() {
super.onStart();
FirebaseUser firebaseUser = firebaseAuth.getCurrentUser();
if (firebaseUser != null){
sendUserToHomeActivity();
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
}
@Override
public void onDetach() {
super.onDetach();
}
}
Postactivity.java:
public class PostViewActivity extends AppCompatActivity {
firebaseAuth = FirebaseAuth.getInstance();
currentUserId =
Objects.requireNonNull(firebaseAuth.getCurrentUser()).getUid();
setContentView(R.layout.activity_post_view);
String postKey =
Objects.requireNonNull(Objects.requireNonNull(getIntent().getExtras()).get(Constant
s.POST_KEY)).toString();
clickPostRef =
FirebaseDatabase.getInstance().getReference().child(FireBaseConstants.NODE_POSTS).c
hild(postKey);
initView();
initListeners();
descriptionTextView.setText(description);
Picasso.get().load(image).into(postImageView);
if (currentUserId.equals(databaseUserId)){
deleteButton.setVisibility(View.VISIBLE);
editButton.setVisibility(View.VISIBLE);
}
editButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editCurrentUserPost(description);
}
});
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
deleteButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
deleteCurrentPost();
}
});
clickPostRef.child("description").setValue(inputField.getText().toString().trim());
Toast.makeText(PostViewActivity.this,"Post updated
Successfully",Toast.LENGTH_SHORT).show();
}
});
Objects.requireNonNull(dialog.getWindow()).setBackgroundDrawableResource(R.color.co
lorBackground);
}
Toast.makeText(PostViewActivity.this,Constants.DELETE_POST_MESSAGE,Toast.LENGTH_SHO
RT).show();
}
deleteButton.setVisibility(View.INVISIBLE);
editButton.setVisibility(View.INVISIBLE);
}
}
Profile.java:
public class ProfileActivity extends AppCompatActivity {
private TextView usernameTextView, userProfNameTextView, userStatusTextView,
userCountryTextView, userGenderTextView, userRelationshipStatusTextView,
userDobTextView;
private CircleImageView userProfileCircleImageView;
private DatabaseReference profileUserRef;
private FirebaseAuth firebaseAuth;
private String currentUserId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
firebaseAuth = FirebaseAuth.getInstance();
currentUserId =
Objects.requireNonNull(firebaseAuth.getCurrentUser()).getUid();
profileUserRef =
FirebaseDatabase.getInstance().getReference().child(FireBaseConstants.NODE_USER).ch
ild(currentUserId);
initView();
initListeners();
}
Picasso.get().load(profileImage).placeholder(R.drawable.ic_logo_profile).into(userP
rofileCircleImageView);
usernameTextView.setText("@" + username);
userProfNameTextView.setText(fullname);
userGenderTextView.setText("Gender: " + gender);
userStatusTextView.setText(status);
userCountryTextView.setText("Country: " + country);
userDobTextView.setText("DOB: " + dob);
userRelationshipStatusTextView.setText("Relationship Status: "
+ relationshipStatus);
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
userProfileCircleImageView = findViewById(R.id.profile_pic);
}
}
5.2.1 Code Efficiency
Code efficiency means how well the code is optimized. The code has been written in a
such a way, that can run on any mobile.
The code is given proper labels so that for further developments, the next developer
can understand what the code snippet actually means. The modules define themselves and
hence make it easy for the developer to make further coding.
This code can be said reliable, fast processing and efficient. The code modules can
also be used in some other application development. Some of the features, one of which is the
customizations feature, can be used in other modification application.
The code optimisation has been handled by adding comments in between codes to
make the codes more readable and clear what the code is doing.
In this application I have done soft coding by giving constants in the util folder if the
person has done hard coding then there may be led to an error if the user has typed wrong
variable in it. In soft coding the user has written specified variable and if he want to change
the name of the variable that person can easily changed the variable name in constant folder.
Using firebase the Storage of images and databases is done online hence the
application does not store any data in offline storages. Therefore the application is lighter
and easy to use. There are simple buttons which clearly say what action they perform.
Postgram can run on any android device with any version greater than KitKat(4.4)
and with basic 3 Gb Ram .
5.3 Testing Approaches:
• System Testing
System testing is a critical element of quality assurance and represents the ultimate review
of analysis. design and coding. Test case design focuses on a set of techniques. for the
creation of test because that meet overall testing objective. When a system is developed it is
hoped that it perform properly. The main purpose of testing an information system is to find
the errors and correct them. The scope of system testing should include both manual and
computerized operation. System testing is comprehensive evaluation of the program.
manual procedures. computer operations and controls. System testing is the process of
checking whether the developed system is wonting according to the objective and
requirement. All testing is to be conducted in accordance to the test conditions specified
earlier. This will ensure t. the test coverage meets the requirements and that testing is done
in a systematic manner.
The process of analysing the software item to detect the differences between existing
or required condition and evaluate the features of the software items. The thorough testing
of the system before release of the software needs to be done vide the various test cases and
modes so that the software becomes devoid of bugs and uses minimum space requirements
as well as minimum time to perform. The test cases were selected beforehand with expected
results defined and actual results recorded for comparison. The selection of test cases is
done vide “White Box Testing'. technique to check the internal programming logic and
efficiency and vide 'Black Box Testing.' technique to check software requirement fulfilment
with intension of finding maximum number of errors with minimum effort and time.
Although test cases are a design by considering the cyclomatic complexity. conditional test.
still the software code is not in its optional form. as all other possible alternative parts in the
software are not considered. At the integration level. the software will be passing to the
third party tests which would further enhance the software optimality and efficiency.
• TEST CHARACTERS :
4.A good test should be neither too simple nor too complex.
• BLACK BOX TESTING:
The method of Black Box Testing is used by the software engineer to derive the required
results of the test cases:
1.Black Box Testing alludes to test that are conducted at the software interface.
2.A Black Box Test examines some fundamental aspect of a system with little regard for the
internal bgic structure of the software.
3.A limited number of important logical paths can be selected and exercised. 4.Important
data structure can be probed for validity.
Black box testing was performed to find errors in the following categories:-
• Graphics error.
•File error.
• Pointer error.
• Variable error.
• Performance error
White Box Testing is sometimes called Glass Box Testing. Using White Box Testing
methods the software engineer can derive the following test cases:
1.Guarantee that all independent paths within a module have been exercised at least once.
3.Execute all loops at their boundaries and within their operational bounds.
4.Exercise internal data structures to ensure the validity.50
•Unit system of argument transmitted is called modules equal unit system of parameter.
Tests were performed to find conformity with the requirements. Plans and procedures were
designed to ensure that all functional requirements are satisfied. The software was alpha-
tested. There are two goals in preparing test plans. Firstly, a properly detailed test plan
demonstrates that the program specifications are understood completely. Secondly, the test
plan is used during program testing to prove the correctness of the program.
• Post:
This was not an error, rather a modification done. The results of the Post were
supposed to be come in a simple list view . But the modification done is that the results
now come in a card view with the specific design.
• Profile Image:
At the beginning the profile image used to be regular it does not look good in
design after that I found a tutorial on Youtube with the help of that tutorial the person has
made a circular_image view which I have used in this tutorial.
• Image fetching:
The image was not been fetched at the beginning of the project the images was not been
stored in the firebase and the imaes were not been fetched to firebase I have checked a
tutorial online and fehched the image to the database.
Chapter 6:
Conclusion and future work
6.1 Test case Report:
Sign_in
Sign_up
Reset Password:
User details:
Update Post:
Messages:
Sign_up:
Sign in:
The user has to sign in the email and password which that have been entered during
the sign_up activity
Forgot password:
The user has to enter e-mail id that have been registered after that there is
verification send to the mail id through which the person can enter new password and
confirm password.
After opening gmail account you have to enter the password and then the user password
has been changed.
Navigation_button:
The user can click on the upper left button which is navigation view in which the
user can see the profile image and the list of menus in which the different actions have been
performed. In menu button there are different buttons used they are Add New Post, Profile,
Home, Friends, Find Friends, Messages, Update Profile and Log_out option.
Home_activity:
It consists of all the posts the user has posted .The number of new posts have been updated
in upper order and the older posts have been in the lower order. All the posts of this
application will be in this screen
Update Post :
There is update post button on the upper right corner of this application from this
button the user can add new post in the home screen first the user has to select the picture
that want to be uploaded on this screen and after that the person has to write the text in the
description where the user can define about the post.
Friends:
Functionality:
In this section the users has the list of people that have friends.
Find Friends :
Functionality:
In this screen the user can see the users who are using this application he/she has to
type their name and send them friend request to which they both can became friends.
Edit/Delete a post:
Functionality:
The user has uploaded his post that post can be edit or deleted from this application
through this button. The post will also be deleted from the database.
Messages:
Functionality:
In message section the user click on the message then after there will be a dialog box
in which the user is asked to view the profile and send the messages to another user. After
clicking on message section the person can type text message and the reciver will see the
message.
Comment :
Functionality:
In comment section The user can write the comment in text order to the another user profile
where the user want to write.
In this screen the user can accept the request or the user can decline the request. The
user can accept the request after accepting the request both the users are friend and they
can unfriend each other to them.
Chapter 7
7.1Conclusion
So here we come to end of the documentation for the android application Postgram.
An application whose features are to interact to surrounding world. It is a basic application
with not so many features or advanced things.
In chapter 1, we saw the synopsis for the application. The background which defined
why the idea for implementation of such an application came. It is an application mainly for
any age group to interact to each other. They can share their post using this application and
they can interact with the world. They can like the posts and comments on the another profile
and interact with each other.
In chapter 2, we saw the technologies which are already existing in the market there
are so many applications such as Facebook, Instagram, Snapchat, Twitter, etc. .These all
applications are free to use but they have certain limitation. So I have made this application to
break the certainity.
In chapter 3, we saw the requirements for the application to run. A person will need
an android device with version KitKat 4.4 and above and RAM of 3GB. Also, an active
internet connection is required since the application uses firebase as the database. We also
saw the UML diagrams and flow charts of the application working with Gantt chart and WBS
chart for the schedule we followed for the application development.
In chapter 5, we saw the implementation and testing of the application. The code
snippets and explanation of the main functions of the application are defined and application
is tested with first units i.e. by modules and then by integration i.e. the whole app is tested
out. Also, the modifications and improvements done in the application are defined.
In chapter 6, there are test reports which say the tests we did are working accordingly
or not. Also there is a user documentation or user manual which shows the user how to use
the application and its features. Now, in conclusion Postgram the application is made for
people mainly with preferences and for people who wants to interact to the people they can
share their work also. Since, most of the people now have an android phone basically and an
internet connection, this application can be useful to many people.
7.2 Limitation of Project:
The application performs the main features it promises to do but there are still some
features it fails to performs. Some of them are as follows.
The user should have the internet connection otherwise he/she could not open an app.
Without the internet this application could not start.
The user should have an android phone otherwise the application could not be run in
Io’s application
The application is based on English language the user should know the basic
language.
In comments section the user can’t delete the comment if the user want to delete the
comment then the user may have to delete the post
References:
• https://developer.android.com/
• www.youtube.com
• https://en.wikipedia.org
• www.stackoverflow.com
•https://github.com/hdodenhof/CircleImageView
• http://softwaretestingfundamentals.com/gray-box-testing/
• http://softwaretestingfundamentals.com/integration-testing/
• http://softwaretestingfundamentals.com/white-box-testing/
CHAPTER 6
CHAPTER 7: CONCLUSIONS
7.1 Conclusion
REFERENCES