You are on page 1of 72

A PROJECT REPORT

ON
“E- LEARNING APPLICATION”
SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE AWARD
OF
DIPLOMA IN
INFORMATION TECHNOLOGY

SUBMITTED TO
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION, MUMBAI
SUBMITTED BY

Name of Student Enrollment No.


1. ANAND SANTOSH KAKAD 2112410154
2. PANKAJ NAJUKRAO GORLE 2112410146
3. YASH SHRIDHAR HARNE 2112410149
4. PRANAV SANTOSH KAKAD 2112410147
5. ADITYA GOPAL KHUMKAR 2112410160

GUIDED BY: -
Prof. Megha R. Lolure

GOVERNMENT POLYTECHNIC, MURTIZAPUR


2023-2024

1
GOVERNMENT POLYTECHNIC, MURTIZAPUR

CERTIFICATE

This is to Certify that the project report entitled “ E - LEARNING APPLICATION ” was
Successfully completed by Student of sixth semester. Diploma in Information Technology.

1. GANESH RAVINDRA BADGUJAR 2112410124


2. SAURABH PRADEEP DHANOKAR 2112410134
3. MOHIT ANIL LADHE 2112410163
4. HIMANSHU NARENDRA SARODE 2112410174
5. MAYUR SHRIKRUSHNA SAWLE 2112410175

in partial fulfillment of the requirements for the award of the Diploma in Information
Technology and submitted to the Department of Information Technology of Government
Polytechnic, Murtizapur work carried out during a period for the academic year 2023-2024.
as per curriculum.

Prof. Megha R. Lolure Prof. A. P. Jane


Guide HOD

Dr. A.A.Gulhane

External Examiner Principal


Government Polytechnic,Murtizapur

2
ACKOWLEDGEMENT

We take this opportunity to express our profound gratitude and the whole hearted thanks to
our project guide, Prof A.P.Jane , HOD, DEPARTMENT OF INFORMATION TECHNOLOGY for
her valuable guidance, kind suggestions and constant encouragement and providing us the
opportunity to work in an exciting and challenging field of Android Application. Our in interaction
with him has been of immense help in defining our project goal and in identifying ways to achieve
the goal.
We are also very much indebted to, head Prof A.P.Jane HEAD OF DEPARTMENT OF
INFORMATION TECHNOLOGY for motivation and effective support. We also thank all Non-
Teaching Staff of the Department for their comment and opinions and above all valuable guidance
and timely suggestion to accomplish the project dissertation.
Last but not the least, we would like to thank all our friend who helped us directly or indirectly
for the success of our project and the team spirit shown by all has made a project report work
successful.

3
ABSTRACT

E-learning fulfils the thirst of knowledge and offers online content that can be
delivered for the learner at anywhere, anytime and any age through a wide range of e-
learning solution while compared with traditional learning system. It also provides the
rapid access to specific knowledge and information. With the rapid growth of voluminous
information sources and the time constraint the learning methodology has changed.
Learners obtain knowledge through e-Learning systems rather than manually teaching
and learning. In this research paper proposes the elearning management system with web
services oriented frame work and SOA. This system supports the cross browser and fully
integrated with different databases.
This system focused around the several features namely Content Management,
Content Protection, Learning Management, Delivery Management, Evaluation
management, Access Control, etc., and mainly focused on integrated platform needed for
e-learning and managements.

Keywords Quiz, Question ,Homework, Study material, Recording, Notice Board Android
Application.

4
Index
Sr. No. Contents Page No.
Introduction
1.1 Motivation
1 1.2 Objectives 12 to 17
1.3 Brief Description of the system/project work

Literature Review
2 2.1 Related Topics 19 to 21
2.2 Summary & Discussion

3 Scope of the project 23

4 Methodology
4.1Designing Phase
4.2Implementation Phase
25 to 28
4.3Testing Phase
4.4 Evaluation Phase

Details of Designs, working and processes


5.1 Proposed design
{Brief description, System block diagram,
Working}
5.2 Implementation details
5 30 to 48
5.3 Required software, hardware platform etc..)
5.4 Detail designed
{Algorithms / DFD / Structures used etc}

Result and Applications


6.1 Setting environment / configuring system,
6 6.2 System Execution details
Screen shots, Results,
Graphs 50 to 58
6.3 Applications

Conclusion & Future scope


7 7.1 Future scope 60 to 65
7.2 Conclusion

5
Chapter 1

6
1. INTRODUCTION

This chapter deals with the problem statement that we are intending to solve, the objectives
of our project, the future work that can be done and the limitations of our project. The "E-
learning Management System" has been developed to override the problems prevailing in the
practicing manual system. This software is supported to eliminate and in some cases reduce the
hardships faced by this existing system. Moreover this system is designed for the particular
need of the company to carry out operations in a smooth and effective manner.
The application is reduced as much as possible to avoid errors while entering the data. It
also provides error message while entering invalid data. No formal knowledge is needed for
the user to use this system. Thus by this all it proves it is user-friendly. E-Learning Management
System, as described above, can lead to error free, secure, reliable and fast management system.
It can assist the user to concentrate on their other activities rather to concentrate on the record
keeping. Thus it will help organization in better utilization of resources.
Every organization, whether big or small, has challenges to overcome and managing the
information of Student, Assignment, QUIZ, CLASS, and QUESTION. Every E-learning
Management System has different Assignment needs, therefore we design exclusive employee
management systems that are adapted to your managerial requirements. This is designed to
assist in strategic planning, and will help you ensure that your organization is equipped with
the right level of information and details for your future goals. Also, for those busy executive
who are always on the go, our systems come with remote access features, which will allow you
to manage your workforce anytime, at all times. These systems will ultimately allow you to
better manage resources.

1.1 Motivation
Polytechnic and Engineering as we all know is the application of science to the
optimum conversion of the resources of nature to the uses of human kind. Engineering has
evolved a lot since its inception and lots of problems has been solved by creating its
applications. But there are still many problems unsolved and so we started our research to
find that one problem which really needed development. During this investigation, we came
across the problem . Elearning becomes an important means of knowledge and skill
acquisition in higher education institutions. Students’ motivation to learn contributes to
knowledge acquisition and hence is of paramount importance to their success in the future.
Many factors impact students’ motivation to learn, and the question of how to stimulate
student to learn remains the subject of much research. As concerns teachers, their role in the
educational process is to create a positive environment which encourages learning and
students’ long-term success. Finally, we came up with the idea that we call the “E-
LEARNING APPLICATION” which works on Android App. Though there’s much work
needed to make the proposed system more efficient, however it will surely be an immense
improvement in the existing solutions.
7
1.2 Objectives

The main objective behind this project is to provide a user friendly environment to provide
knowledge and give everyone a chance to learn, irrespective of where they are, provided they
register themselves with the system.
The main features that the system provides can be made use of, once the registered people
select their interested subject and take a starter test. This helps to establish incremental learning
process. After taking this, based on their level of competence, they can take available tutorials,
take online tests and also discuss an issue/topic by posting messages in the discussion forum.
Along with this they can also take real time simulations of the most widely known competitive
exams. Project on E-learning Management System is to manage the details of Assignment,
Student, TEACHER, QUIZ, QUESTION. It manages all the information about Assignment,
CLASS, QUESTION, Assignment. The project is totally built at administrative end and thus only
the administrator is guaranteed the access. The purpose of the project is to build an application
program to reduce the manual work for managing the Assignment, Student, CLASS, TEACHER.
It tracks all the details about the TEACHER, QUIZ, QUESTION, ASSIGNMENT,
HOMEWORK,STUDY MATERIAL,RECORDING,NOTICE BOARD.

1.3 Brief description of the system/ Project work


Provides the searching facilities based on various factors. Such as Assignment, Teacher,
Quiz, Question ,Homework, Study material, Recording, Notice Board. E-learning Management
System also manage the Class details online for Quiz details, Question details, Assignment,
Homework, Study material, Recording, Notice Board .It tracks all the information of Student,
CLASS, and QUIZ etc. Manage the information of Student.
Shows the information and description of the Assignment, TEACHER To increase
efficiency of managing the Assignment, Student. It deals with monitoring the information and
transactions of QUIZ. Manage the information of Assignment Editing, adding and updating of
Records is improved which results in proper resource management of Assignment data. Manage
the information of QUIZ Integration of all records of QUESTION Papers.

8
Chapter 2

9
2. LITERATURE SURVEY

E-learning systems and programs have played an important role in improving the
interaction between students and teachers. Among the prominent activities provided by learning
management systems are e-teaching materials, which can be presented in different formats.
Teaching materials in the form of open educational resource (OER) textbooks are discussed
by Dennen and Bagdy (2019). Their study indicated that students have given positive feedback
on OER textbooks and that this type of material contributed to helping them meet course
learning objectives. One recent study found that course activities aligned with learning
objectives such as case studies, group assignments, problem solving, and peer-to-peer
interaction have the highest impact on both student learning and engagement (Sadaf et al.,
2019). E-discussion that aims to engage students with their instructors, course content, or with
each other via synchronous or asynchronous modes has been well documented in the literature.
A study conducted by Truhlar et al. (2018) examined the effects of synchronous chats in an
online course and found that assigning roles to students increased the proportion of students
interaction. Prior research has also revealed that online discussion and engaging in interactive
assignments stimulate students to share their opinions and develop a personal perspective
(Buelow et al., 2018). Student opinion of the use of online discussion forums varies across
discussion types: structured discussion forums (guided discussion with clearly identified topic)
were received more positively by students than unstructured (students select the topic on
mutual basis) ones (Tibi, 2018). Asynchronous discussion in an online environment is also
investigated by Mitchell (2019). The majority of students in that study indicated that the debate
assignment assisted them in comprehending the course concepts and understanding them
better.

2.1 Related Topics


Related topics to an e-learning application project encompass various aspects of digital
education, online learning platforms, pedagogy, and technology-enhanced learning

2.2 Summary & Discussion

The main results show significant positive correlations between the key aspects of
eLearning and students’ motivation to learn in AU. This is evidence of the importance of the
appropriate use of key aspects of e-learning in relation to students’ motivation to learn. AU
students have experience dealing with Moodle activities related to e-teaching materials and
assessments. Since the inception of Moodle at AU, the majority of the Moodle activities used
by the students are related to these two activities. Prior experience with Moodle may have also
contributed to the high correlation between motivation and e-teaching materials and
assessments. This argument is supported by other researchers (Yili & Tsai, 2017; Slater &
Davies, 2020; Cundell & Sheepy, 2018). The low correlation between motivation variables
and e-discussion and e-grade checking and feedback could be attributed to the absence of real-
time interaction between students and faculty in the way e-discussion and e-grade checking
and feedback are implemented. The implications of these research findings indicate, on the
one hand, that AU students were intrinsically motivated toward learning via e-teaching
materials and e-assessments and, on the other, that they are aiming to get good grades
10
(extrinsic motivation) without sufficient engagement in asynchronous activities. This implies
that the university needs to encourage faculty to develop strategies to further engage students
with such activities to comprehend the course concepts intrinsically and extrinsically
(Mitchell, 2019; Buelow et al., 2018). In addition, AU should consider developing a course
that can be taken early in the student’s term of study and orients them to the importance of
asynchronous activities.

11
Chapter 3

12
3. Scope of the Project

The scope of an e-learning application is broad and multifaceted, encompassing various aspects of
digital education, online learning platforms, instructional design, and learner engagement. Here's a
breakdown of its scope:

• Content Delivery: Providing a platform for delivering educational content in various


formats, including text-based materials, multimedia resources (videos, audio recordings,
interactive simulations), and assessments.

• Learning Management System (LMS): Developing or integrating a robust LMS to


manage course enrollments, user accounts, content organization, progress tracking, and
performance analytics.

• Interactive Learning Features: Incorporating interactive elements such as quizzes,


assignments, discussions, and virtual labs to engage learners and promote active
participation in the learning process.

• Adaptive Learning: Implementing adaptive learning algorithms and personalized


learning paths to tailor educational experiences to individual learners' preferences,
abilities, and learning goals.

• Collaborative Learning Tools: Integrating features for collaboration, communication,


and peer-to-peer interaction among learners, including discussion forums, group projects,
and collaborative editing tools.

• Assessment and Feedback Mechanisms: Implementing various assessment methods,


including quizzes, exams, essays, and peer reviews, and providing timely feedback to
learners to support their ongoing progress and improvement.

• Accessibility and Inclusivity: Ensuring that the e-learning platform is accessible to


users with diverse needs, including those with disabilities or language barriers, by
adhering to accessibility standards and providing alternative formats for content delivery.

• Mobile Learning (M-Learning): Optimizing the e-learning application for mobile


devices, allowing learners to access educational materials and participate in activities
anytime, anywhere, and on any device.

• Data Analytics and Reporting: Incorporating data analytics tools to track learner
engagement, performance, and progress, and generate reports and insights to inform
instructional design and decision-making.

• Continuous Improvement and Updates: Establishing processes for ongoing evaluation,


feedback collection, and iteration to continuously improve the e-learning platform,
update content, and adapt to evolving educational needs and technologies.

13
Chapter 4

14
4. Methodology

4.1 Designing Phase

During the designing phase of an e-learning app, the following steps are typically involved:

1. Identifying Goals and Objectives: Understand the purpose of the e-learning app, the
target audience, and the learning objectives it aims to achieve.

2. Research and Analysis: Conduct research to understand user needs, preferences, and
behaviors. Analyze competitor apps and existing e-learning platforms to identify trends
and best practices.

3. Storyboarding: Create a storyboard outlining the flow of content and interactions


within the app. Define the structure of lessons, modules, quizzes, and other learning
components.

4. User Experience (UX) Design: Design the user interface (UI) to be intuitive and user-
friendly. Develop wireframes or mockups to visualize the layout and navigation of the
app.

5. Content Creation and Curation: Develop or curate content that aligns with the
learning objectives and target audience. Ensure that the content is engaging, relevant,
and effectively communicates key concepts.

6. Visual Design: Apply visual design principles to create a cohesive and visually
appealing interface. Choose appropriate colors, typography, and imagery that enhance
readability and engagement.

7. Interactive Elements: Incorporate interactive elements such as quizzes, simulations,


games, and multimedia content to enhance learning and engagement.

8. Accessibility Considerations: Ensure that the app is accessible to users with


disabilities by following accessibility guidelines. Design features such as alternative
text for images, keyboard navigation, and screen reader compatibility.

9. Prototype Development: Develop prototypes or clickable prototypes to test the


usability and functionality of the app. Gather feedback from stakeholders and users to
iterate on the design.

10. Usability Testing: Conduct usability testing to identify any usability issues or pain
points in the app. Use feedback from users to refine the design and improve the overall
user experience.

11. Iterative Design Process: Iterate on the design based on feedback and testing results.
Continuously refine and improve the app to ensure that it meets the needs of users and
achieves its learning objectives.

15
12. Finalizing Design Assets: Prepare final design assets including graphics, icons, and
multimedia content for development.

4.2 Implementation Phase


During the implementation phase of an e-learning app, the focus is on bringing the design to life and
developing a functional application. Here are the key steps involved:

1. Development Environment Setup: Set up the development environment including


necessary software, tools, and platforms for app development.

2. Frontend Development: Develop the frontend of the e-learning app, including user
interface components, navigation elements, and interactive features. Implement the visual
design and ensure consistency with the approved design mockups.

3. Backend Development: Build the backend infrastructure and functionality required to


support the e-learning app. This includes user authentication, data storage, content
management, and integration with external systems or APIs.

4. Content Integration: Integrate the learning content developed during the design phase
into the app. This may involve importing existing content, creating new content, or
connecting to external content repositories.

5. Interactive Features Implementation: Implement interactive features such as quizzes,


assessments, discussions, and multimedia content to enhance the learning experience.

6. User Authentication and Access Control: Set up user authentication mechanisms to


ensure secure access to the app. Implement access control measures to restrict access to
certain content or features based on user roles and permissions.

7. Testing and Quality Assurance: Conduct thorough testing to identify and fix any bugs,
errors, or inconsistencies in the app. Test the app across different devices, browsers, and
operating systems to ensure compatibility and functionality.

8. Performance Optimization: Optimize the performance of the app to ensure fast loading
times and smooth user experience. This may involve optimizing code, compressing
assets, and implementing caching strategies.

9. Security Implementation: Implement security measures to protect user data and prevent
unauthorized access or data breaches. This includes encryption, secure authentication,
and regular security audits.

10. Localization and Internationalization: Localize the app to support multiple languages
and regions. Ensure that the app is culturally sensitive and adapts to the preferences of
different user groups.

11. Deployment: Deploy the e-learning app to production servers or app stores for public
access. This may involve setting up hosting, configuring domain names, and submitting
the app to app stores for review and approval.
16
12. Monitoring and Maintenance: Monitor the performance and usage of the app post-
launch. Implement regular updates and maintenance to address any issues, improve
functionality, and add new features based on user feedback.

4.3 Testing Phase

During the testing phase of an e-learning app, it's crucial to ensure that the app functions
correctly, meets user requirements, and provides a seamless learning experience. Here are the
key steps involved in the testing phase:

1. Functional Testing: Verify that all functionalities of the e-learning app work as intended.
Test features such as user authentication, content navigation, interactive elements
(quizzes, assessments), multimedia playback, and any other core functionalities.

2. Usability Testing: Evaluate the user interface (UI) and user experience (UX) of the app.
Test the app with representative users to identify any usability issues, navigation
difficulties, or areas where the user experience can be improved.

3. Compatibility Testing: Test the app across different devices, browsers, and operating
systems to ensure compatibility. Verify that the app works correctly on various screen
sizes, resolutions, and device configurations.

4. Performance Testing: Assess the performance of the app under different conditions. Test
the app's loading times, response times, and overall speed to ensure optimal performance,
even under heavy usage or network constraints.

5. Security Testing: Verify that the app is secure and protects user data. Conduct security
testing to identify and address vulnerabilities such as data breaches, unauthorized access,
and other security threats.

6. Accessibility Testing: Ensure that the app is accessible to users with disabilities. Test
features such as screen readers, keyboard navigation, and alternative text for images to
ensure compliance with accessibility standards such as WCAG (Web Content
Accessibility Guidelines).

7. Content Testing: Review and validate the accuracy, relevance, and completeness of the
learning content within the app. Verify that all multimedia elements (videos, images,
audio) are displayed correctly and that textual content is error-free and easy to understand.

8. Localization Testing: Test the app's localization features to ensure support for multiple
languages and regions. Verify that translated content is accurate and culturally
appropriate, and that the app adapts correctly to different language settings.

9. User Acceptance Testing (UAT): Involve stakeholders and end-users in user acceptance
testing to validate that the app meets their expectations and requirements. Gather feedback
from users to identify any issues or areas for improvement.

17
10. Regression Testing: Conduct regression testing to ensure that new updates or fixes do not
introduce any unintended consequences or regressions. Verify that previously working
functionalities remain intact after changes are made to the app.

11. Documentation Review: Review the app's documentation, including user guides, help
resources, and support materials, to ensure accuracy and completeness.

4.4 Evaluation Phase

In the evaluation phase of an e-learning app, the focus is on assessing its effectiveness,
usability, and impact on learning outcomes. Here are the key steps involved in the evaluation
phase:

1. Define Evaluation Objectives: Clearly define the objectives of the evaluation. Determine
what aspects of the e-learning app will be evaluated, such as usability, learning
effectiveness, user satisfaction, or technical performance.

2. Select Evaluation Methods: Choose appropriate evaluation methods based on the


objectives defined. Common evaluation methods include surveys, interviews, usability
testing, learning analytics, and assessment of learning outcomes.

3. Collect Data: Gather data from various sources to assess the e-learning app's
performance. This may involve collecting quantitative data (e.g., user metrics, quiz scores)
and qualitative data (e.g., user feedback, observations).

4. Analyze Data: Analyze the collected data to identify trends, patterns, and insights related
to the app's effectiveness and usability. Use statistical analysis techniques to quantify
results and draw meaningful conclusions.

5. Evaluate Learning Outcomes: Assess the impact of the e-learning app on learning
outcomes. Compare pre-test and post-test scores, evaluate knowledge retention, and
measure changes in learner behavior or performance.

6. Assess User Satisfaction: Measure user satisfaction with the e-learning app. Use surveys
or interviews to gather feedback from users regarding their overall experience, usability,
and perceived usefulness of the app.

7. Evaluate Technical Performance: Assess the technical performance of the app,


including loading times, responsiveness, and reliability. Monitor server uptime, error rates,
and other technical metrics to ensure optimal performance.

8. Compare Against Benchmarks: Compare the performance of the e-learning app against
predefined benchmarks or industry standards. Evaluate how the app stacks up against
competitors or similar e-learning solutions.

9. Identify Strengths and Weaknesses: Identify the strengths and weaknesses of the e-
learning app based on the evaluation results. Determine areas where the app excels and
areas where improvements are needed.

18
10. Generate Recommendations: Based on the evaluation findings, generate
recommendations for improving the e-learning app. Prioritize recommendations based on
their potential impact and feasibility of implementation.

11. Iterate and Improve: Use the evaluation results and recommendations to iterate on the
design and functionality of the e-learning app. Implement changes and improvements
based on user feedback and evaluation findings.

12. Document Findings: Document the findings of the evaluation process, including data
analysis, conclusions, and recommendations. Share the evaluation report with stakeholders
and decision-makers to inform future development efforts.

19
Chapter 5

20
5. Details of Designs, working and processes

5.1 Proposed design

• Brief Description:
The proposed e-learning application aims to provide a comprehensive online learning
platform for delivering educational content, facilitating interactive learning
experiences, and supporting collaboration among learners and instructors. The platform
will offer a user-friendly interface, personalized learning paths, diverse content
formats, and robust assessment tools to enhance learner engagement and effectiveness.

• System Block Diagram:

21
• Working

a. User Interface (UI): The UI serves as the front-end of the e-learning application,
providing a visually appealing and intuitive interface for learners and instructors to
navigate, access content, and interact with various features and functionalities.

b. Learning Management System (LMS): The LMS acts as the core backend system,
managing user accounts, course enrollments, content organization, progress tracking, and
performance analytics. It provides administrative tools for instructors to create and
manage courses, assignments, assessments, and communication with learners.

c. Content Management System: The CMS enables content creators and administrators to
upload, organize, and manage educational materials, including text-based resources,
multimedia content (videos, audio files, interactive simulations), assessments, and
supplementary materials. It supports version control, collaboration, and content
moderation workflows.

d. Database and Storage Services: The database stores user data, course information,
content assets, user-generated data (e.g., assessment results, discussion posts), and system
logs. Storage services handle the storage and retrieval of multimedia files and other large
data assets, ensuring scalability, reliability, and performance.

5.2 Implementation Details

a) User Authentication and Management: Implement user authentication and


authorization mechanisms to securely manage user accounts, roles, and
permissions. Use technologies such as OAuth, JWT (JSON Web Tokens), or
traditional username/password authentication with secure hashing algorithms.

b) Course Management: Develop features for instructors to create, manage, and


organize courses within the learning management system (LMS). Include options
for adding course descriptions, objectives, learning materials, assignments,
quizzes, and assessments.

c) Content Management: Implement a content management system (CMS) to


upload, organize, and manage educational materials. Support various content
formats such as text, images, videos, presentations, and interactive simulations.
Provide version control, tagging, and search functionalities for easy content
discovery.

d) User Interface Design: Design an intuitive and user-friendly interface for


learners, instructors, and administrators. Use responsive web design principles to
ensure accessibility across different devices and screen sizes. Incorporate modern
UI/UX patterns, navigation menus, and interactive elements to enhance user
engagement.

22
e) Learning Analytics: Integrate analytics tools to track learner progress,
engagement, and performance. Capture data on course completion rates, quiz
scores, time spent on activities, and participation in discussions. Use data
visualization techniques to present insights and trends to instructors and
administrators.

5.3 Required software, hardware platform

• Software:

a) Development Environment: Choose an integrated development environment (IDE)


such as Visual Studio Code, IntelliJ IDEA, or Eclipse for writing code, debugging,
and version control.

b) Programming Languages: Use programming languages suited for web


development such as JavaScript (Node.js), Python, or Java for backend
development, and HTML, CSS, and JavaScript (React, Angular, Vue.js) for frontend
development.

c) Database Management System (DBMS): Select a DBMS for storing and


managing data such as PostgreSQL, MySQL, MongoDB, or Firebase Firestore.
Consider relational databases for structured data and NoSQL databases for flexible
schemas and scalability.

d) Version Control: Utilize version control systems like Git and platforms like
GitHub or GitLab for collaborative development, code repository management, and
version tracking.

e) Content Management System (CMS): Depending on requirements, integrate or


develop a CMS for managing educational content, user-generated content, and
metadata. Popular options include WordPress, Drupal, or custom-built CMS
solutions.

• Hardware

a) Development Machines: Use desktop or laptop computers with sufficient computing power,
memory, and storage capacity for software development tasks. Ensure compatibility with
chosen development environments and tools.

b) Testing Devices: Test the e-learning application on various devices and browsers to ensure
compatibility and responsiveness. Include desktop computers, laptops, tablets, and smartphones
with different screen sizes and operating systems (Windows, macOS, iOS, Android).

c) Server Infrastructure: Deploy servers or utilize cloud computing platforms (AWS, Azure,
Google Cloud) to host the e-learning application, databases, and other necessary services.
Consider factors such as scalability, reliability, and security when selecting server
infrastructure.
23
• Platform

a) Operating System: Choose an operating system (OS) suitable for development and
deployment. Common options include Windows, macOS, and Linux distributions such as
Ubuntu or CentOS.

b) Web Browser: Ensure compatibility with popular web browsers such as Google Chrome,
Mozilla Firefox, Safari, and Microsoft Edge. Test the e-learning application on different
browsers to identify and address compatibility issues.

c) Mobile Platforms: Depending on requirements, consider developing native mobile apps for
iOS and Android platforms using technologies such as Swift/Objective-C (iOS) or
Kotlin/Java (Android), or utilize cross-platform development frameworks like React Native
or Flutter for building hybrid apps.

d) Cloud Services: Leverage cloud computing platforms and services for scalability,
flexibility, and cost-effectiveness. Choose a platform that meets requirements for hosting,
storage, database management, and other infrastructure needs.

5.4 Detail designed

• Algorithm

a) User Authentication Algorithm: Implement an algorithm for user authentication, such as


hashing and salting passwords for secure storage, and verifying credentials during login.

b) Content Recommendation Algorithm: Develop algorithms for recommending relevant


courses, modules, or learning materials to users based on their interests, past activities, and
learning progress.

c) Assessment Grading Algorithm: Design algorithms for grading assessments, quizzes,


and assignments, considering factors such as correct answers, partial credit, and automated
grading rules.

d) Search Algorithm: Implement algorithms for searching and retrieving content based on
user queries, utilizing techniques such as keyword matching, relevance ranking, and
filtering.

e) Data Analytics Algorithms: Utilize algorithms for analyzing learning data, generating
insights, and predicting learner behavior, such as clustering, classification, regression, and
association rule mining.

24
• Data Flow Diagram (DFD):

• Structure:

a) User Data Structure: Define data structures to represent user profiles, including attributes such as
username, password hash, email address, role, preferences, and learning history.

b) Course Data Structure: Design data structures for storing course information, including title,
description, instructor, modules, content files, prerequisites, and enrollment status.

c) Content Data Structure: Specify data structures for managing educational content, such as text
documents, multimedia files, assessments, metadata, and versioning information.

d) Assessment Data Structure: Create data structures to store assessment questions, answers, scoring
criteria, results, feedback, and grading information.

e) Learning Analytics Data Structure: Define data structures for collecting and storing learning
analytics data, including user activity logs, progress tracking, assessment scores, and
engagement metrics.

25
Chapter 6

26
6. Result and Applications

6.1 Setting environment / configuring system

Setting up the environment and configuring the system for the e-learning application
involves several steps:

a. Server Configuration: Install and configure the necessary software components on


the server, including the web server (e.g., Apache or Nginx), database server (e.g.,
MySQL or PostgreSQL), and any additional services required for the application to
function properly.

b. Database Setup: Create the database schema, tables, and indexes required for storing
user data, course information, content metadata, and other relevant data. Set up
database users and permissions to ensure secure access.

c. Application Deployment: Deploy the e-learning application codebase to the server,


ensuring that all dependencies are properly installed and configured. Set up virtual
hosts or subdomains to host the application, and configure DNS settings if necessary.

d. Configuration Files: Update configuration files with appropriate settings for the
server environment, database connection, security parameters, and other
application-specific settings. Make sure to use environment variables or
configuration management tools for sensitive information.

e. Testing Environment: Set up a separate testing environment to validate


changes and updates to the application before deploying them to the production
environment. Use tools such as Docker or virtual machines for creating isolated
testing environments.

6.2 System Execution Details

During system execution, the e-learning application operates according to its design and
functionality. Here are some execution details:

a) User Registration and Login: Users can register for an account or log in using their
credentials to access the e-learning platform.

b) Browsing Courses: Users can browse available courses, view course descriptions,
syllabi, and instructor information, and enroll in courses of interest.

c) Learning Modules: Users can access learning modules within enrolled courses, view
instructional materials, participate in activities, and complete assessments.

27
d) Interactive Features: Users can engage with interactive features such as quizzes,
assignments, discussions, and collaborative projects to enhance their learning
experience.

e) Progress Tracking: The system tracks user progress within courses, recording
completed activities, quiz scores, assignment submissions, and overall course
completion status.

• Screenshot:

28
29
6.3 Applications:

The e-learning application has various applications and benefits, including:

a) Access to Education: Provides access to educational resources and courses to a wide


range of learners, regardless of geographic location or physical barriers.

b) Flexible Learning: Offers flexibility in learning schedules and pace, allowing learners to
study at their own convenience and progress through courses at their own speed.

c) Skill Development: Facilitates skill development and lifelong learning by offering


courses in diverse subjects and disciplines, ranging from academic topics to professional
development and personal enrichment.

d) Cost-Effectiveness: Offers cost-effective alternatives to traditional education, reducing


the need for physical classrooms, textbooks, and other traditional learning materials.

e) Scalability: Scales to accommodate a large number of users and courses, making it


suitable for institutions, organizations, and individuals alike.

30
CODE
Splash.java
package com.mountreachsolution.e_learningapp; import
androidx.appcompat.app.AppCompatActivity; import
android.app.ActivityOptions; import android.content.Intent; import
android.os.Bundle; import android.os.Handler; import
android.util.Pair; import android.view.View;
import android.view.animation.Animation; import
android.view.animation.AnimationUtils; import
android.widget.ImageView;
import android.widget.TextView; public class SplashActivity extends AppCompatActivity { private
static int SPLASH_SCREEN = 5000; // Initialize the objects ImageView splash_app_logo;
TextView splash_app_title; Animation top_to_bottom,bottom_to_top; ActivityOptions options;
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); //find the ids splash_app_logo =
findViewById(R.id.img_splash_logo); splash_app_title = findViewById(R.id.tv_splash_title); top_to_bottom =
AnimationUtils.loadAnimation(this,R.anim.top_to_bottom_anim); bottom_to_top =
AnimationUtils.loadAnimation(this,R.anim.bottom_to_top_anim);
splash_app_logo.setAnimation(top_to_bottom); splash_app_title.setAnimation(bottom_to_top); new
Handler().postDelayed(new Runnable() { @Override public void run() { Intent intent = new
Intent(SplashActivity.this,LoginActivity.class); Pair[] pairs = new Pair[2]; pairs[0] = new
Pair<View,String>(splash_app_logo,"splash_logo"); // pairs[0] = new
Pair<View,String>(splash_app_title,"splash_title");if (android.os.Build.VERSION.SDK_INT >=
android.os.Build.VERSION_CODES.LOLLIPOP) { options =
ActivityOptions.makeSceneTransitionAnimation(SplashActivity.this,pairs[0]); }
startActivity(intent,options.toBundle()); } },SPLASH_SCREEN); } }

splash.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:layout_height="match_parent"
tools:context=".SplashActivity" android:background="@color/purple_700"
android:gravity="center" > <ImageView android:id="@+id/img_splash_logo"
android:layout_width="200dp" android:layout_height="200dp"
android:layout_centerInParent="true" android:src="@drawable/logo"
android:transitionName="splash_logo" /> <TextView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tv_splash_title"
android:layout_below="@+id/img_splash_logo" android:text="Smart Kaksha
App" android:textAlignment="center" android:textSize="28sp"
android:textStyle="bold" android:textColor="@color/white"
android:fontFamily="@font/bungee" android:layout_marginTop="50dp"
android:transitionName="splash_title"/> </RelativeLayout>

Login.java
package com.mountreachsolution.e_learningapp; import
androidx.appcompat.app.AppCompatActivity; import android.app.ActivityOptions;
import android.app.ProgressDialog; import android.content.Intent; import
android.content.SharedPreferences; import android.os.Bundle; import
android.os.Handler; import android.preference.PreferenceManager; import
android.util.Pair; import android.view.View; import android.widget.Button; import
31
android.widget.ImageView; import android.widget.TextView; import
android.widget.Toast; import com.android.volley.DefaultRetryPolicy; import
com.android.volley.Request; import com.android.volley.RequestQueue; import
com.android.volley.Response; import com.android.volley.VolleyError; import
com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley;
import
com.google.android.material.textfield.TextInputEditText; import
com.mountreachsolution.e_learningapp.Admin.LoginAdminActivity; import
com.mountreachsolution.e_learningapp.Comman.Urls; import
com.mountreachsolution.e_learningapp.HomeActivity.HomeActivity; import
org.json.JSONException; import org.json.JSONObject; import java.util.HashMap;
import java.util.Map; public class LoginActivity extends AppCompatActivity { private
static int SPLASH_SCREEN = 0000; TextInputEditText tie_login_username,
tie_login_password; ImageView img_login_logo; TextView tv_login_as_admin; Button
btn_login_login, btn_login_register; ActivityOptions options; ProgressDialog
progressDialog; SharedPreferences preferences; SharedPreferences.Editor editor;
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login); setTitle("Login Page"); preferences =
PreferenceManager.getDefaultSharedPreferences(LoginActivity.this); editor =
preferences.edit(); if (preferences.getBoolean("isLogin", true)) { Intent intent = new
Intent(LoginActivity.this, HomeActivity.class); startActivity(intent); } img_login_logo
= findViewById(R.id.img_login_logo); tie_login_username =
findViewById(R.id.tie_login_username); tie_login_password =
findViewById(R.id.tie_login_password); btn_login_login =
findViewById(R.id.btn_login_login); btn_login_register =
findViewById(R.id.btn_login_register); tv_login_as_admin =
findViewById(R.id.tv_login_as_admin); btn_login_login.setOnClickListener(new
View.OnClickListener() { @Override public void onClick(View v) { progressDialog =
new ProgressDialog(LoginActivity.this); progressDialog.setTitle("Login User");
progressDialog.setCancelable(true); progressDialog.setCanceledOnTouchOutside(true);
progressDialog.setMessage("Please Wait..."); progressDialog.show(); loginUser();
} }); btn_login_register.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) { new Handler().postDelayed(new
Runnable() { @Override public void run() { Intent intent = new
Intent(LoginActivity.this,RegistrationActivity.class); Pair[] pairs = new
android.util.Pair[2]; pairs[0] = new
Pair<View,String>(img_login_logo,"splash_logo"); // pairs[0] = new
Pair<View,String>(splash_app_title,"splash_title"); if
(android.os.Build.VERSION.SDK_INT >=
android.os.Build.VERSION_CODES.LOLLIPOP) { options =
ActivityOptions.makeSceneTransitionAnimation(LoginActivity.this,pairs[0]); }
startActivity(intent,options.toBundle()); } },SPLASH_SCREEN); } });
tv_login_as_admin.setOnClickListener(new View.OnClickListener() { @Override
public void onClick(View v) { Intent i = new Intent(LoginActivity.this,
LoginAdminActivity.class); startActivity(i); } }); } private void loginUser() {
StringRequest stringRequest = new StringRequest(Request.Method.POST,
Urls.urlLoginStudent, new Response.Listener<String>() { @Override public void
onResponse(String response) { try { JSONObject obj = new
JSONObject(response); String success = obj.getString("success"); String id =
obj.getString("id"); String image = obj.getString("image"); String name =
obj.getString("name"); String mobile_no = obj.getString("mobile_no"); String email_id
= obj.getString("email_id"); String address = obj.getString("address"); String age =
obj.getString("age"); String username = obj.getString("username");

32
String password = obj.getString("password"); if (success.equals("1")) {
Toast.makeText(LoginActivity.this, response, Toast.LENGTH_SHORT).show();
editor.putBoolean("isLogin", true).commit(); Intent i = new
Intent(LoginActivity.this, HomeActivity.class); editor.putString("id", id).commit();
editor.putString("image", image).commit(); editor.putString("name", name).commit();
editor.putString("mobile_no", mobile_no).commit(); editor.putString("email_id",
email_id).commit(); editor.putString("address", address).commit();
editor.putString("age", age).commit();
editor.putString("username", username).commit(); editor.putString("password",
password).commit(); Toast.makeText(LoginActivity.this, "Login Successfully Done",
Toast.LENGTH_SHORT).show(); startActivity(i); finish(); progressDialog.dismiss(); }
else { String message = obj.getString("message"); Toast.makeText(LoginActivity.this,
message, Toast.LENGTH_SHORT).show(); Toast.makeText(LoginActivity.this,
response, Toast.LENGTH_SHORT).show(); progressDialog.dismiss(); } } catch
(JSONException e) { e.printStackTrace(); } }
}, new Response.ErrorListener() { @Override public void
onErrorResponse(VolleyError error) { Toast.makeText(LoginActivity.this,
error.toString(), Toast.LENGTH_SHORT).show(); progressDialog.dismiss(); } }) {
@Override protected Map<String, String> getParams() { Map<String, String> params
= new HashMap<String, String>(); params.put("username",
tie_login_username.getText().toString()); params.put("password",
tie_login_password.getText().toString()); return params; } };
stringRequest.setRetryPolicy(new DefaultRetryPolicy(20 * 1000, 1, 1.0f));
RequestQueue requestQueue = Volley.newRequestQueue(LoginActivity.this);
requestQueue.add(stringRequest); } }
login.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:layout_height="match_parent"
tools:context=".LoginActivity" android:orientation="vertical" >
<androidx.cardview.widget.CardView android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_marginTop="85dp"
app:contentPaddingTop="15dp" app:contentPaddingBottom="15dp"
app:contentPaddingLeft="15dp" app:contentPaddingRight="15dp"
app:cardCornerRadius="10dp" > <LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_centerInParent="true"
android:orientation="vertical" android:background="@color/light_grey"
android:padding="20dp"> <ImageView android:id="@+id/img_login_logo"
android:layout_width="100dp" android:layout_height="150dp"
android:src="@drawable/logo" android:transitionName="splash_logo" /> <TextView
android:id="@+id/tv_login_title" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginTop="-30dp"
android:fontFamily="@font/bungee" android:text="Welcome to E-Learning App"
android:textColor="@color/purple_700" android:textSize="18sp"
android:transitionName="splash_title" /> <TextView
android:id="@+id/tv_login_subtitle" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:fontFamily="@font/antic"
android:text="Sign in to Continue" android:textSize="20sp"
android:textStyle="bold" /> <LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_marginTop="20dp"
android:layout_marginBottom="20dp" android:orientation="vertical"> <!--
<com.google.android.material.textfield.TextInputLayout--> <!--

33
android:layout_width="match_parent"--> <!-- android:layout_height="wrap_content"-->
<!-- android:id="@+id/til_login_full_name"--> <!--
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">--> <!--
<com.google.android.material.textfield.TextInputEditText--> <!--
android:layout_width="match_parent"--> <!--
android:layout_height="wrap_content"--> <!--
android:id="@+id/tie_login_full_name"--> <!--
android:textColor="@color/colorAccent"--> <!-- android:hint="Full Name"--> <!--
android:inputType="textPersonName"--> <!-- />--> <!--
</com.google.android.material.textfield.TextInputLayout>-->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_login_username"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:background="@drawable/edittextbackground">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/tie_login_username" android:layout_width="match_parent"
android:layout_height="wrap_content" android:hint="Username"
android:inputType="text" android:textColor="@color/purple_700" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/til_login_password"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:background="@drawable/edittextbackground">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/tie_login_password" android:layout_width="match_parent"
android:layout_height="wrap_content" android:hint="Password"
android:inputType="textPassword" android:textColor="@color/purple_700" />
</com.google.android.material.textfield.TextInputLayout>
<androidx.appcompat.widget.AppCompatButton android:id="@+id/btn_login_login"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginBottom="10dp"
android:background="@drawable/btn_bg_shape"
android:fontFamily="@font/bungee" android:onClick="btn_continue"
android:text="Login" android:textColor="@color/white" android:textStyle="bold"
/> <androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_login_register" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/btn_bg_shape"
android:fontFamily="@font/bungee" android:onClick="btn_continue"
android:text="New User Register First!!!" android:textColor="@color/white"
android:textStyle="bold" /> <TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/tv_login_as_admin"
android:text="Login as Admin" android:textColor="@color/purple_700"
android:textSize="12sp" android:textStyle="bold"
android:fontFamily="@font/bungee" android:layout_gravity="center"
android:layout_marginTop="40dp" android:textAlignment="center" /> </LinearLayout>
</LinearLayout> <ImageView android:layout_width="120dp"
android:layout_height="120dp" android:id="@+id/login_cirle"
android:src="@drawable/circle" android:layout_gravity="right"
android:layout_marginLeft="-50dp" android:layout_marginBottom="-30dp" />
<ImageView android:layout_width="120dp" android:layout_height="120dp"
android:id="@+id/login_circle1" android:src="@drawable/circle_180"
34
android:layout_gravity="right" android:layout_marginRight="-50dp"
android:layout_marginTop="-30dp" /> </androidx.cardview.widget.CardView>
</RelativeLayout>

Registration.java
package com.mountreachsolution.e_learningapp; import
androidx.appcompat.app.AppCompatActivity; import android.app.ProgressDialog;
import android.content.Intent; import android.content.SharedPreferences; import
android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import
android.preference.PreferenceManager; import android.provider.MediaStore; import
android.view.View; import android.widget.Button; import android.widget.ImageView;
import android.widget.Spinner; import android.widget.Toast; import
com.android.volley.AuthFailureError; import com.android.volley.NetworkResponse;
import com.android.volley.Request; import com.android.volley.Response; import
com.android.volley.VolleyError; import com.android.volley.toolbox.Volley; import
com.google.android.material.textfield.TextInputEditText; import
com.loopj.android.http.AsyncHttpClient; import
com.loopj.android.http.JsonHttpResponseHandler; import
com.loopj.android.http.RequestParams; import
com.mountreachsolution.e_learningapp.Comman.Urls; import
com.mountreachsolution.e_learningapp.Comman.VolleyMultipartRequest; import
org.json.JSONException; import org.json.JSONObject; import
java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.HashMap;
import java.util.Map; import
cz.msebera.android.httpclient.Header; public class RegistrationActivity extends
AppCompatActivity { TextInputEditText
tie_name,tie_mobile_no,tie_email_id,tie_age,tie_address,
tie_username,tie_password; Button btn_select_student_image,btn_register;
ProgressDialog progressDialog; private int PICK_IMAGE_REQUEST = 1; private
Bitmap bitmap; ImageView img_student_image; private Uri filePath;
SharedPreferences preferences; SharedPreferences.Editor editor; @Override protected
void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registration); setTitle("Register"); preferences =
PreferenceManager.getDefaultSharedPreferences(this); editor = preferences.edit();
tie_name = findViewById(R.id.tie_register_name); tie_mobile_no =
findViewById(R.id.tie_register_mobile_no); tie_email_id =
findViewById(R.id.tie_register_email_id); tie_address =
findViewById(R.id.tie_register_address); tie_age =
findViewById(R.id.tie_register_age); tie_username =
findViewById(R.id.tie_register_username); tie_password =
findViewById(R.id.tie_register_password); btn_select_student_image =
findViewById(R.id.btn_choose_Student_image); btn_register =
findViewById(R.id.btn_register_register); img_student_image =
findViewById(R.id.img_Student_image);
btn_select_student_image.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) { showFileChooser(); } });
btn_register.setOnClickListener(new View.OnClickListener() { @Override public void
onClick(View v) { if(tie_name.getText().toString().isEmpty()) {
tie_name.setError("Please Enter Your Name"); } else
if(tie_mobile_no.getText().toString().isEmpty()) { tie_mobile_no.setError("Please
Enter Your Mobile Number"); } else if
(tie_email_id.getText().toString().isEmpty()) { tie_email_id.setError("Please Enter
Your Mail Id"); } else if (tie_address.getText().toString().isEmpty()) {
tie_address.setError("Enter Your Address"); } else if

35
(tie_age.getText().toString().isEmpty()) { tie_age.setError("Enter Your Age"); } else if
(tie_username.getText().toString().isEmpty()) { tie_username.setError("Enter Your
Username"); } else if
(tie_password.getText().toString().isEmpty()) { tie_password.setError("Enter Your
Password"); } else { progressDialog = new
ProgressDialog(RegistrationActivity.this); progressDialog.setTitle("Registering
student"); progressDialog.setCancelable(true);
progressDialog.setCanceledOnTouchOutside(true);
rogressDialog.setMessage("Please Wait..."); progressDialog.show(); addstudent();
} } }); } private void showFileChooser() { Intent intent = new Intent();
intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),
PICK_IMAGE_REQUEST); } @Override protected void onActivityResult(int
requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode,
resultCode, data); if (requestCode == PICK_IMAGE_REQUEST && resultCode ==
RESULT_OK && data != null && data.getData() != null) { filePath = data.getData();
try { bitmap =
MediaStore.Images.Media.getBitmap(getContentResolver(), filePath);
img_student_image.setImageBitmap(bitmap); } catch (IOException e) {
e.printStackTrace(); } } } private void addstudent() { AsyncHttpClient client = new
AsyncHttpClient(); RequestParams params = new RequestParams();
params.put("name",tie_name.getText().toString());
params.put("mobile_no",tie_mobile_no.getText().toString());
params.put("email_id",tie_email_id.getText().toString());
params.put("address",tie_address.getText().toString());
params.put("age",tie_age.getText().toString());
params.put("username",tie_username.getText().toString());
params.put("password",tie_password.getText().toString());
client.post(Urls.urlRegisterStudent,params,new JsonHttpResponseHandler() {
@Override public void onStart() { super.onStart(); } @Override public void
onSuccess(int statusCode, Header[] headers, JSONObject response) {
progressDialog.dismiss(); try { String aa = response.getString("success"); if
(aa.equals("1")) { uploadBitmap(bitmap,response.getInt("lastinsertedid")); //
Toast.makeText(RegistrationActivity.this, "Registration Succesfully Done",
Toast.LENGTH_SHORT).show(); // startActivity(new
Intent(RegistrationActivity.this,LoginActivity.class)); // finish(); } else {
Toast.makeText(RegistrationActivity.this, "Already Register",
Toast.LENGTH_SHORT).show(); } } catch (JSONException e) {
e.printStackTrace(); } } @Override public void onFailure(int statusCode, Header[]
headers, Throwable throwable, JSONObject errorResponse) {
Toast.makeText(RegistrationActivity.this, "Could not Connect",
Toast.LENGTH_SHORT).show(); } }); } private void uploadBitmap(final Bitmap
bitmap,final int lastinsertedid) { //getting the tag from the edittext //our custom volley
request VolleyMultipartRequest volleyMultipartRequest = new
VolleyMultipartRequest(Request.Method.POST, Urls.url_addStudentimage, new
Response.Listener<NetworkResponse>() { @Override public void
onResponse(NetworkResponse response) { try { JSONObject obj = new
JSONObject(new String(response.data));
Toast.makeText(RegistrationActivity.this,"Registration
Successful",Toast.LENGTH_SHORT).show(); startActivity(new
Intent(RegistrationActivity.this, LoginActivity.class)); finish(); } catch
(JSONException e) { e.printStackTrace(); } } }, new Response.ErrorListener() {
@Override public void onErrorResponse(VolleyError error) {
Toast.makeText(getApplicationContext(), error.getMessage(),
36
Toast.LENGTH_SHORT).show(); } }) { @Override protected Map<String, String>
getParams() throws AuthFailureError { Map<String, String> params = new
HashMap<>(); params.put("tags",""+ lastinsertedid); return params; } /* * Here we are
passing image by renaming it with a unique name * */ @Override protected Map<String,
DataPart> getByteData() { Map<String, DataPart> params = new HashMap<>(); long
imagename = System.currentTimeMillis(); params.put("pic", new DataPart(imagename
+ ".png", getFileDataFromDrawable(bitmap))); return params; } }; //adding the request
to volley

olley.newRequestQueue(this).add(volleyMultipartRequest); } public byte[]


getFileDataFromDrawable(Bitmap bitmap) { ByteArrayOutputStream
byteArrayOutputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 80, byteArrayOutputStream);
return byteArrayOutputStream.toByteArray(); } @Override public void
onBackPressed() { startActivity(new
Intent(RegistrationActivity.this,LoginActivity.class)); finish(); }

registration.xml
<?xml version="1.0" encoding="utf-8"?> <ScrollView
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=".RegistrationActivity" android:orientation="vertical"
android:fillViewport="true" > <RelativeLayout
android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content" android:orientation="vertical"
android:padding="20dp" > <ImageView android:layout_width="100dp"
android:layout_height="150dp" android:id="@+id/img_register_logo"
android:src="@drawable/logo" android:transitionName="splash_logo" />
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/tv_register_title"
android:text="Register Yourself" android:textSize="18sp"
android:textColor="@color/purple_700" android:fontFamily="@font/bungee"
android:transitionName="splash_title" android:layout_marginTop="-30dp"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/tv_register_subtitle"
android:text="Sign Up" android:textSize="20sp" android:textStyle="bold"
android:fontFamily="@font/antic"/> <LinearLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginBottom="20dp"
android:orientation="vertical"> <LinearLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="horizontal"> <Button android:layout_width="170dp"
android:layout_height="55dp" android:id="@+id/btn_choose_Student_image"
android:text="Select Student Image" android:textSize="14dp"
android:textColor="@color/white" android:layout_gravity="center_vertical"
android:layout_marginTop="5dp"
android:background="@drawable/btn_bg_shape" /> <ImageView
android:id="@+id/img_Student_image" android:layout_width="match_parent"
android:layout_height="150dp" android:src="@drawable/profileimage"
android:layout_marginLeft="4dp"/> </LinearLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
37
android:id="@+id/til_register_name"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_register_name" android:textColor="@color/purple_700"
android:hint="Student Name" android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/til_register_mobile_no"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_register_mobile_no"
android:textColor="@color/purple_700" android:hint="Student Mobile Number"
android:inputType="number" android:maxLength="10"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/til_register_email_id"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_register_email_id" android:textColor="@color/purple_700"
android:hint="Student Email Id" android:inputType="textEmailAddress" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/til_register_age"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_register_age" android:textColor="@color/purple_700"
android:hint="Student Age" android:inputType="number" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/til_register_address"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_register_address" android:textColor="@color/purple_700"
android:hint="Student Address" android:inputType="textPostalAddress" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/til_register_username"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_register_username" android:textColor="@color/purple_700"
android:hint="Username" android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout

38
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/til_register_password"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_register_password" android:textColor="@color/purple_700"
android:hint="Password" android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<androidx.appcompat.widget.AppCompatButton
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/btn_register_register" android:text="Register"
android:textColor="@color/white" android:textStyle="bold"
android:fontFamily="@font/bungee"
android:background="@drawable/btn_bg_shape"
android:layout_marginTop="10dp" android:layout_marginBottom="10dp"
android:onClick="btn_continue"/> </LinearLayout> </LinearLayout> <ImageView
android:layout_width="120dp" android:layout_height="120dp"
android:id="@+id/register_cirle" android:src="@drawable/circle"
android:layout_alignParentBottom="true" android:layout_marginLeft="-50dp"
android:layout_marginBottom="-30dp" /> <ImageView android:layout_width="120dp"
android:layout_height="120dp" android:id="@+id/register_circle1"
android:src="@drawable/circle_180" android:layout_alignParentRight="true"
android:layout_marginRight="-50dp" android:layout_marginTop="-30dp" />
</RelativeLayout> </ScrollView>

HOMEACTIVITY/ALL_CLASSES.JAVA
package com.mountreachsolution.e_learningapp.HomeActivity; import
android.app.Activity; import android.content.Intent; import
android.content.SharedPreferences; import android.preference.PreferenceManager;
import android.view.LayoutInflater; import android.view.View; import
android.view.ViewGroup; import android.widget.BaseAdapter; import
android.widget.Button; import android.widget.TextView; import
androidx.cardview.widget.CardView; import com.mountreachsolution.e_learningapp.R;
import java.util.List; public class AllClassesAdapter extends BaseAdapter {
List<POJOAllClasses> list; Activity activity; TextView tv_no_records;
SharedPreferences preferences;
SharedPreferences.Editor editor; public AllClassesAdapter(List<POJOAllClasses>
list, Activity activity) { this.list = list; this.activity = activity; preferences =
PreferenceManager.getDefaultSharedPreferences(activity); editor = preferences.edit(); }
@Override public int getCount() { return list.size(); } @Override public Object
getItem(int position) { return list.get(position); } @Override public long getItemId(int
position) { return position; } @Override public View getView(int position, View v,
ViewGroup parent) { final AllClassesAdapter.ViewHolder holder; LayoutInflater
inflater = (LayoutInflater)
activity.getSystemService(Activity.LAYOUT_INFLATER_SERVICE); if (v ==
null) { holder = new AllClassesAdapter.ViewHolder(); v =
inflater.inflate(R.layout.lv_all_class, null); holder.tv_all_class_class_name =
(TextView) v.findViewById(R.id.tv_all_class_class_name);
holder.tv_all_class_class_subject = (TextView)
v.findViewById(R.id.tv_all_class_class_subject); holder.cardView_all_classes =
(CardView) v.findViewById(R.id.cardview11); v.setTag(holder); } else { holder =
(AllClassesAdapter.ViewHolder) v.getTag(); } final POJOAllClasses obj =
list.get(position); holder.tv_all_class_class_name.setText(obj.getClassname());
holder.tv_all_class_class_subject.setText(obj.getSubjectname());
holder.cardView_all_classes.setOnClickListener(new View.OnClickListener() {
39
@Override public void onClick(View v) { Intent intent = new Intent(activity,
ClassInDetailsActivity.class); editor.putString("class_id", obj.getId()).commit();
editor.putString("class_name", obj.getClassname()).commit();
editor.putString("subject_name",
obj.getSubjectname()).commit();activity.startActivity(intent); } }); return v; } class
ViewHolder { TextView tv_all_class_class_name, tv_all_class_class_subject;
CardView cardView_all_classes; } }

allclasses.xml/home
?xml version="1.0" encoding="utf-8"?> <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical" tools:context=".HomeActivity.HomeActivity" >
<ListView android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/lv_view_all_class"
android:layout_margin="16dp" android:layout_alignParentTop="true" />
<ProgressBar android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_centerInParent="true"
android:id="@+id/progress" android:visibility="gone"/> <TextView
android:layout_width="wrap_content" android:layout_height="match_parent"
android:text="No Class Available" android:layout_centerInParent="true"
android:gravity="center" android:visibility="gone"
android:id="@+id/tv_no_records"/> </RelativeLayout>

Homeactivity.java
package com.mountreachsolution.e_learningapp.HomeActivity; import
androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import
androidx.appcompat.app.AppCompatActivity; import android.content.DialogInterface;
import android.content.Intent; import android.content.SharedPreferences; import
android.os.Bundle; import android.os.Handler; import
android.preference.PreferenceManager; import android.view.Menu; import
android.view.MenuInflater; import android.view.MenuItem; import android.view.View;
import android.widget.ListView; import android.widget.ProgressBar; import
android.widget.TextView; import android.widget.Toast; import
com.loopj.android.http.AsyncHttpClient; import
com.loopj.android.http.JsonHttpResponseHandler; import
com.loopj.android.http.RequestParams; import
com.mountreachsolution.e_learningapp.Comman.Urls; import
com.mountreachsolution.e_learningapp.LoginActivity; import
com.mountreachsolution.e_learningapp.R; import org.json.JSONArray; import
org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList;
import java.util.List; import cz.msebera.android.httpclient.Header; public class
HomeActivity extends AppCompatActivity { List<POJOAllClasses> list; ListView
lv_view_all_class; TextView tv_no_records; ProgressBar pBar; AllClassesAdapter
adapter; SharedPreferences preferences; SharedPreferences.Editor editor; boolean
doubletap = false; @Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); setContentView(R.layout.activity_home);
setTitle("All Classes"); preferences=
PreferenceManager.getDefaultSharedPreferences(HomeActivity.this);
editor=preferences.edit(); list = new ArrayList<POJOAllClasses>(); lv_view_all_class
= (ListView) findViewById(R.id.lv_view_all_class); tv_no_records = (TextView)
findViewById(R.id.tv_no_records); pBar = (ProgressBar)
findViewById(R.id.progress); tv_no_records = (TextView)
40
findViewById(R.id.tv_no_records); viewAllClass(); } public void viewAllClass() {
AsyncHttpClient client = new AsyncHttpClient(); RequestParams params = new
RequestParams(); client.post(Urls.urlViewAllClasses, params, new
JsonHttpResponseHandler(){ public void onStart() {
pBar.setVisibility(View.VISIBLE); super.onStart(); } public void onSuccess(int
statusCode, Header[] headers, JSONObject response) { try {
pBar.setVisibility(View.GONE); JSONArray jarry =
response.getJSONArray("getAllClass"); if (jarry.isNull(0)) {
tv_no_records.setVisibility(View.VISIBLE); tv_no_records.setText("No Class Available
Yet"); } for (int i = 0 ; i < jarry.length();i++) { JSONObject jsonObject =
jarry.getJSONObject(i); String id = jsonObject.getString("id"); String class_name
= jsonObject.getString("class_name"); String subject_name =
jsonObject.getString("subject_name"); list.add(new
POJOAllClasses(id,class_name,subject_name)); } adapter = new
AllClassesAdapter(list, (AppCompatActivity) HomeActivity.this);
lv_view_all_class.setAdapter(adapter); } catch (JSONException e) {
e.printStackTrace(); } } public void onFailure(int statusCode, Header[] headers, String
res, Throwable t) { Toast.makeText(HomeActivity.this, "could not connect",
Toast.LENGTH_LONG).show(); } }); } @Override public void onBackPressed() { if
(doubletap){ super.onBackPressed(); } else { Toast.makeText(this, "Press back again to
exit", Toast.LENGTH_SHORT).show(); doubletap = true; Handler handler = new
Handler(); handler.postDelayed(new Runnable() { @Override public void
run() { doubletap = false; } }, 1000); } } @Override public boolean
onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.home_menu,menu); return true; } @Override public boolean
onOptionsItemSelected(@NonNull MenuItem item) { if (item.getItemId() ==
R.id.home_menu_qr_code_scanner) { logout(); return true; } return true; } private void
logout() { AlertDialog.Builder ad = new
AlertDialog.Builder(HomeActivity.this); ad.setTitle("E-Learning App");
ad.setMessage("Are you sure you want to logout"); ad.setPositiveButton("Cancel", new
DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface
dialog, int which) { dialog.cancel(); } }); ad.setNegativeButton("Logout", new
DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface
dialog, int which) { Intent intent = new Intent(HomeActivity.this, LoginActivity.class);
editor.putBoolean("isLogin",false).commit(); startActivity(intent); finish(); } });
AlertDialog alertDialog = ad.create();
alertDialog.setCanceledOnTouchOutside(true); alertDialog.show(); } }

homeactivity.xml
?xml version="1.0" encoding="utf-8"?> <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical" tools:context=".HomeActivity.HomeActivity" >
<ListView android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/lv_view_all_class"
android:layout_margin="16dp" android:layout_alignParentTop="true" />
<ProgressBar android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_centerInParent="true"
android:id="@+id/progress" android:visibility="gone"/> <TextView
android:layout_width="wrap_content" android:layout_height="match_parent"
android:text="No Class Available" android:layout_centerInParent="true"
android:gravity="center" android:visibility="gone"
android:id="@+id/tv_no_records"/> </RelativeLayout>
41
Home_work.java
package com.mountreachsolution.e_learningapp.HomeWork; import
androidx.appcompat.app.AppCompatActivity; import
androidx.appcompat.widget.SearchView; import android.content.Intent; import
android.content.SharedPreferences; import android.os.Bundle; import
android.preference.PreferenceManager; import android.view.View; import
android.widget.ListView; import android.widget.ProgressBar; import
android.widget.TextView; import android.widget.Toast; import
com.loopj.android.http.AsyncHttpClient; import
com.loopj.android.http.JsonHttpResponseHandler; import
com.loopj.android.http.RequestParams; import
com.mountreachsolution.e_learningapp.Comman.Urls; import
com.mountreachsolution.e_learningapp.HomeActivity.ClassInDetailsActivity;
imporcom.mountreachsolution.e_learningapp.HomeActivity.HomeActivity; import
com.mountreachsolution.e_learningapp.R; import org.json.JSONArray; import
org.json.JSONException; import org.json.JSONObject; import
java.util.ArrayList; import java.util.List; import
cz.msebera.android.httpclient.Header; public class HomeWorkActivity extends
AppCompatActivity { List<POJOHomework> list; SearchView sv_homework;
ListView lv_homework; TextView tv_no_records; ProgressBar progressBar;
HomeworkAdapter adapter; SharedPreferences preferences;
SharedPreferences.Editor editor; @Override protected void onCreate(Bundle
savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home_work); preferences=
PreferenceManager.getDefaultSharedPreferences(HomeWorkActivity.this);
editor=preferences.edit(); setTitle(""+preferences.getString("class_name","")+"
Home Work"); preferences=
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
editor=preferences.edit(); list = new ArrayList<POJOHomework>(); sv_homework =
(SearchView) findViewById(R.id.sv_homework); lv_homework = (ListView)
findViewById(R.id.lv_my_homework); tv_no_records = (TextView)
findViewById(R.id.tv_no_records); progressBar = (ProgressBar)
findViewById(R.id.progressBar); sv_homework.setOnQueryTextListener(new
SearchView.OnQueryTextListener() { @Override public boolean
onQueryTextSubmit(String query) { searchHomework(query); return false; }
@Override public boolean onQueryTextChange(String query) {
searchHomework(query); return false; } }); getmyhomework(); } private void
searchHomework(String query) { List<POJOHomework> temppojoclass = new
ArrayList<>(); temppojoclass.clear(); for(POJOHomework pojo :list) { if
(pojo.getHowework_date().toUpperCase().contains(query.toUpperCase()) ||
pojo.getHomework_title().toUpperCase().contains(query.toUpperCase()) ||
pojo.getHomework_description().toUpperCase().contains(query.toUpperCase())) {
temppojoclass.add(pojo); } adapter = new HomeworkAdapter(temppojoclass,
HomeWorkActivity.this); lv_homework.setAdapter(adapter); } } public void
getmyhomework() { AsyncHttpClient client = new AsyncHttpClient(); RequestParams
params = new RequestParams();
params.put("class_id",preferences.getString("class_id",""));
client.post(Urls.urlGetHomework, params, new JsonHttpResponseHandler(){ public
void onStart() { progressBar.setVisibility(View.VISIBLE); super.onStart(); } public void
onSuccess(int statusCode, Header[] headers, JSONObject response) { try {
progressBar.setVisibility(View.GONE); JSONArray jarry =
response.getJSONArray("getMyHomework"); for (int i = 0; i < jarry.length(); i++){
JSONObject jsonObject = jarry.getJSONObject(i); String howework_date =
jsonObject.getString("howework_date"); String howework_title =
42
jsonObject.getString("howework_title"); String howework_description =
jsonObject.getString("howework_description"); list.add(new
POJOHomework(howework_date,howework_title,howework_description)); } adapter =
new HomeworkAdapter(list, HomeWorkActivity.this);
lv_homework.setAdapter(adapter); } catch (JSONException e) {
e.printStackTrace(); } } public void onFailure(int statusCode, Header[] headers, String
res, Throwable t) { Toast.makeText(HomeWorkActivity.this, "could not connect",
Toast.LENGTH_LONG).show(); } }); } @Override public void onBackPressed() { //
super.onBackPressed(); startActivity(new Intent(HomeWorkActivity.this,
ClassInDetailsActivity.class));
editor.putString("class_id",preferences.getString("class_id","")).commit();
editor.putString("class_name",preferences.getString("class_name","")).commit();
editor.putString("subject_name",preferences.getString("subject_name","")).commit ();
finish(); } }
homework.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" tools:context=".HomeWork.HomeWorkActivity">
<androidx.appcompat.widget.SearchView android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/sv_homework"
app:queryHint="Search Homework" app:iconifiedByDefault="false"
android:padding="4sp" android:layout_margin="5sp"
android:background="@drawable/et_bg"/> <ListView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/lv_my_homework"
android:layout_below="@+id/sv_homework"/> <ProgressBar
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:id="@+id/progressBar"
android:visibility="gone"/> <TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="No Records"
android:layout_centerInParent="true" android:visibility="gone"
android:id="@+id/tv_no_records"/> </RelativeLayout>

Notice.java
package com.mountreachsolution.e_learningapp.NoticeBoard; import
androidx.appcompat.app.AppCompatActivity; import
android.content.SharedPreferences; import android.os.Bundle; import
android.preference.PreferenceManager; import android.view.View; import
android.widget.ListView; import android.widget.ProgressBar; import
android.widget.TextView; import android.widget.Toast; import
com.loopj.android.http.AsyncHttpClient; import
com.loopj.android.http.JsonHttpResponseHandler; import
com.loopj.android.http.RequestParams; import
com.mountreachsolution.e_learningapp.Comman.Urls; import
com.mountreachsolution.e_learningapp.R; import org.json.JSONArray; import
org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList;
import java.util.List; import cz.msebera.android.httpclient.Header; public class
NoticeBoardActivity extends AppCompatActivity { List<PojoNoticeBoard> list;
ListView lv_view_notice_board; TextView tv_no_records; ProgressBar pBar;
NoticeBoardAdapter adapter; SharedPreferences preferences;
SharedPreferences.Editor editor; @Override protected void onCreate(Bundle
43
savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notice_board); preferences=
PreferenceManager.getDefaultSharedPreferences(NoticeBoardActivity.this);
editor=preferences.edit(); setTitle(""+preferences.getString("class_name","")+" Notice
Board"); list = new ArrayList<PojoNoticeBoard>(); lv_view_notice_board
= (ListView) findViewById(R.id.lv_notice_board); tv_no_records = (TextView)
findViewById(R.id.tv_no_records); pBar = (ProgressBar)
findViewById(R.id.progressBar); tv_no_records = (TextView)
findViewById(R.id.tv_no_records); viewNoticeBoard(); } public void
viewNoticeBoard() { AsyncHttpClient client = new AsyncHttpClient(); RequestParams
params = new RequestParams();
params.put("class_id",preferences.getString("class_id",""));
client.post(Urls.urlViewNoticeBoard, params, new JsonHttpResponseHandler(){ public
void onStart() { pBar.setVisibility(View.VISIBLE); super.onStart(); } public void
onSuccess(int statusCode, Header[] headers, JSONObject response) { try {
pBar.setVisibility(View.GONE); JSONArray jarry =
response.getJSONArray("getNoticeBoard"); if (jarry.isNull(0)) {
tv_no_records.setVisibility(View.VISIBLE); tv_no_records.setText("No Notice
Available Yet"); } for (int i = 0 ; i < jarry.length();i++) { JSONObject jsonObject =
jarry.getJSONObject(i); String id = jsonObject.getString("id"); String title =
jsonObject.getString("title"); String description = jsonObject.getString("description");
String doc = jsonObject.getString("doc"); list.add(new
PojoNoticeBoard(title,description,doc)); } adapter = new
NoticeBoardAdapter(list, (AppCompatActivity)
NoticeBoardActivity.this,tv_no_records); lv_view_notice_board.setAdapter(adapter); }
catch (JSONException e) {
e.printStackTrace(); } } public void onFailure(int statusCode, Header[] headers, String
res, Throwable t) { Toast.makeText(NoticeBoardActivity.this, "could not connect",
Toast.LENGTH_LONG).show(); } }); } }

notice.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" tools:context=".HomeWork.HomeWorkActivity">
<androidx.appcompat.widget.SearchView android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/sv_notice_board"
app:queryHint="Search Notice Board" app:iconifiedByDefault="false"
android:padding="4sp" android:layout_margin="5sp"
android:background="@drawable/et_bg"
android:backgroundTint="@color/light_teal"/> <ListView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/lv_notice_board"
android:layout_below="@+id/sv_notice_board"/> <ProgressBar
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:id="@+id/progressBar"
android:visibility="gone"/> <TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="No Records"
android:layout_centerInParent="true" android:visibility="gone"
android:id="@+id/tv_no_records"/> </RelativeLayout>

Modelans.java
44
package com.mountreachsolution.e_learningapp.QuestionandAnswerModelPaper;
public class PojoQuestionandAnswerPaper { public String title,viewdoc; public
PojoQuestionandAnswerPaper(String title, String viewdoc) { this.title = title;
this.viewdoc = viewdoc; } public String getTitle() { return title; } public void
setTitle(String title) { this.title = title; } public String getViewdoc() { return viewdoc; }
public void setViewdoc(String viewdoc) { this.viewdoc = viewdoc; } }

modelanswer.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:layout_height="match_parent"
tools:context=".QuestionandAnswerModelPaper.QuestionandAnswerModelPaperA
ctivity" android:orientation="vertical"> <TextView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tv_question_and_answer_paper_select_branch_title"
android:text="Select Branch" android:textSize="18dp" android:textStyle="bold"
android:textColor="@color/purple_700" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginTop="20dp"
android:fontFamily="sans-serif-condensed-medium"/> <Spinner
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/spinner_branch" android:layout_marginTop="20dp"
android:layout_marginLeft="20dp" android:layout_marginRight="20dp"
android:entries="@array/branch" /> <TextView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tv_question_and_answer_paper_select_semester_title"
android:text="Select Semester" android:textSize="18dp" android:textStyle="bold"
android:textColor="@color/purple_700" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginTop="20dp"
android:fontFamily="sans-serif-condensed-medium"/> <Spinner
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/spinner_semester" android:layout_marginTop="20dp"
android:layout_marginLeft="20dp" android:layout_marginRight="20dp"
android:entries="@array/semester" /> <TextView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tv_question_and_answer_paper_select_exam_title"
android:text="Select Exam" android:textSize="18dp" android:textStyle="bold"
android:textColor="@color/purple_700" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginTop="20dp"
android:fontFamily="sans-serif-condensed-medium"/> <Spinner
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/spinner_exam" android:layout_marginTop="20dp"
android:layout_marginLeft="20dp" android:layout_marginRight="20dp"
android:entries="@array/select_the_exam" />
<androidx.appcompat.widget.AppCompatButton
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/btn_question_and_answer_paper_search" android:text="Search
Question and Answer Paper" android:textColor="@color/white"
android:textStyle="bold" android:fontFamily="@font/bungee"
android:background="@drawable/btn_bg_shape" android:layout_margin="20dp"
/> </LinearLayout>

Quiz.java
package com.mountreachsolution.e_learningapp.Quiz; public class PojoGetQuiz {
45
public String id,question,option1,option2,option3,option4,correct_answer; public
PojoGetQuiz(String id, String question, String option1, String option2, String option3,
String option4, String correct_answer) { this.id = id; this.question = question;
this.option1 = option1; this.option2 = option2; this.option3 = option3; this.option4 =
option4; this.correct_answer = correct_answer; } public String getId() { return id; }
public void setId(String id) { this.id = id; } public String getQuestion() { return
question; } public void setQuestion(String question) { this.question = question; } public
String getOption1() { return option1; } public void setOption1(String option1) {
this.option1 = option1; } public String getOption2() { return option2; } public void
setOption2(String option2) { this.option2 = option2; } public String getOption3() {
return option3; } public void setOption3(String option3) { this.option3 = option3; }
public String getOption4() { return option4; } public void setOption4(String option4) {
this.option4 = option4; } public String getCorrect_answer() { return correct_answer; }
public void setCorrect_answer(String correct_answer) { this.correct_answer =
correct_answer; } }
quiz.xml
<?xml version="1.0" encoding="utf-8"?> <ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" tools:context=".HomeWork.HomeWorkActivity"
android:layout_margin="16dp"> <LinearLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"> <TextView android:id="@+id/tv_quiz_title"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:fontFamily="@font/bungee" android:text="Welcome to E-Learning Quiz
Activity" android:textSize="16sp" android:textAlignment="center"
android:textColor="@color/purple_700" android:layout_marginTop="20dp"
android:textStyle="bold" /> <TextView android:id="@+id/tv_quiz_question1"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:fontFamily="sans-serif-condensed-medium" android:text="Who is the father of
C language?" android:textColor="@color/black" android:textSize="16dp"
android:textStyle="bold" /> <RadioGroup android:id="@+id/lv_rg_quiz_11"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"> <RadioButton
android:id="@+id/lv_rb_quiz_option11" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="a) Steve Jobs"
android:textColor="@color/black" /> <RadioButton
android:id="@+id/lv_rb_quiz_option12" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="b) James Gosling"
android:textColor="@color/black" /> <RadioButton
android:id="@+id/lv_rb_quiz_option13" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="c) Dennis Ritchie"
android:textColor="@color/black" /> <RadioButton
android:id="@+id/lv_rb_quiz_option14" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="d) Rasmus Lerdorf"
android:textColor="@color/black" /> </RadioGroup> <View
android:layout_width="match_parent" android:layout_height="2dp"
android:layout_marginTop="20dp" android:background="@color/black"
android:backgroundTint="@color/black" /> <TextView
android:id="@+id/tv_quiz_question2" android:layout_width="match_parent"
android:layout_height="wrap_content" android:fontFamily="sans-serif-
condensedmedium" android:text=" Which of the following is not a valid C variable

46
name?" android:textColor="@color/black" android:textSize="16dp"
android:layout_marginTop="20dp" android:textStyle="bold" /> <RadioGroup
android:id="@+id/lv_rg_quiz_21" android:layout_width="match_parent"
android:layout_height="wrap_content" android:orientation="vertical">
<RadioButton android:id="@+id/lv_rb_quiz_option22"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="a) int number;" android:textColor="@color/black" /> <RadioButton
android:id="@+id/lv_rb_quiz_option23" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="b) float rate;"
android:textColor="@color/black" /> <RadioButton
android:id="@+id/lv_rb_quiz_option24" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="c) int variable_count;"
android:textColor="@color/black" /> <RadioButton
android:id="@+id/lv_rb_quiz_option25" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="d) int $main;"
android:textColor="@color/black" /> </RadioGroup> <View
android:layout_width="match_parent" android:layout_height="2dp"
android:layout_marginTop="20dp" android:background="@color/black"
android:backgroundTint="@color/black" /> <TextView
android:id="@+id/tv_quiz_question3" android:layout_width="match_parent"
android:layout_height="wrap_content" android:fontFamily="sans-serif-
condensedmedium" android:text=" All keywords in C are in "
android:textColor="@color/black" android:textSize="16dp"
android:layout_marginTop="20dp" android:textStyle="bold" /> <RadioGroup
android:id="@+id/lv_rg_quiz_31" android:layout_width="match_parent"
android:layout_height="wrap_content" android:orientation="vertical">
<RadioButton android:id="@+id/lv_rb_quiz_option32"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="a) LowerCase letters" android:textColor="@color/black" />
<RadioButton android:id="@+id/lv_rb_quiz_option33"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="b) UpperCase letters" android:textColor="@color/black" />
<RadioButton android:id="@+id/lv_rb_quiz_option34"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="c) CamelCase letters" android:textColor="@color/black" />
<RadioButton android:id="@+id/lv_rb_quiz_option35"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="d) None of the mentioned" android:textColor="@color/black" />
</RadioGroup> <View android:layout_width="match_parent"
android:layout_height="2dp" android:layout_marginTop="20dp"
android:background="@color/black" android:backgroundTint="@color/black" />
<TextView android:id="@+id/tv_quiz_question4"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:fontFamily="sans-serif-condensed-medium" android:text=" Which of the
following cannot be a variable name in C?" android:textColor="@color/black"
android:textSize="16dp" android:layout_marginTop="20dp" android:textStyle="bold"
/> <RadioGroup android:id="@+id/lv_rg_quiz_41"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"> <RadioButton
android:id="@+id/lv_rb_quiz_option42" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="a) volatile"
android:textColor="@color/black" /> <RadioButton
android:id="@+id/lv_rb_quiz_option43" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="b) true"
android:textColor="@color/black" /> <RadioButton
47
android:id="@+id/lv_rb_quiz_option44" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="c) friend"
android:textColor="@color/black" /> <RadioButton
android:id="@+id/lv_rb_quiz_option45" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="d) export"
android:textColor="@color/black" /> </RadioGroup> <View
android:layout_width="match_parent" android:layout_height="2dp"
android:layout_marginTop="20dp" android:background="@color/black"
android:backgroundTint="@color/black" /> <TextView
android:id="@+id/tv_quiz_question5" android:layout_width="match_parent"
android:layout_height="wrap_content" android:fontFamily="sans-serif-
condensedmedium" android:text=" What is the result of logical or relational expression
in C?" android:textColor="@color/black" android:textSize="16dp"
android:layout_marginTop="20dp" android:textStyle="bold" /> <RadioGroup
android:id="@+id/lv_rg_quiz_51" android:layout_width="match_parent"
android:layout_height="wrap_content" android:orientation="vertical">
<RadioButton android:id="@+id/lv_rb_quiz_option52"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="a) True or False" android:textColor="@color/black" />
<RadioButton android:id="@+id/lv_rb_quiz_option53"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="b) 0 or 1" android:textColor="@color/black" /> <RadioButton
android:id="@+id/lv_rb_quiz_option54" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="c) 0 if an expression is false and
any positive number if an expression is true" android:textColor="@color/black" />
<RadioButton
android:id="@+id/lv_rb_quiz_option55" android:layout_width="match_parent"
android:layout_height="wrap_content" android:text="d) None of the mentioned"
android:textColor="@color/black" /> </RadioGroup>
<androidx.appcompat.widget.AppCompatButton
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/btn_quiz_submit" android:text="Submit"
android:textColor="@color/white" android:textStyle="bold"
android:fontFamily="@font/bungee"
android:background="@drawable/btn_bg_shape"
android:backgroundTint="@color/teal_700" android:layout_marginTop="10dp"
android:layout_marginBottom="10dp" android:onClick="btn_continue"/> <!--
<ListView--> <!-- android:layout_width="match_parent"--> <!--
android:layout_height="wrap_content"--> <!-- android:id="@+id/lv_quiz" />--> <!--
<ProgressBar--> <!-- android:layout_width="wrap_content"--> <!--
android:layout_height="wrap_content"--> <!--
android:layout_centerInParent="true"--> <!-- android:id="@+id/progressBar"-->
<!-- android:visibility="gone"/>--> <!-- <TextView--> <!--
android:layout_width="wrap_content"--> <!-- android:layout_height="wrap_content"-->
<!-- android:text="No Records"--> <!-- android:layout_centerInParent="true"--> <!--
android:visibility="gone"--> <!-- android:id="@+id/tv_no_records"/>-->
</LinearLayout> </ScrollView>

Recording.java
package com.mountreachsolution.e_learningapp.Recording; import
androidx.appcompat.app.AppCompatActivity; import
androidx.appcompat.widget.SearchView; import android.annotation.SuppressLint;
import android.content.Intent; import android.content.SharedPreferences; import
android.os.Bundle; import android.preference.PreferenceManager; import
android.view.View; import android.widget.ListView; import
48
android.widget.ProgressBar; import android.widget.TextView; import
android.widget.Toast; import com.loopj.android.http.AsyncHttpClient; import
com.loopj.android.http.JsonHttpResponseHandler; import
com.loopj.android.http.RequestParams; import
com.mountreachsolution.e_learningapp.Comman.Urls; import
com.mountreachsolution.e_learningapp.HomeActivity.ClassInDetailsActivity; import
com.mountreachsolution.e_learningapp.HomeActivity.HomeActivity; import
com.mountreachsolution.e_learningapp.HomeWork.HomeWorkActivity; import
com.mountreachsolution.e_learningapp.HomeWork.HomeworkAdapter; import
com.mountreachsolution.e_learningapp.HomeWork.POJOHomework; import
com.mountreachsolution.e_learningapp.R; import org.json.JSONArray; import
org.json.JSONException; import org.json.JSONObject; import
java.util.ArrayList; import java.util.List; import cz.msebera.android.httpclient.Header;
public class RecordingActivity extends AppCompatActivity { List<POJORecording>
pojoRecordings; SearchView sv_recording; ListView lv_recording; TextView
tv_no_records; ProgressBar progressBar; RecordingAdapter adapter; SharedPreferences
preferences; SharedPreferences.Editor editor; @SuppressLint("MissingInflatedId")
@Override protected void onCreate(Bundle savedInstanceState) {
uper.onCreate(savedInstanceState); setContentView(R.layout.activity_recording);
preferences=
PreferenceManager.getDefaultSharedPreferences(RecordingActivity.this);
editor=preferences.edit(); setTitle(""+preferences.getString("class_name","")+"
Recording"); pojoRecordings = new ArrayList<POJORecording>(); sv_recording =
(SearchView) findViewById(R.id.sv_recording); lv_recording = (ListView)
findViewById(R.id.lv_my_recording); tv_no_records = (TextView)
findViewById(R.id.tv_no_records); progressBar = (ProgressBar)
findViewById(R.id.progressBar); sv_recording.setOnQueryTextListener(new
SearchView.OnQueryTextListener() { @Override public boolean
onQueryTextSubmit(String query) { searchRecording(query); return false; } @Override
public boolean onQueryTextChange(String query) { searchRecording(query); return
false; } }); getRecording(); } private void searchRecording(String query) {
List<POJORecording> temppojoclass = new ArrayList<>(); temppojoclass.clear();
for(POJORecording pojo :pojoRecordings) { if
(pojo.getRecording_date().toUpperCase().contains(query.toUpperCase()) ||
pojo.getRecording_title().toUpperCase().contains(query.toUpperCase()) ||
pojo.getRecording_description().toUpperCase().contains(query.toUpperCase())) {
temppojoclass.add(pojo); } adapter = new RecordingAdapter(temppojoclass,
RecordingActivity.this); lv_recording.setAdapter(adapter); } } public void
getRecording() { AsyncHttpClient client = new AsyncHttpClient(); RequestParams
params = new RequestParams();
params.put("class_id",preferences.getString("class_id",""));
client.post(Urls.urlGetRecording, params, new JsonHttpResponseHandler(){ public
void onStart() { progressBar.setVisibility(View.VISIBLE); super.onStart(); } public void
onSuccess(int statusCode, Header[] headers, JSONObject response) { try {
progressBar.setVisibility(View.GONE); JSONArray jarry =
response.getJSONArray("getMyRecording"); for (int i = 0; i < jarry.length(); i++){
JSONObject jsonObject = jarry.getJSONObject(i); String recording_date =
jsonObject.getString("recording_date"); String recording_title =
jsonObject.getString("recording_title"); String recording_description =
jsonObject.getString("recording_description"); String recording_url =
jsonObject.getString("recording_url"); pojoRecordings.add(new
POJORecording(recording_date,recording_title, recording_description,recording_url));
} adapter = new RecordingAdapter(pojoRecordings, RecordingActivity.this);
lv_recording.setAdapter(adapter); } catch (JSONException e) { e.printStackTrace(); } }

49
public void onFailure(int statusCode, Header[] headers, String res, Throwable t) {
Toast.makeText(RecordingActivity.this, "could not connect",
Toast.LENGTH_LONG).show(); } }); } @Override public void onBackPressed() {
// super.onBackPressed(); startActivity(new Intent(RecordingActivity.this,
ClassInDetailsActivity.class));
editor.putString("class_id",preferences.getString("class_id","")).commit();
editor.putString("class_name",preferences.getString("class_name","")).commit();
editor.putString("subject_name",preferences.getString("subject_name","")).commit
(); finish(); } }
recording.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" tools:context=".HomeWork.HomeWorkActivity">
<androidx.appcompat.widget.SearchView android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/sv_recording"
app:queryHint="Search Recording" app:iconifiedByDefault="false"
android:padding="4sp" android:layout_margin="5sp"
android:background="@drawable/et_bg"
android:backgroundTint="@color/light_yellow"/> <ListView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/lv_my_recording"
android:layout_below="@+id/sv_recording"/> <ProgressBar
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:id="@+id/progressBar"
android:visibility="gone"/> <TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="No Records"
android:layout_centerInParent="true" android:visibility="gone"
android:id="@+id/tv_no_records"/> </RelativeLayout>

Studymaterial.java
{ List<PojoMyStudyMaterial> list; ListView lv_my_study_material; TextView
tv_no_records; ProgressBar pBar; StudyMaterialAdapter adapter; SharedPreferences
preferences; SharedPreferences.Editor editor; @Override protected void
onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_study_material); preferences=
PreferenceManager.getDefaultSharedPreferences(StudyMaterialActivity.this);
editor=preferences.edit(); setTitle(""+preferences.getString("class_name","")+" Study
Material"); list = new ArrayList<PojoMyStudyMaterial>(); lv_my_study_material =
(ListView) findViewById(R.id.lv_my_study_material); tv_no_records = (TextView)
findViewById(R.id.tv_no_records); pBar = (ProgressBar)
findViewById(R.id.progressBar); tv_no_records = (TextView)
findViewById(R.id.tv_no_records); myStudyMaterial(); } public void
myStudyMaterial() { AsyncHttpClient client = new AsyncHttpClient(); RequestParams
params = new RequestParams();
params.put("class_id",preferences.getString("class_id",""));
client.post(Urls.urlMyStudyMaterial, params, new JsonHttpResponseHandler(){ public
void onStart() { pBar.setVisibility(View.VISIBLE); super.onStart(); } public void
onSuccess(int statusCode, Header[] headers, JSONObject response) { try {
pBar.setVisibility(View.GONE); JSONArray jarry =
response.getJSONArray("getStudyMaterial"); if (jarry.isNull(0)) {
tv_no_records.setVisibility(View.VISIBLE); tv_no_records.setText("No Notice
50
Available Yet"); } for (int i = 0 ; i < jarry.length();i++) { JSONObject jsonObject =
jarry.getJSONObject(i); String id = jsonObject.getString("id"); String title =
jsonObject.getString("title"); String description =
jsonObject.getString("description"); String doc = jsonObject.getString("doc");
String date = jsonObject.getString("date"); list.add(new
PojoMyStudyMaterial(title,description,doc,date)); } adapter = new
StudyMaterialAdapter(list, (AppCompatActivity)
StudyMaterialActivity.this,tv_no_records); lv_my_study_material.setAdapter(adapter);
} catch (JSONException e) {
e.printStackTrace(); } } public void onFailure(int statusCode, Header[] headers, String
res, Throwable t) { Toast.makeText(StudyMaterialActivity.this, "could not connect",
Toast.LENGTH_LONG).show(); } }); } }

Studymaterial.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical"
tools:context=".StudyMaterial.StudyMaterialActivity">
<androidx.appcompat.widget.SearchView android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/sv_study_material"
app:queryHint="Search Study Material" app:iconifiedByDefault="false"
android:padding="4sp" android:layout_margin="5sp"
android:background="@drawable/et_bg"
android:backgroundTint="@color/light_orange"/> <ListView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/lv_my_study_material"
android:layout_below="@+id/sv_study_material"/> <ProgressBar
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:id="@+id/progressBar"
android:visibility="gone"/> <TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="No Records"
android:layout_centerInParent="true" android:visibility="gone"
android:id="@+id/tv_no_records"/> </RelativeLayout>

Admin app
Addclass.java
package com.mountreachsolution.e_learningapp.Admin.AddClass; import
androidx.appcompat.app.AppCompatActivity; import android.app.ProgressDialog;
import android.content.Intent; import android.content.SharedPreferences; import
android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import
android.preference.PreferenceManager; import android.view.View; import
android.widget.Button; import android.widget.ImageView; import
android.widget.Toast; import
com.google.android.material.textfield.TextInputEditText; import
com.loopj.android.http.AsyncHttpClient; import
com.loopj.android.http.JsonHttpResponseHandler; import
com.loopj.android.http.RequestParams; import
com.mountreachsolution.e_learningapp.Admin.ClassInDetailsAdminActivity;
import com.mountreachsolution.e_learningapp.Admin.HomeAdminActivity;
import com.mountreachsolution.e_learningapp.Comman.Urls; import
51
com.mountreachsolution.e_learningapp.R; import
com.mountreachsolution.e_learningapp.RegistrationActivity; import
org.json.JSONException; import org.json.JSONObject; import
cz.msebera.android.httpclient.Header; public class AddClassActivity extends
AppCompatActivity { TextInputEditText tie_class_name,tie_subject_name; Button
btn_add_class; ProgressDialog progressDialog; SharedPreferences preferences;
SharedPreferences.Editor editor; @Override protected void onCreate(Bundle
savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_class); preferences=
PreferenceManager.getDefaultSharedPreferences(AddClassActivity.this);
editor=preferences.edit(); tie_class_name =
findViewById(R.id.tie_add_class_class_name); tie_subject_name =
findViewById(R.id.tie_add_class_subject_name); btn_add_class =
findViewById(R.id.btn_add_class); btn_add_class.setOnClickListener(new
View.OnClickListener() { @Override public void onClick(View v) { if
(tie_class_name.getText().toString().isEmpty()) { tie_class_name.setError("Enter Your
Class Name"); } else if (tie_subject_name.getText().toString().isEmpty()) {
tie_subject_name.setError("Enter Your Subject Name"); } else { progressDialog = new
ProgressDialog(AddClassActivity.this); progressDialog.setTitle("Adding Class");
progressDialog.setCancelable(true); progressDialog.setCanceledOnTouchOutside(true);
progressDialog.setMessage("Please Wait..."); progressDialog.show(); addClass(); }
} }); } private void addClass() { AsyncHttpClient client = new AsyncHttpClient();
RequestParams params = new RequestParams();
params.put("class_name",tie_class_name.getText().toString());
params.put("subject_name",tie_subject_name.getText().toString());
client.post(Urls.urlAddClass,params,new JsonHttpResponseHandler() { @Override
public void onStart() { super.onStart(); } @Override public void onSuccess(int
statusCode, Header[] headers, JSONObject response) { progressDialog.dismiss();
try { String aa = response.getString("success"); if (aa.equals("1")) {
Toast.makeText(AddClassActivity.this, "Class Added Successfully",
Toast.LENGTH_SHORT).show(); startActivity(new Intent(AddClassActivity.this,
HomeAdminActivity.class)); finish(); } else {
Toast.makeText(AddClassActivity.this, "Already Added",
Toast.LENGTH_SHORT).show(); } } catch (JSONException e) {
e.printStackTrace(); } } @Override public void onFailure(int statusCode, Header[]
headers, Throwable throwable, JSONObject errorResponse) {
Toast.makeText(AddClassActivity.this, "Could not Connect",
Toast.LENGTH_SHORT).show(); } }); } }

addclass.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" tools:context=".HomeActivity.HomeActivity"
android:padding="16dp"> <androidx.cardview.widget.CardView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/cardview11" android:layout_marginTop="10dp"
app:cardCornerRadius="10dp" > <LinearLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical" android:id="@+id/ll1" android:padding="16dp"
android:background="@color/light_grey" >
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
52
android:id="@+id/til_add_class_class_name"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_add_class_class_name"
android:textColor="@color/purple_700" android:hint="Class Name"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:id="@+id/til_add_class_subject_name"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_add_class_subject_name"
android:textColor="@color/purple_700" android:hint="Subject Name"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<androidx.appcompat.widget.AppCompatButton
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/btn_add_class" android:text="Add Class"
android:textColor="@color/white" android:textStyle="bold"
android:fontFamily="@font/bungee"
android:background="@drawable/btn_bg_shape"
android:backgroundTint="@color/teal_700" android:layout_marginTop="20dp"
android:layout_marginBottom="10dp" android:onClick="btn_continue"/>
</LinearLayout> </androidx.cardview.widget.CardView> </RelativeLayout>

Addhomework.java
package com.mountreachsolution.e_learningapp.Admin.AddHomeWork; import
androidx.appcompat.app.AppCompatActivity; import android.app.ProgressDialog;
import android.content.Intent; import android.content.SharedPreferences; import
android.os.Bundle; import android.preference.PreferenceManager; import
android.view.View; import android.widget.Button; import android.widget.Toast; import
com.google.android.material.textfield.TextInputEditText; import
com.loopj.android.http.AsyncHttpClient; import
com.loopj.android.http.JsonHttpResponseHandler; import
com.loopj.android.http.RequestParams; import
com.mountreachsolution.e_learningapp.Admin.HomeAdminActivity; import
com.mountreachsolution.e_learningapp.Comman.Urls; import
com.mountreachsolution.e_learningapp.R; import org.json.JSONException; import
org.json.JSONObject; import cz.msebera.android.httpclient.Header; public class
AddHomeWorkActivity extends AppCompatActivity { TextInputEditText
tie_homework_title,tie_homework_description; Button btn_add_homework;
ProgressDialog progressDialog; SharedPreferences preferences;
SharedPreferences.Editor editor; @Override protected void onCreate(Bundle
savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_home_work); preferences=
PreferenceManager.getDefaultSharedPreferences(AddHomeWorkActivity.this);
editor=preferences.edit(); tie_homework_title =
findViewById(R.id.tie_add_homework_homework_title); tie_homework_description =
findViewById(R.id.tie_add_homework_homework_description); btn_add_homework =
findViewById(R.id.btn_add_homework);
btn_add_homework.setOnClickListener(new View.OnClickListener() { @Override

53
public void onClick(View v) { if (tie_homework_title.getText().toString().isEmpty()) {
tie_homework_title.setError("Enter Your Homework title"); } else if
(tie_homework_description.getText().toString().isEmpty()) {
tie_homework_description.setError("Enter Your Homework Description"); } else {
progressDialog = new ProgressDialog(AddHomeWorkActivity.this);
progressDialog.setTitle("Adding Homework"); progressDialog.setCancelable(true);
progressDialog.setCanceledOnTouchOutside(true);
progressDialog.setMessage("Please Wait..."); progressDialog.show(); addHomework();
} } }); } private void addHomework() { AsyncHttpClient client = new
AsyncHttpClient(); RequestParams params = new RequestParams();
params.put("class_id",preferences.getString("class_id",""));
params.put("homework_title",tie_homework_title.getText().toString());
params.put("homework_description",tie_homework_description.getText().toString ());
client.post(Urls.urlAddHomework,params,new JsonHttpResponseHandler() {
@Override public void onStart() { super.onStart(); } @Override public void
onSuccess(int statusCode, Header[] headers, JSONObject response) {
progressDialog.dismiss(); try { String aa = response.getString("success"); if
(aa.equals("1")) { Toast.makeText(AddHomeWorkActivity.this, "Homework
Added Successfully", Toast.LENGTH_SHORT).show(); startActivity(new
Intent(AddHomeWorkActivity.this, HomeAdminActivity.class)); finish(); } else {
Toast.makeText(AddHomeWorkActivity.this, "Already Added",
Toast.LENGTH_SHORT).show(); } } catch (JSONException e) {
e.printStackTrace(); } } @Override public void onFailure(int statusCode, Header[]
headers, Throwable throwable, JSONObject errorResponse) {
Toast.makeText(AddHomeWorkActivity.this, "Could not Connect",
Toast.LENGTH_SHORT).show(); } }); } }

addhomework.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" tools:context=".HomeActivity.HomeActivity"
android:padding="16dp"> <androidx.cardview.widget.CardView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/cardview11" android:layout_marginTop="10dp"
app:cardCornerRadius="10dp" > <LinearLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical" android:id="@+id/ll1" android:padding="16dp"
android:background="@color/light_grey" >
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/til_add_homework_homework_title"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_add_homework_homework_title"
android:textColor="@color/purple_700" android:hint="Homework Title"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="20dp"

54
android:id="@+id/til_add_homework_homework_description"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_add_homework_homework_description"
android:textColor="@color/purple_700" android:hint="Homework Description"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<androidx.appcompat.widget.AppCompatButton android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/btn_add_homework"
android:text="Add Homework" android:textColor="@color/white"
android:textStyle="bold" android:fontFamily="@font/bungee"
android:background="@drawable/btn_bg_shape"
android:backgroundTint="@color/teal_700" android:layout_marginTop="20dp"
android:layout_marginBottom="10dp" android:onClick="btn_continue"/>
</LinearLayout> </androidx.cardview.widget.CardView> </RelativeLayout>

Addnotice.java
{ TextInputEditText tie_notice_board_title, tie_notice_board_description; TextView
tv_select_pdf; Button btn_add_notice_board; ProgressDialog progressDialog;
SharedPreferences preferences; SharedPreferences.Editor editor; private int
PICK_FILE_REQUEST = 2; private String selectedFilePath; private static final int
STORAGE_PERMISSION_CODE = 101; private Uri filePath = null;
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_notice_board); preferences =
PreferenceManager.getDefaultSharedPreferences(AddNoticeBoardActivity.this); editor
= preferences.edit(); tie_notice_board_title =
findViewById(R.id.tie_add_notice_board_title); tie_notice_board_description =
findViewById(R.id.tie_add_notice_board_description); tv_select_pdf =
findViewById(R.id.tv_add_notice_board_select_pdf); btn_add_notice_board =
findViewById(R.id.btn_add_notice_board); // if (Build.VERSION.SDK_INT >=
Build.VERSION_CODES.M && ContextCompat.checkSelfPermission(this, //
Manifest.permission.READ_EXTERNAL_STORAGE) // !=
PackageManager.PERMISSION_GRANTED) { // Intent intent = new
Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, //
Uri.parse("package:" + getPackageName())); // finish(); // startActivity(intent); // return;
// } checkPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE,
STORAGE_PERMISSION_CODE); tv_select_pdf.setOnClickListener(new
View.OnClickListener() { @Override public void onClick(View v) {
showFileChooser(); } }); btn_add_notice_board.setOnClickListener(new
View.OnClickListener(){ @Override public void onClick(View v) { if
(tie_notice_board_title.getText().toString().isEmpty()) {
tie_notice_board_title.setError("Enter Your Notice Title"); } else if
(tie_notice_board_description.getText().toString().isEmpty()) {
tie_notice_board_description.setError("Enter Your Notice Description"); } else {
progressDialog = new ProgressDialog(AddNoticeBoardActivity.this);
progressDialog.setTitle("Adding Notice Board"); progressDialog.setCancelable(true);
progressDialog.setCanceledOnTouchOutside(true);
progressDialog.setMessage("Please Wait..."); progressDialog.show();
addNoticeBoard(); } } }); } private void showFileChooser() { Intent intent = new
Intent(); intent.setType("application/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select pdf"),
55
PICK_FILE_REQUEST); } @Override protected void onActivityResult(int
requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode,
resultCode, data); if (requestCode == PICK_FILE_REQUEST && resultCode ==
RESULT_OK && data != null && data.getData() != null) { filePath = data.getData();
Log.d("", "File Uri: " + filePath.toString()); // Get the path try { selectedFilePath =
CommonMethods.getPath(this, filePath); tv_select_pdf.setText("File attached"); } catch
(URISyntaxException e) {
e.printStackTrace(); } } } // Function to check and request permission. public void
checkPermission(String permission, int requestCode) { if
(ContextCompat.checkSelfPermission(AddNoticeBoardActivity.this, permission)
== PackageManager.PERMISSION_DENIED) { // Requesting the permission
ActivityCompat.requestPermissions(AddNoticeBoardActivity.this, new String[] {
permission }, requestCode); } else { Toast.makeText(AddNoticeBoardActivity.this,
"Permission already granted", Toast.LENGTH_SHORT).show(); } } private void
addNoticeBoard() { AsyncHttpClient client = new AsyncHttpClient(); RequestParams
params = new RequestParams(); params.put("class_id",
preferences.getString("class_id", "")); params.put("title",
tie_notice_board_title.getText().toString()); params.put("description",
tie_notice_board_description.getText().toString());
client.post(Urls.urlAddNoticeBoard, params, new JsonHttpResponseHandler() { public
void onSuccess(int statusCode, Header[] headers, JSONObject response) {
try { String aa = response.getString("success"); if (aa.equals("1")) { uploadMultipart();
} else { Toast.makeText(AddNoticeBoardActivity.this, "Please Select all fields",
Toast.LENGTH_SHORT).show(); } } catch (JSONException e) { e.printStackTrace(); }
catch (IOException e) { throw new RuntimeException(e); } } public void onFailure(int
statusCode, Header[] headers, Throwable throwable,
JSONObject errorResponse) { Toast.makeText(AddNoticeBoardActivity.this, "Could
Not Connect", Toast.LENGTH_SHORT).show(); } }); } private void uploadMultipart()
throws IOException { //getting name for the pdf Random random = new Random();
String name = String.format("%04d",
random.nextInt(1000000)); if (filePath == null) { onBackPressed(); return; }
//getting the actual path of the pdf File path = new
File(AddStudyMaterialActivity.FileUtil.from(AddNoticeBoardActivity.this, filePath));
if (path == null) { Toast.makeText(this, "Please move your .pdf file to internal storage
and retry", Toast.LENGTH_LONG).show(); } else { //Uploading code try { String
uploadId = UUID.randomUUID().toString(); //Creating a multi part request new
MultipartUploadRequest(this, uploadId,
Urls.urlAddNoticeBoardDoc) .addFileToUpload(String.valueOf(path), "pdf")
//Adding file .addParameter("name", name) //Adding text parameter to the request
.setNotificationConfig(new UploadNotificationConfig()) .setMaxRetries(2)
.startUpload(); //Starting the upload onBackPressed(); } catch (Exception exc) {
Toast.makeText(this, exc.getMessage(), Toast.LENGTH_SHORT).show(); } } } public
static class FileUtil { private static final int EOF = -1; private static final int
DEFAULT_BUFFER_SIZE = 1024 * 4; private FileUtil() { } public static String
from(Context context, Uri uri) throws IOException { InputStream inputStream =
context.getContentResolver().openInputStream(uri); String fileName =
getFileName(context, uri); String[] splitName = splitFileName(fileName); File tempFile
= File.createTempFile(splitName[0], splitName[1]); tempFile = rename(tempFile,
fileName); tempFile.deleteOnExit(); FileOutputStream out = null; try { out = new
FileOutputStream(tempFile); } catch (FileNotFoundException e) { e.printStackTrace();
} if (inputStream != null) { copy(inputStream, out); inputStream.close(); } if (out !=
null) { out.close(); } return tempFile.toString(); } private static String[]
splitFileName(String fileName) { String name = fileName; String extension = ""; int i =
fileName.lastIndexOf("."); if (i != -1) { name = fileName.substring(0, i); extension =
56
fileName.substring(i); } return new String[]{name, extension}; } private static String
getFileName(Context context,
Uri uri) { String result = null; if (uri.getScheme().equals("content")) { Cursor
cursor = context.getContentResolver().query(uri, null, null, null, null); try { if
(cursor != null && cursor.moveToFirst()) { result =
cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME)); } }
catch (Exception e) { e.printStackTrace(); } finally { if (cursor != null) { cursor.close();
} } } if (result == null) { result = uri.getPath(); int cut =
result.lastIndexOf(File.separator); if (cut != -1) { result = result.substring(cut + 1); } }
return result; } private static File rename(File file, String newName) { File newFile =
new File(file.getParent(), newName); if (!newFile.equals(file)) { if (newFile.exists()
&& newFile.delete()) { Log.d("FileUtil", "Delete old " + newName + " file"); } if
(file.renameTo(newFile)) { Log.d("FileUtil", "Rename file to " + newName); } } return
newFile; } private static long copy(InputStream input, OutputStream output) throws
IOException { long count = 0; int n; byte[]
buffer = new byte[DEFAULT_BUFFER_SIZE]; while (EOF != (n =
input.read(buffer))) { output.write(buffer, 0, n); count += n; } return count; } } }

Addnotice.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
tools:context=".Admin.AddNoticeBoardActivity.AddNoticeBoardActivity"
android:padding="16dp"> <androidx.cardview.widget.CardView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/cardview11" android:layout_marginTop="10dp"
app:cardCornerRadius="10dp" > <LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content" android:orientation="vertical"
android:id="@+id/ll1" android:padding="16dp"
android:background="@color/light_yellow" >
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/til_add_notice_board_title"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_add_notice_board_title"
android:textColor="@color/purple_700" android:hint="Notice Title"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:id="@+id/til_add_notice_board_description"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_add_notice_board_description"
android:textColor="@color/purple_700" android:hint="Notice Description"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout> <TextView
57
android:id="@+id/tv_add_notice_board_select_pdf_title"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginTop="25dp"
android:layout_marginRight="10dp" android:text="Select Notice PDF"
android:textColor="@color/black" android:textSize="18dp" android:textStyle="bold" />
<TextView android:id="@+id/tv_add_notice_board_select_pdf"
android:layout_width="match_parent" android:layout_height="45dp"
android:layout_marginLeft="10dp" android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/edittextbackground" android:hint="Click here select
PDF" android:textAlignment="center" android:gravity="center"
android:textColorHint="@color/teal_700" android:textSize="15dp"
<androidx.appcompat.widget.AppCompatButton
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/btn_add_notice_board" android:text="Add Notice"
android:textColor="@color/white" android:textStyle="bold"
android:fontFamily="@font/bungee"
android:background="@drawable/btn_bg_shape"
android:backgroundTint="@color/teal_700" android:layout_marginTop="20dp"
android:layout_marginBottom="10dp" /> </LinearLayout>
</androidx.cardview.widget.CardView> </RelativeLayout>

Addmodelans.java
ackage
com.mountreachsolution.e_learningapp.Admin.AddQuestionandAnswerModelPap
erActivity; import androidx.appcompat.app.AppCompatActivity; import
androidx.appcompat.widget.AppCompatButton; import
androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat;
import android.Manifest; import android.app.ProgressDialog; import
android.content.Context; import android.content.Intent; import
android.content.SharedPreferences; import android.content.pm.PackageManager;
import android.database.Cursor; import android.net.Uri; import android.os.Build;
import android.os.Bundle; import android.preference.PreferenceManager; import
android.provider.OpenableColumns; import android.provider.Settings; import
android.util.Log; import android.view.View; import android.widget.Spinner; import
android.widget.TextView; import android.widget.Toast; import
com.google.android.material.textfield.TextInputEditText; import
com.loopj.android.http.AsyncHttpClient; import
com.loopj.android.http.JsonHttpResponseHandler; import
com.loopj.android.http.RequestParams; import
com.mountreachsolution.e_learningapp.Admin.AddNoticeBoardActivity.AddNotic
eBoardActivity; import
com.mountreachsolution.e_learningapp.Admin.AddQuestionandAnswerModelPap
erActivity.AddQuestionandAnswerModelPaperActivity; import
com.mountreachsolution.e_learningapp.Admin.AddStudyMaterial.AddStudyMater
ialActivity; import
com.mountreachsolution.e_learningapp.Comman.CommonMethods; import
com.mountreachsolution.e_learningapp.Comman.Urls; import
com.mountreachsolution.e_learningapp.QuestionandAnswerModelPaper.Questiona
ndAnswerModelPaperActivity; import
com.mountreachsolution.e_learningapp.QuestionandAnswerModelPaper.SearchQu
estionandAnswerPaperActivity; import com.mountreachsolution.e_learningapp.R;
import net.gotev.uploadservice.MultipartUploadRequest; import
net.gotev.uploadservice.UploadNotificationConfig; import
org.json.JSONException; import org.json.JSONObject; import java.io.File; import
58
java.io.FileNotFoundException; import java.io.FileOutputStream; import
java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import
java.net.URISyntaxException; import java.util.Random; import java.util.UUID; import
cz.msebera.android.httpclient.Header; public class
AddQuestionandAnswerModelPaperActivity extends AppCompatActivity { Spinner
spinner_add_branch, spinner_add_semester, spinner_add_exam;
TextInputEditText tie_question_and_answer_paper_title; TextView tv_select_pdf;
AppCompatButton btn_add_question_and_answer_paper; SharedPreferences
preferences; SharedPreferences.Editor editor; ProgressDialog progressDialog; private
int PICK_FILE_REQUEST = 2; private String selectedFilePath; private Uri filePath =
null; private static final int STORAGE_PERMISSION_CODE = 101; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_questionand_answer_model_paper); preferences =
PreferenceManager.getDefaultSharedPreferences(AddQuestionandAnswerModelP
aperActivity.this); editor = preferences.edit(); setTitle("" +
preferences.getString("class_name", "") + "Add Q and A Paper"); spinner_add_branch =
findViewById(R.id.spinner_add_branch); spinner_add_semester =
findViewById(R.id.spinner_add_semester); spinner_add_exam =
findViewById(R.id.spinner_add_exam);
tie_question_and_answer_paper_title =
findViewById(R.id.tie_add_question_and_answer_paper_title); tv_select_pdf =
findViewById(R.id.tv_add_question_and_answer_paper);
btn_add_question_and_answer_paper =
findViewById(R.id.btn_add_question_and_answer_paper_search);
checkPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE,
STORAGE_PERMISSION_CODE); // if (Build.VERSION.SDK_INT >=
Build.VERSION_CODES.M && ContextCompat.checkSelfPermission(this, //
Manifest.permission.READ_EXTERNAL_STORAGE) // !=
PackageManager.PERMISSION_GRANTED) { // Intent intent = new
Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, //
Uri.parse("package:" + getPackageName())); // finish(); // startActivity(intent); // return;
// } tv_select_pdf.setOnClickListener(new View.OnClickListener() { @Override public
void onClick(View v) { showFileChooser(); } });
btn_add_question_and_answer_paper.setOnClickListener(new View.OnClickListener()
{ @Override public void onClick(View v) { if
(spinner_add_branch.getSelectedItem().toString().equals("Select Your Branch")) {
((TextView) spinner_add_branch.getSelectedView()).setError("Please Select Your
Branch"); } else if
(spinner_add_semester.getSelectedItem().toString().equals("Select Your Sem")) {
((TextView) spinner_add_semester.getSelectedView()).setError("Please Select Your
Sem"); } else if
(spinner_add_exam.getSelectedItem().toString().equals("Select Your Exam")) {
((TextView) spinner_add_exam.getSelectedView()).setError("Please Select Your
Exam"); } if (tie_question_and_answer_paper_title.getText().toString().isEmpty())
{ tie_question_and_answer_paper_title.setError("Enter Your Question and Answer
Paper Title"); } else { progressDialog = new
ProgressDialog(AddQuestionandAnswerModelPaperActivity.this);
progressDialog.setTitle("Adding Notice Board"); progressDialog.setCancelable(true);
progressDialog.setCanceledOnTouchOutside(true);
progressDialog.setMessage("Please Wait..."); progressDialog.show();
addQuestionandAnswerPaper(); } } }); } // Function to check and request permission.
public void checkPermission(String permission, int requestCode) { if
(ContextCompat.checkSelfPermission(AddQuestionandAnswerModelPaperActivit
59
y.this, permission) == PackageManager.PERMISSION_DENIED) { // Requesting the
permission
ActivityCompat.requestPermissions(AddQuestionandAnswerModelPaperActivity.t his,
new String[] { permission }, requestCode); } else {
Toast.makeText(AddQuestionandAnswerModelPaperActivity.this, "Permission already
granted", Toast.LENGTH_SHORT).show(); } } private void showFileChooser() { Intent
intent = new Intent(); intent.setType("application/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select pdf"),
PICK_FILE_REQUEST); } @Override protected void onActivityResult(int
requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode,
resultCode, data); if (requestCode == PICK_FILE_REQUEST && resultCode ==
RESULT_OK && data != null && data.getData() != null) { filePath = data.getData();
Log.d("", "File Uri: " + filePath.toString()); // Get the path try { selectedFilePath =
CommonMethods.getPath(this, filePath); tv_select_pdf.setText("File attached"); } catch
(URISyntaxException e) { e.printStackTrace(); } } } private void
addQuestionandAnswerPaper() { AsyncHttpClient client = new AsyncHttpClient();
RequestParams params = new RequestParams(); params.put("class_id",
preferences.getString("class_id", "")); params.put("branch",
spinner_add_branch.getSelectedItem().toString()); params.put("sem",
spinner_add_semester.getSelectedItem().toString()); params.put("exam",
spinner_add_exam.getSelectedItem().toString()); params.put("title",
tie_question_and_answer_paper_title.getText().toString());
client.post(Urls.urlAddQuestionandAnswerPaper, params, new
JsonHttpResponseHandler() { public void onSuccess(int statusCode, Header[] headers,
JSONObject response) { try { String aa = response.getString("success"); if
(aa.equals("1")) { uploadMultipart(); } else {
Toast.makeText(AddQuestionandAnswerModelPaperActivity.this, "Please Select all
fields", Toast.LENGTH_SHORT).show(); } } catch (JSONException e) {
e.printStackTrace(); } catch (IOException e) { throw new RuntimeException(e); }
} public void onFailure(int statusCode, Header[] headers, Throwable throwable,
JSONObject errorResponse) {
Toast.makeText(AddQuestionandAnswerModelPaperActivity.this, "Could Not
Connect", Toast.LENGTH_SHORT).show(); } }); } private void uploadMultipart()
throws IOException { //getting name for the pdf Random random = new Random();
String name = String.format("%04d", random.nextInt(1000000)); if
(filePath == null) { onBackPressed(); return; } //getting the actual path of the pdf File
path = new
File(FileUtil.from(AddQuestionandAnswerModelPaperActivity.this, filePath)); if (path
== null) { Toast.makeText(this, "Please move your .pdf file to internal storage and retry",
Toast.LENGTH_LONG).show(); } else { //Uploading code try { String uploadId =
UUID.randomUUID().toString(); //Creating a multi part request new
MultipartUploadRequest(this, uploadId,
Urls.urlAddQuestionandAnswerPaperDoc)
.addFileToUpload(String.valueOf(path), "pdf") //Adding file
.addParameter("name", name) //Adding text parameter to the request
.setNotificationConfig(new UploadNotificationConfig()) .setMaxRetries(2)
.startUpload(); //Starting the upload onBackPressed(); } catch (Exception exc) {
Toast.makeText(this, exc.getMessage(), Toast.LENGTH_SHORT).show(); } } } public
static class FileUtil { private static final int EOF = -1; private static final int
DEFAULT_BUFFER_SIZE = 1024 * 4; private FileUtil() { } public static String
from(Context context, Uri uri) throws IOException { InputStream inputStream =
context.getContentResolver().openInputStream(uri); String fileName =
getFileName(context, uri); String[] splitName = splitFileName(fileName); File tempFile

60
= File.createTempFile(splitName[0], splitName[1]); tempFile = rename(tempFile,
fileName); tempFile.deleteOnExit(); FileOutputStream out = null; try { out = new
FileOutputStream(tempFile); } catch (FileNotFoundException e) { e.printStackTrace();
} if (inputStream != null) { copy(inputStream, out); inputStream.close(); } if (out !=
null) { out.close(); } return tempFile.toString(); } private static String[]
splitFileName(String fileName) { String name = fileName; String extension = ""; int i =
fileName.lastIndexOf("."); if (i != -1) { name = fileName.substring(0, i); extension =
fileName.substring(i); } return new String[]{name, extension}; } private static String
getFileName(Context context, Uri uri) { String result = null; if
(uri.getScheme().equals("content")) { Cursor cursor =
context.getContentResolver().query(uri, null, null, null, null); try { if
(cursor != null && cursor.moveToFirst()) { result =
cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME)); } }
catch (Exception e) { e.printStackTrace(); } finally { if (cursor != null) { cursor.close();
} } } if (result == null) { result = uri.getPath(); int cut =
result.lastIndexOf(File.separator); if (cut != -1) { result = result.substring(cut + 1); } }
return result; } private static File rename(File file, String newName) { File newFile =
new File(file.getParent(), newName); if (!newFile.equals(file)) { if (newFile.exists()
&& newFile.delete()) { Log.d("FileUtil", "Delete old " + newName + " file"); } if
(file.renameTo(newFile)) { Log.d("FileUtil", "Rename file to " + newName); } } return
newFile; } private static long copy(InputStream input, OutputStream output) throws
IOException { long count = 0; int n; byte[]
buffer = new byte[DEFAULT_BUFFER_SIZE]; while (EOF != (n =
input.read(buffer))) { output.write(buffer, 0, n); count += n; } return count; } } }

addmodelans.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:layout_height="match_parent"
tools:context=".QuestionandAnswerModelPaper.QuestionandAnswerModelPaperA
ctivity" android:orientation="vertical"> <TextView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tv_add_question_and_answer_paper_select_branch_title"
android:text="Select Branch" android:textSize="18dp" android:textStyle="bold"
android:textColor="@color/purple_700" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginTop="20dp"
android:fontFamily="sans-serif-condensed-medium"/> <Spinner
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/spinner_add_branch" android:layout_marginTop="20dp"
android:layout_marginLeft="20dp" android:layout_marginRight="20dp"
android:entries="@array/branch" /> <TextView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tv_add_question_and_answer_paper_select_semester_title"
android:text="Select Semester" android:textSize="18dp" android:textStyle="bold"
android:textColor="@color/purple_700" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginTop="20dp"
android:fontFamily="sans-serif-condensed-medium"/> <Spinner
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/spinner_add_semester" android:layout_marginTop="20dp"
android:layout_marginLeft="20dp" android:layout_marginRight="20dp"
android:entries="@array/semester" /> <TextView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tv_add_question_and_answer_paper_select_exam_title"
61
android:text="Select Exam" android:textSize="18dp" android:textStyle="bold"
android:textColor="@color/purple_700" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginTop="20dp"
android:fontFamily="sans-serif-condensed-medium"/> <Spinner
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/spinner_add_exam" android:layout_marginTop="20dp"
android:layout_marginLeft="20dp" android:layout_marginRight="20dp"
android:entries="@array/select_the_exam" />
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:id="@+id/tv_add_question_and_answer_paper_title"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_add_question_and_answer_paper_title"
android:textColor="@color/purple_700" android:hint="Title of Paper"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout> <TextView
android:id="@+id/tv_add_question_and_answer_paper_Pdf_title"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginTop="25dp"
android:layout_marginRight="10dp" android:text="Select Question or Answer Paper
PDF" android:textColor="@color/black" android:textSize="18dp"
android:textStyle="bold" /> <TextView
android:id="@+id/tv_add_question_and_answer_paper"
android:layout_width="match_parent" android:layout_height="45dp"
android:layout_marginLeft="10dp" android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/edittextbackground" android:hint="Click here select
PDF" android:textAlignment="center" android:gravity="center"
android:textColorHint="@color/teal_700" android:textSize="15dp" />
<androidx.appcompat.widget.AppCompatButton
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/btn_add_question_and_answer_paper_search"
android:text="Add Question and Answer Paper" android:textColor="@color/white"
android:textStyle="bold" android:fontFamily="@font/bungee"
android:background="@drawable/btn_bg_shape" android:layout_margin="20dp"
/>

Addrecorduing.java
?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:layout_height="match_parent"
tools:context=".QuestionandAnswerModelPaper.QuestionandAnswerModelPaperA
ctivity" android:orientation="vertical"> <TextView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tv_add_question_and_answer_paper_select_branch_title"
android:text="Select Branch" android:textSize="18dp" android:textStyle="bold"
android:textColor="@color/purple_700" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginTop="20dp"
android:fontFamily="sans-serif-condensed-medium"/> <Spinner
android:layout_width="match_parent" android:layout_height="wrap_content"
62
android:id="@+id/spinner_add_branch" android:layout_marginTop="20dp"
android:layout_marginLeft="20dp" android:layout_marginRight="20dp"
android:entries="@array/branch" /> <TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_add_question_and_answer_paper_select_semester_title"
android:text="Select Semester" android:textSize="18dp" android:textStyle="bold"
android:textColor="@color/purple_700" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginTop="20dp"
android:fontFamily="sans-serif-condensed-medium"/> <Spinner
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/spinner_add_semester" android:layout_marginTop="20dp"
android:layout_marginLeft="20dp" android:layout_marginRight="20dp"
android:entries="@array/semester" /> <TextView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tv_add_question_and_answer_paper_select_exam_title"
android:text="Select Exam" android:textSize="18dp" android:textStyle="bold"
android:textColor="@color/purple_700" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginTop="20dp"
android:fontFamily="sans-serif-condensed-medium"/> <Spinner
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/spinner_add_exam" android:layout_marginTop="20dp"
android:layout_marginLeft="20dp" android:layout_marginRight="20dp"
android:entries="@array/select_the_exam" />
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:id="@+id/tv_add_question_and_answer_paper_title"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_add_question_and_answer_paper_title"
android:textColor="@color/purple_700" android:hint="Title of Paper"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout> <TextView
android:id="@+id/tv_add_question_and_answer_paper_Pdf_title"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginTop="25dp"
android:layout_marginRight="10dp" android:text="Select Question or Answer Paper
PDF" android:textColor="@color/black" android:textSize="18dp"
android:textStyle="bold" /> <TextView
android:id="@+id/tv_add_question_and_answer_paper"
android:layout_width="match_parent" android:layout_height="45dp"
android:layout_marginLeft="10dp" android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/edittextbackground" android:hint="Click here select
PDF" android:textAlignment="center" android:gravity="center"
android:textColorHint="@color/teal_700" android:textSize="15dp" />
<androidx.appcompat.widget.AppCompatButton
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/btn_add_question_and_answer_paper_search"
android:text="Add Question and Answer Paper" android:textColor="@color/white"
android:textStyle="bold" android:fontFamily="@font/bungee"
android:background="@drawable/btn_bg_shape" android:layout_margin="20dp"
/>

63
Addrecording.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" tools:context=".HomeActivity.HomeActivity"
android:padding="16dp"> <androidx.cardview.widget.CardView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/cardview11" android:layout_marginTop="10dp"
app:cardCornerRadius="10dp" > <LinearLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical" android:id="@+id/ll1" android:padding="16dp"
android:background="@color/light_purple" >
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/til_add_recording_recording_title"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_add_recording_recording_title"
android:textColor="@color/purple_700" android:hint="Recording Title"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:id="@+id/til_add_recording_recording_description"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_add_recording_recording_description"
android:textColor="@color/purple_700" android:hint="Recording Description"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:id="@+id/til_add_recording_recording_url"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent" android:layout_height="wrap_content"
android:id="@+id/tie_add_recording_recording_url"
android:textColor="@color/purple_700" android:hint="Recording URL"
android:autoLink="web" android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<androidx.appcompat.widget.AppCompatButton android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/btn_add_recording"
android:text="Add Recording" android:textColor="@color/white"
android:textStyle="bold" android:fontFamily="@font/bungee"
android:background="@drawable/btn_bg_shape"
android:backgroundTint="@color/teal_700" at.java
android:layout_marginBottom="10dp" /> </LinearLayout>
</androidx.cardview.widget.CardView> </RelativeLayout>

64
addstudym.java
package com.mountreachsolution.e_learningapp.Admin.AddStudyMaterial; import
androidx.appcompat.app.AppCompatActivity; import
androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat;
import android.Manifest; import android.app.ProgressDialog; import
android.content.Context; import android.content.Intent; import
android.content.SharedPreferences; import android.content.pm.PackageManager;
import android.database.Cursor; import android.net.Uri; import android.os.Build;
import android.os.Bundle; import android.preference.PreferenceManager; import
android.provider.MediaStore; import android.provider.OpenableColumns; import
android.provider.Settings; import android.util.Log; import android.view.View; import
android.widget.Button; import android.widget.EditText; import
android.widget.TextView; import android.widget.Toast; import
com.google.android.material.textfield.TextInputEditText; import
com.loopj.android.http.AsyncHttpClient; import
com.loopj.android.http.JsonHttpResponseHandler; import
com.loopj.android.http.RequestParams; import
com.mountreachsolution.e_learningapp.Admin.AddClass.AddClassActivity; import
com.mountreachsolution.e_learningapp.Comman.CommonMethods; import
com.mountreachsolution.e_learningapp.Comman.Urls; import
com.mountreachsolution.e_learningapp.R; import
net.gotev.uploadservice.MultipartUploadRequest; import
net.gotev.uploadservice.UploadNotificationConfig; import
org.json.JSONException; import org.json.JSONObject; import java.io.File; import
java.io.FileNotFoundException; import java.io.FileOutputStream; import
java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import
java.net.URISyntaxException; import java.util.Random; import java.util.UUID; import
cz.msebera.android.httpclient.Header; public class AddStudyMaterialActivity extends
AppCompatActivity { EditText
et_study_material_title, et_study_material_description; TextView tv_select_pdf; Button
btn_add_study_material; ProgressDialog progressDialog;
SharedPreferences preferences; SharedPreferences.Editor editor; private int
PICK_FILE_REQUEST = 2; private String selectedFilePath; private Uri filePath = null;
private static final int STORAGE_PERMISSION_CODE = 101; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_study_material); preferences =
PreferenceManager.getDefaultSharedPreferences(AddStudyMaterialActivity.this);
editor = preferences.edit(); et_study_material_title =
findViewById(R.id.et_study_material_title); et_study_material_description =
findViewById(R.id.et_study_material_description); tv_select_pdf =
findViewById(R.id.tv_study_material_select_pdf); btn_add_study_material =
findViewById(R.id.btn_add_study_material); // if (Build.VERSION.SDK_INT >=
Build.VERSION_CODES.M && ContextCompat.checkSelfPermission(this, //
Manifest.permission.READ_EXTERNAL_STORAGE) // !=
PackageManager.PERMISSION_GRANTED) { // Intent intent = new
Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, //
Uri.parse("package:" + getPackageName())); // finish(); // startActivity(intent); // return;
// } checkPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE,
STORAGE_PERMISSION_CODE); tv_select_pdf.setOnClickListener(new
View.OnClickListener() { @Override public void onClick(View v) {
showFileChooser(); } }); btn_add_study_material.setOnClickListener(new
View.OnClickListener() { @Override public void onClick(View v) { if
(et_study_material_title.getText().toString().isEmpty()) {
et_study_material_title.setError("Enter Your Study Material Title"); } else if
65
(et_study_material_description.getText().toString().isEmpty()) {
et_study_material_description.setError("Enter Your Study Material Description"); } else
{ progressDialog = new ProgressDialog(AddStudyMaterialActivity.this);
progressDialog.setTitle("Adding Study Material"); progressDialog.setCancelable(true);
progressDialog.setCanceledOnTouchOutside(true);
progressDialog.setMessage("Please Wait..."); progressDialog.show();
addStudyMaterial(); } } }); } // Function to check and request permission. public void
checkPermission(String permission, int requestCode) { if
(ContextCompat.checkSelfPermission(AddStudyMaterialActivity.this, permission)
== PackageManager.PERMISSION_DENIED) { // Requesting the permission
ActivityCompat.requestPermissions(AddStudyMaterialActivity.this, new String[]
{ permission }, requestCode); } else {
Toast.makeText(AddStudyMaterialActivity.this, "Permission already granted",
Toast.LENGTH_SHORT).show(); } } private void showFileChooser() { Intent
intent = new Intent(); intent.setType("application/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select pdf"),
PICK_FILE_REQUEST); } @Override protected void onActivityResult(int
requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode,
resultCode, data); if (requestCode == PICK_FILE_REQUEST && resultCode ==
RESULT_OK && data != null && data.getData() != null) { filePath =
data.getData();Log.d("", "File Uri: " + filePath.toString()); // Get the path try {
selectedFilePath = CommonMethods.getPath(this, filePath); tv_select_pdf.setText("File
attached"); } catch (URISyntaxException e) {
e.printStackTrace(); } } } private void addStudyMaterial() { AsyncHttpClient client =
new AsyncHttpClient(); RequestParams params = new RequestParams();
params.put("class_id", preferences.getString("class_id", "")); params.put("title",
et_study_material_title.getText().toString()); params.put("description",
et_study_material_description.getText().toString());
client.post(Urls.urlAddStudyMaterial, params, new JsonHttpResponseHandler() {
public void onSuccess(int statusCode, Header[] headers, JSONObject response) { try {
String aa = response.getString("success"); if (aa.equals("1")) { uploadMultipart(); } else
{ Toast.makeText(AddStudyMaterialActivity.this, "Please Select all fields",
Toast.LENGTH_SHORT).show(); } } catch (JSONException e) { e.printStackTrace(); }
catch (IOException e) { throw new RuntimeException(e); } } public void onFailure(int
statusCode, Header[] headers, Throwable throwable,
JSONObject errorResponse) { Toast.makeText(AddStudyMaterialActivity.this, "Could
Not Connect", Toast.LENGTH_SHORT).show(); } }); } private void uploadMultipart()
throws IOException { //getting name for the pdf Random random = new Random();
String name = String.format("%04d",
random.nextInt(1000000)); if (filePath == null) { onBackPressed(); return; }
//getting the actual path of the pdf File path = new
File(FileUtil.from(AddStudyMaterialActivity.this, filePath)); if (path == null) {
Toast.makeText(this, "Please move your .pdf file to internal storage and retry",
Toast.LENGTH_LONG).show(); } else { //Uploading code try { String uploadId =
UUID.randomUUID().toString(); //Creating a multi part request new
MultipartUploadRequest(this, uploadId, Urls.urlAddStudyMaterialDoc)
.addFileToUpload(String.valueOf(path), "pdf") //Adding file
.addParameter("name", name) //Adding text parameter to the request
.setNotificationConfig(new UploadNotificationConfig()) .setMaxRetries(2)
.startUpload(); //Starting the upload onBackPressed(); } catch (Exception exc) {
Toast.makeText(this, exc.getMessage(), Toast.LENGTH_SHORT).show(); } } } public
static class FileUtil { private static final int EOF = -1; private static final int
DEFAULT_BUFFER_SIZE = 1024 * 4; private FileUtil() { } public static String
66
from(Context context, Uri uri) throws IOException { InputStream inputStream =
context.getContentResolver().openInputStream(uri); String fileName =
getFileName(context, uri); String[] splitName = splitFileName(fileName); File tempFile
= File.createTempFile(splitName[0], splitName[1]); tempFile = rename(tempFile,
fileName); tempFile.deleteOnExit(); FileOutputStream out = null; try { out = new
FileOutputStream(tempFile); } catch (FileNotFoundException e) { e.printStackTrace();
} if (inputStream != null) { copy(inputStream, out); inputStream.close(); } if (out !=
null) { out.close(); } return tempFile.toString(); } private static String[]
splitFileName(String fileName) { String name = fileName; String extension = ""; int i =
fileName.lastIndexOf("."); if (i != -1) { name = fileName.substring(0, i); extension =
fileName.substring(i); } return new String[]{name, extension}; } private static String
getFileName(Context context, Uri uri) { String result = null; if
(uri.getScheme().equals("content")) { Cursor cursor =
context.getContentResolver().query(uri, null, null, null, null); try { if
(cursor != null && cursor.moveToFirst()) { result =
cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME)); } }
catch (Exception e) { e.printStackTrace(); } finally { if (cursor != null) { cursor.close();
} } } if (result == null) { result = uri.getPath(); int cut =
result.lastIndexOf(File.separator); if (cut != -1) { result = result.substring(cut + 1); } }
return result; } private static File rename(File file, String newName) { File newFile =
new File(file.getParent(), newName); if (!newFile.equals(file)) { if (newFile.exists()
&& newFile.delete()) { Log.d("FileUtil", "Delete old " + newName + " file"); } if
(file.renameTo(newFile)) { Log.d("FileUtil", "Rename file to " + newName); } } return
newFile; } private static long copy(InputStream input, OutputStream output) throws
IOException { long count = 0; int n; byte[]
buffer = new byte[DEFAULT_BUFFER_SIZE]; while (EOF != (n =
input.read(buffer))) { output.write(buffer, 0, n); count += n; } return count; } } }

addstudymat.xml
<ScrollView 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=".Admin.HomeAdminActivity"> <LinearLayout
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> <TextView
android:id="@+id/tv_study_material_title" android:layout_width="match_parent"
android:layout_height="45dp" android:layout_marginLeft="10dp"
android:layout_marginTop="25dp" android:layout_marginRight="10dp"
android:text="Study Material Title" android:textColor="@color/black"
android:textSize="18dp" android:textStyle="bold" /> <EditText
android:id="@+id/et_study_material_title" android:layout_width="match_parent"
android:layout_height="45dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/edittextbackground" android:hint="Study Material
Title" android:textAlignment="center"
android:textColorHint="@color/teal_700" android:textSize="15dp" /> <TextView
android:id="@+id/tv_study_material_description"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginTop="25dp"
android:layout_marginRight="10dp" android:text="Study Material Description"
android:textColor="@color/black" android:textSize="18dp" android:textStyle="bold" />
<EditText android:id="@+id/et_study_material_description"
android:layout_width="match_parent" android:layout_height="wrap_content"
67
android:layout_marginLeft="10dp" android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/edittextbackground" android:hint="Study Material
Description" android:minHeight="45dp" android:textAlignment="center"
android:textColorHint="@color/teal_700" android:textSize="15dp" /> <TextView
android:id="@+id/tv_study_material_select_pdf_title"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginTop="25dp"
android:layout_marginRight="10dp" android:text="Select Study Material PDF"
android:textColor="@color/black" android:textSize="18dp" android:textStyle="bold" />
<TextView android:id="@+id/tv_study_material_select_pdf"
android:layout_width="match_parent" android:layout_height="45dp"
android:layout_marginLeft="10dp" android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/edittextbackground" android:hint="Click here select
PDF" android:textAlignment="center" android:gravity="center"
android:textColorHint="@color/teal_700" android:textSize="15dp" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_add_study_material" android:layout_width="match_parent"
android:layout_height="45dp" android:layout_gravity="center"
android:layout_marginTop="20dp" android:layout_marginBottom="20dp"
android:background="@drawable/btn_bg_shape"
android:backgroundTint="@color/teal_700" android:text="Add Study Material"
android:textAllCaps="false" android:textColor="#ffff"
android:layout_margin="16dp" android:textSize="16dp" android:textStyle="bold"
/> <ProgressBar android:id="@+id/progress" android:layout_width="match_parent"
android:layout_height="45dp" android:layout_centerInParent="true"
android:visibility="gone" />
</LinearLayout> </ScrollView>

Manifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> <uses-permission
android:name="android.permission.INTERNET" /> <uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION" />
<usespermission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE" />
<usespermission android:name="android.permission.FOREGROUND_SERVICE" />
<!--Declaring the required permissions--> <uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE" />
<usespermission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true"
android:theme="@style/Theme.ELearningApp"
android:usesCleartextTraffic="true" tools:targetApi="31"> <activity
android:name=".Admin.AddClass.AddClassActivity" android:exported="false" />
<activity
android:name=".Admin.AddQuestionandAnswerModelPaperActivity.AddQuestion
68
andAnswerModelPaperActivity" android:exported="false" /> <activity
android:name=".Admin.AddNoticeBoardActivity.AddNoticeBoardActivity"
android:exported="false" /> <activity
android:name=".Admin.AddRecording.AddRecordingActivity"
android:exported="false" /> <activity
android:name=".Admin.AddStudyMaterial.AddStudyMaterialActivity"
android:exported="false" /> <activity
android:name=".Admin.AddHomeWork.AddHomeWorkActivity"
android:exported="false" /> <activity
android:name=".Admin.ClassInDetailsAdminActivity" android:exported="false" />
<activity android:name=".Admin.HomeAdminActivity" android:exported="false"
/> <activity android:name=".Admin.LoginAdminActivity" android:exported="false" />
<activity
android:name=".QuestionandAnswerModelPaper.SearchQuestionandAnswerPaper
Activity" android:exported="false" /> <activity
android:name=".Quiz.QuizActivity" android:exported="false" /> <activity
android:name=".QuestionandAnswerModelPaper.QuestionandAnswerModelPaper
Activity" android:exported="false" /> <activity
android:name=".NoticeBoard.NoticeBoardActivity" android:exported="false" />
<activity android:name=".Recording.RecordingActivity" android:exported="false"
/> <activity android:name=".StudyMaterial.StudyMaterialActivity"
android:exported="false" /> <activity
android:name=".HomeWork.HomeWorkActivity" android:exported="false" />
<activity android:name=".HomeActivity.ClassInDetailsActivity"
android:exported="false" /> <activity android:name=".RegistrationActivity"
android:exported="false" android:theme="@style/NoActionBar" /> <activity
android:name=".HomeActivity.HomeActivity" android:exported="false" /> <activity
android:name=".LoginActivity" android:exported="false"
android:theme="@style/NoActionBar" /> <activity android:name=".SplashActivity"
android:exported="true" android:theme="@style/NoActionBar"> <intent-filter> <action
android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
</activity> </application>
</manifest>

69
Chapter 6

70
7. CONCLUSION AND FUTURE SCOPE
Our project is only a humble venture to satisfy the needs to manage their project work.
Several user friendly coding have also adopted. This package shall prove to be a powerful package
in satisfying all the requirements of the school. The objective of software planning is to provide a
frame work that enables the manger to make reasonable estimates made within a limited time frame
at the beginning of the software project and should be updated regularly as the project progresses.

• At the end it is concluded that we have made effort on following points...

• A description of the background and context of the project and its relation to work already done
in the area.

• Made statement of the aims and objectives of the project.

• The description of Purpose, Scope, and applicability.

• We &fine the problem on which we are working in the project.

• We describe the requirement Specifications of the system and the actions that can be done on
these things.

• We understand the problem domain and produce a model of the system, which describes
operations that can be performed on the system.

• We included features and operations in detail, including screen layouts.

• We designed user interface and security issues related to system.

• Finally the system is implemented and tested according to test cases.

71
7.1 FUTURE SCOPE
In a nutshell, it can be summarized that the future scope of the project circles around maintaining
information regarding:
We can add printer in future.
• We can give more advance software for E-learning Management System including more
facilities
• We will host the platform on online servers to make it accessible worldwide
• Integrate multiple load balancers to distribute the loads of the system
• Create the master and slave database structure to reduce the overload of the database queries
• Implement the backup mechanism for taking backup of codebase and database on regular basis
on different servers.

The above mentioned points are the enhancements which can be done to increase the applicability and
usage of this project. Here we can maintain the records of Assignment and Student. Also, as it can be
seen that now-a-days the players are versatile, i.e. so there is a scope for introducing a method to
maintain the E-learning Management System.
Enhancements can be done to maintain all the Assignment, Student, TEACHER, QUIZ, QUESTION.
We have left all the options open so that if there is any other future requirement in the system by
the user for the enhancement of the system then it is possible to implement them. In the last we
would like to thanks all the persons involved in the development of the system directly or
indirectly. We hope that the project will serve its purpose for which it is develop there by
underlining success of process.

72

You might also like