You are on page 1of 92

ANDROID APP FOR FARMERS

CHAPTER 1

P G R M SN COLLEGE CHANNANIKADU 1
ANDROID APP FOR FARMERS

CHAPTER 1

INTRODUCTION

1.1 About the project

Android mobile use in Agriculture is as the core components to more helpful to increase
productivity of crops and indirectly to increase GDP of India reduce poverty. This is an android
application which will be useful for farmers & agricultural institutes for cultivation of various
kinds of crops in various type of atmosphere. This smart phone app is easy to use which will
suggest most probable matching crops to people according to weather condition. By this farmer
can cultivate more suited crop and increase production ratio. Here application needed basic
inputs like water availability in mm, average temperature, verge soil Ph of farm, locality of
farm, soil type etc. so by certain calculation at backend this application will show most probable
crops for that farm. It is one farmer’s friend kind of application.

1.2 MODULE DESCRIPTION

The main modules are

1.2.1 Admin

 Agricultural department Management


 General notifications
 Discussions
 Feedback Management
 New government policies

1.2.1.1 Farmer

 Doubt Clearance

P G R M SN COLLEGE CHANNANIKADU 2
ANDROID APP FOR FARMERS

 Fertilizers/pesticides information
 Chatting

1.2.1.2 Agriculture Officer

 Interaction with Farmers


 Notifications
 Track Farmers

1.2.1.3 Public

 New notifications will be available on web


 Query
 Registration

P G R M SN COLLEGE CHANNANIKADU 3
ANDROID APP FOR FARMERS

CHAPTER 2

P G R M SN COLLEGE CHANNANIKADU 4
ANDROID APP FOR FARMERS

CHAPTER 2
SYSTEM STUDY AND PROBLEM FORMULATION

2.1 SYSTEM STUDY

System study involves study for the current system in detail and to find out how it works
and where the improvements have to be made it also involves the detailed study of the various
operations performed by the system and their relationship within and the outside the system
the analyst and the user work in close associations during the complete analysis phase. This is
a phase that determines what is to be done for software development.

2.2 EXISTING SYSTEM

Existing system is the present system, now all the processes are done manually. The
existing system is not computerized so it consists of so many limitations. Agriculture is the
backbone of Indian economy. The farmers in India are using new technology pesticides and
fertilizers but using old style of farming techniques. This actually gives adverse results like
poor harvest, polluted farming land etc., the main cause for this is lack of awareness about the
new farming techniques and precautions need to be taken. Suppose a farmer want to know the
details about the new crops and pesticides, then he wants to visit the experienced professors or
experienced farmer. This is a time-consuming process and require the travelling cost. If the
farmers want to express their suggestion only at the time of meeting.

2.2.1 DISADVANTAGES:

 Records are maintained and updated using pen and paper. Retrieving information from this
record is tedious and constrained.
 Time consuming process.
 User may cause unnecessary travelling cost.
 Lack of security of data

P G R M SN COLLEGE CHANNANIKADU 5
ANDROID APP FOR FARMERS

 Consume large volume of paper work.


 Transferring data is difficult.
 Information can be lost very easily.

2.3 PROPOSED SYSTEM

To overcome the drawback of the existing system, we need to develop an application for
farmers, which is more easily accessible to public. The system helps us to provide the valuable
time by providing correct information quickly. The system is GUI (graphical user interface)
based, so it is more user friendly. By using mobile phones farmers can access the weather
information and new government policy notifications. This project helps the crew who
conduct events in villages. In this Project we are providing an interface to the teams to store
their data in order to conduct awareness events efficiently. Through this project they can
prepare schedule for the events, data needed in the events like videos regarding crops,
PowerPoint presentation on seasonal crops and their related documents. So, our project is
suggested as a web application because so many teams around the India can be able to work on
this area. If any villager needs some suggestions and help, they will send the query. These
queries will be solved by experience professors.

The proposed system consists of four modules Admin, farmer, Agricultural officers, public.
The unregistered farmers can view the details about the crops, fertilizers. The registered
farmers can view and book for the crops and fertilizers. From the home page, user can select
the choice of item, on submission it will display details about the item. Farmer can view videos
regarding crops, PowerPoint presentation on seasonal crops and their related documents.
Admin has a password; by using this password he can login to the site, adding crop types, crop
class creation, fertilizers type and view the registered users and booking details. Agricultural
officer has a separate username and password and he has the permission to add pesticides,
crops, fertilizers type and details. The event that occurs based on the agriculture is add in to the
website is done by the officer. Also, he has the facility to add videos regarding crop.

P G R M SN COLLEGE CHANNANIKADU 6
ANDROID APP FOR FARMERS

PowerPoint representation on seasonal crops and their related documents. Agricultural officer
can view the suggestions or queries posted by the farmer and solve these suggestions.

2.3.1 THE ADVANTAGES OF THE PROPOSED SYSTEM.

 Accurate and secure.


 No redundancy
 Complete records are kept in database.
 Easy to access information.
 User friendliness and interactive.
 Travelling cost is reduced.
 It minimizes the manual data entry.

2.4 FEASIBILITY STUDY

All projects are feasible when given unlimited resources and infinite time. It is both
necessary and prudent to evaluate the feasibility of a project at the earliest possible time. An
estimate is made of whether the identified user needs may be satisfied using current software
and hardware technologies. The study will decide if the proposed system will be cost effective
from the business point of view and if it can be developed in the given existing budgetary
constraints. The feasibility study should be relatively cheap and quick. The result should inform
the decision of whether to go ahead with a more detailed analysis.

The feasibility study is done in these phases.

Operational feasibility

Technical feasibility

Economic feasibility.

P G R M SN COLLEGE CHANNANIKADU 7
ANDROID APP FOR FARMERS

2.4.1 TECHNICAL FEASIBILITY


Technical feasibility study deals with the hardware as well as software requirements. The
scope was whether the work for the project is done with the current equipment’s and the
existing software technology. Our system requires higher software requirements such as PHP,
MYSQL, windows 7 or higher OS. Since these are all available, this system is technically
feasible.

2.4.2 ECONOMIC FEASIBILITY


The purpose of the economic feasibility assessment is to determine the positive economic
benefits to the organization the at the proposed system will provide.

Our system is economically feasible since it provides benefits to the organization. It is


cost effective.

2.4.3 OPERATIONAL FEASIBILITY

The purpose of the operational feasibility study is to determine whether the new system
will be used if it is developed and implemented.

Our system will operate after it is developed and be operative once it is installed. The
system is opera table by the user easily. Thus, this system is operationally feasible.

P G R M SN COLLEGE CHANNANIKADU 8
ANDROID APP FOR FARMERS

CHAPTER 3

P G R M SN COLLEGE CHANNANIKADU 9
ANDROID APP FOR FARMERS

CHAPTER 3

SYSTEM REQUIREMNT SPECIFICATION

3.1 HARDWARE SPECIFICATION

The selection of hardware is very important in the existence and proper working of any
software. Then selection hardware, the size and capacity requirements are also important.

 Processor : Intel Pentium Core i3 and above


 Primary Memory : 1 GB RAM and above
 Storage : 40 GB hard disk and above
 Display : VGA Colour Monitor
 Key Board : Windows compatible
 Mouse : Windows compatible

3.2 SOFTWARE SPECIFICATION

One of the most difficult tasks is selecting software for the system, once the system
requirements is found out then we have to determine whether a particular software package fits
for those system requirements. The application requirement:

 Front end : C#
 Back end : SQL server 2008
 Operating system : windows 7 and above
 IDE : Visual studio 2010

3.2.1 TECHNOLOGIES

 Coding : C#
 Design : CSS
 Connection : ADO .N

P G R M SN COLLEGE CHANNANIKADU 10
ANDROID APP FOR FARMERS

3.3 SELECTION OF SOFTWARE

A general set of engineering characteristics for a programming language can


be established. They include ease of translation from design to code, computer
efficiency, source code portability, availability of development tools and
maintainability. The art of choosing a language is to start with the problem, decide
what it requires and their relative importance since it will probably be impossible to
satisfy all of them equally. Available languages should be measured against a lot of
requirements.

The criteria that are applied during an evaluation of available languages are:

• General Application Area

• Environment in which software will execute

• Performance consideration

• Data structure complexity

All the above requirements are considered while choosing the programming
language for the project inventory control system.

3.4 ANDROID

Android is a mobile operating system developed by Google, based on the


Linux kernel and designed primarily for touchscreen mobile devices such as
smartphones and tablets. Android's user interface is mainly based on direct
manipulation, using touch gestures that loosely correspond to real-world actions,
such as swiping, tapping and pinching, to manipulate on-screen objects, along with a
virtual keyboard for text input. In addition to touchscreen devices, Google has further
developed Android TV for televisions, Android Auto for cars, and Android Wear for
wrist watches, each with a specialized user interface. Variants of Android are also
used on game consoles, digital cameras, PCs and other electronics. Initially
developed by Android Inc., which Google bought in 2005, Android was unveiled in
2007, along with the founding of the Open Handset Alliance – a consortium of

P G R M SN COLLEGE CHANNANIKADU 11
ANDROID APP FOR FARMERS

hardware, software, and telecommunication companies devoted to advancing open


standards for mobile devices. Beginning with the first commercial Android device in
September 2008, the operating system has gone through multiple major releases, with
the current version being 8.0 "Oreo", released in August 2017. Android applications
("apps") can be downloaded from the Google Play store, which features over 2.7
million apps as of February 2017. Android has been the best-selling OS on tablets
since 2013, and runs on the vast majority of smartphones. As of May 2017, Android
has two billion monthly active users, and it has the largest installed base of any
operating system. Android's source code is released by Google under an open source
license, although most Android devices ultimately ship with a combination of free
and open source and proprietary software, including proprietary software required for
accessing Google services. Android is popular with technology companies that
require a ready-made, low-cost and customizable operating system for high-tech
devices. Its open nature has encouraged a large community of developers and
enthusiasts to use the open-source code as a foundation for community-driven
projects, which deliver updates to older devices, add new features for advanced users
or bring Android to devices originally shipped with other operating systems. The
extensive variation of hardware in Android devices causes significant delays for
software upgrades, with new versions of the operating system and security patches
typically taking months before reaching consumers, or sometimes not at all. The
success of Android has made it a target for patent and copyright litigation between
technology companies.

3.5 PYTHON

Python is a widely used high-level programming language for general-purpose


programming, created by Guido van Rossum and first released in 1991. An
interpreted language, Python has a design philosophy that emphasizes code
readability (notably using whitespace indentation to delimit code blocks rather than
curly brackets or keywords), and a syntax that allows programmers to express
concepts in fewer lines of code than might be used in languages such as C++ or Java.

P G R M SN COLLEGE CHANNANIKADU 12
ANDROID APP FOR FARMERS

The language provides constructs intended to enable writing clear programs on both
a small and large scale. Python features a dynamic type system and automatic
memory management and supports multiple programming paradigms, including
object-oriented, imperative, functional programming, and procedural styles. It has a
large and comprehensive standard library. Python interpreters are available for many
operating systems, allowing Python code to run on a wide variety of systems. Python,
the reference implementation of Python, is open-source software and has a
community-based development model, as do nearly all of its variant
implementations. C Python is managed by the non-profit Python Software
Foundation. Python is a multi-paradigm programming language: object-oriented
programming and structured programming are fully supported, and many language
features support functional programming and aspect-oriented programming
(including by meta-programming and meta-objects (magic methods)). Many other
paradigms are supported via extensions, including design by contract and logic
programming. Python uses dynamic typing and a mix of reference counting and a
cycle-detecting garbage collector for memory management. An important feature of
Python is dynamic name resolution (late binding), which binds method and variable
names during program execution. The design of Python offers some support for
functional programming in the Lisp tradition. The language has filter(), map(), and
reduce() functions; list comprehensions, dictionaries, and sets; and generator
expressions. The standard library has two modules (iteration tools and function tools)
that implement functional tools borrowed from Haskell and Standard ML.

3.6 SQL DATABASE

Microsoft SQL Server is a relational database management system developed by


Microsoft. As a database server, it is a software product with the primary function of
storing and retrieving data as requested by other software applications—which may
run either on the same computer or on another computer across a network (including
the Internet). Microsoft markets at least a dozen different editions of Microsoft SQL
Server, aimed at different audiences and for workloads ranging from small single-

P G R M SN COLLEGE CHANNANIKADU 13
ANDROID APP FOR FARMERS

machine applications to large Internet-facing applications with many concurrent


users.

Structured Query Language is a domain-specific language used in programming and


designed for managing data held in a relational database management system
(RDBMS), or for stream processing in a relational data stream management system
(RDSMS).

Originally based upon relational algebra and tuple relational calculus, SQL consists
of a data definition language, data manipulation language, and data control language.
The scope of SQL includes data insert, query, update and delete, schema creation and
modification, and data access control. Although SQL is often described as, and to a
great extent is, a declarative language (4GL), it also includes procedural elements.

SQL was one of the first commercial languages for Edgar F. Codd'srelational model,
as described in his influential 1970 paper, "A Relational Model of Data for Large
Shared Data Banks". Despite not entirely adhering to the relational model as
described by Codd, it became the most widely used database language.

SQL became a standard of the American National Standards Institute (ANSI) in


1986, and of the International Organization for Standardization (ISO) in 1987. Since
then, the standard has been revised to include a larger set of features. Despite the
existence of such standards, most SQL code is not completely portable among
different database systems without adjustments.

P G R M SN COLLEGE CHANNANIKADU 14
ANDROID APP FOR FARMERS

CHAPTER 4

P G R M SN COLLEGE CHANNANIKADU 15
ANDROID APP FOR FARMERS

CHAPTER 4

SYSTEM DEVELOPMENT
4.1 System Development

System design involves translating information requirements and conceptual


design into technical specification and general flow of processing. After the user
requirements are identified, related information is gathered to verify the problem and
after evaluating the existing system, a new system is proposed. The proposed system
consists of various tables, their maintenance and report generation.

For the Design of “ANDROID APP FOR FARMERS” care has been given
for developing an efficient system, which is user friendly as well as high in
performance. It has been assured that the system will have the functions and promises
of the proposed system. In the design, the various techniques are used to present a
simple efficient system. Design phase acts as a bridge between the software
requirement specification and the implementation phase, which satisfies the
requirements.

The data flow diagrams explicitly specify the process flow. Table design or
database design is the next major step. Extreme care has to be given here and several
concepts of normalization have to be applied at many levels. The major step in design
is the preparation of input forms and the design of all the major output forms in a
manner acceptable to the user in all aspects. The base lies in the complete
understanding of the system. Program specification comes next. Here we specify
various aspects of the program and also will explain in detail the major components
used in the program. The overall process flow is also explained in much detail.
Validation rules and checks come next. Several degrees of validation have to be
applied to all inputs and various other operations made on the system.
Deviation, if any, has to be checked from these validation rules. Imposing the “not
null” constraint is one of the best examples. It has been used in many aspects.

P G R M SN COLLEGE CHANNANIKADU 16
ANDROID APP FOR FARMERS

Various other constraints are also used. Security checks refer to avoiding
unnecessary access to data that is under use and guarding data from any malice.

4.2 TABLE DESIGN

A table design can be defined as a representation of an information system in


a computer. The general theme behind a database is to handle information as an
integrated whole. A database is a collection of interrelated data stored with minimum
redundancy to serve many users quickly and effectively. The general objective is to
make information access easy, quick, inexpensive and flexible for the user. In
database design, several specific objectives are considered:

• Controlled Redundancy.

• Ease of Learning and Use

• Data Independence

• More information at Low Cost. Accuracy and Integrity.

• Privacy and Security. Recovery and Failure


• Performance
Proposed system has a data base design which satisfies these objectives.
Information in the data base is easy accessible and flexible to users. Data stored in
various tables are accurate, secure and integrated.

4.3 INPUT DESIGN

Input design is a part of overall system design, which requires very careful
attention. The designer has a number of clear objectives in input design

• To produce a cost-effective method of input.

• To achieve the highest possible level of accuracy.

• To ensure that the input is acceptable and is understood by the user.

P G R M SN COLLEGE CHANNANIKADU 17
ANDROID APP FOR FARMERS

Input design is the link that ties information system into the world of its users.
Input design is the process of converting user-oriented input to a computer-based
format. It also includes determining the record media, method of input speed of
capture and entry into the system. Input data are collected and organized into groups
of similar data.

The design for handling input specifies how data are accepted for computer
processing. Input design is a part of overall system design that needs careful attention.
The collection of input data is considered to be the most expensive part of the system
design. Since the inputs have to be planned in such a manner so as to get the relevant
information extreme care is taken to obtain the information. The goal of designing
input data is to make data entry as easy, logical and face from errors as possible .

Input design in the system is done in such a way that no corrupted data is
entered into database. If the data going into the system is incorrect then the processing
and outputs will magnify these errors. Proper validation tools have used to avoid data
corruption. Validation controls verifies whether required field are entered or not. It
also verifies that character data is entered in the space of a numeric data. It also
verifies data in a defined format such as email address. Input design is done in such
a way that user may not have any doubt in using the system.

4.4 OUTPUT DESIGN

Outputs from computer systems are required primarily to communicate the


result of processing to users. They are also used to provide a permanent copy of these
results for later consultation. The output design is the process where the inputs are
processed so as to get the information such that the concerned authorities can take
the various decisions regarding the various outputs generated. The approach to output
design is very dependent on the type of output data. Once the output medium has
been chosen, detailed specification of the output document can be carried .

P G R M SN COLLEGE CHANNANIKADU 18
ANDROID APP FOR FARMERS

Computer output is the most important and direct source of information to the
user. Efficient, intelligible output design should improve the systems relationships
with the user and help in decision making. A major form of output is hard copy from
the printer. Printouts should be designed around the output requirements of the user.

Designing computer output should proceed in an organized well thought out


manner. The right must be developed while entering that each output element is
designed so that people will find the system easy to use effectively. Output design
generally deals with the results generated by the system i.e., reports, these reports can
be generated from stored or calculated values.

4.5 DATAFLOW DIAGRAM

Data Flow Diagrams represent one of the most ingenious tools used for
structured analysis. A Data Flow Diagram or DFD as it is shortly called is also known
as a bubble chart. It has the purpose of clarifying system requirements and identifying
major transformations that will become programs in system design. It is the major
starting point in the design phase that functionally decomposes the requirements
specifications down to the lowest level of detail. A DFD consists of a series of
bubbles joined by lines. The bubble represents data transformation and lines represent
data flow in the system. In the normal convention a DFD has four major symbols.

Square this defines source or destination of data

An arrow identifies dataflow-data in motion. It is a


pipeline through which information flows

P G R M SN COLLEGE CHANNANIKADU 19
ANDROID APP FOR FARMERS

A circle or bubble represents a process that transforms


incoming and outgoing data flows

An open rectangle is a data store-data at


reset or a temporary data

An open rectangle with a bar represents


a data store which is repeatedly referenced

P G R M SN COLLEGE CHANNANIKADU 20
ANDROID APP FOR FARMERS

CHAPTER 5

P G R M SN COLLEGE CHANNANIKADU 21
ANDROID APP FOR FARMERS

CHAPTER 5

SYSTEM TESTING AND IMPLEMENTATION

5.1 SYSTEM TESTING

System testing is the stage of implementation, which is aimed at ensuring that


the system works accurately and efficiently before live operation commences. Testing
is the process of executing the program with the intent of finding errors and missing
operations and also a complete verification to determine whether the objectives are
met and the user requirements are satisfied. The ultimate aim is quality assurance.

Tests are carried out and the results are compared with the expected document.
In the case of erroneous results, debugging is done. Using detailed testing strategies,
a test plan is carried out on each module

5.1.1 UNIT TESTING

The software units in a system are modules and routines that are assembled and
integrated to perform a specific function. Unit testing focuses first on modules,
independently of one another, to locate errors. This enables, to detect errors in coding
and logic that are contained within each module. This testing includes entering data
and ascertaining if the value matches to the type and size. The various controls are
tested to ensure that each performs its action as required. The goal of unit testing is to
isolate each part of the program and show that the individual parts are correct. A unit
test provides a strict, written contract that the piece of code must satisfy. As a result,
it affords several benefits. Unit testing allows the programmer to refractor code at a
later date, and make sure the module still works correctly The procedure is to write
test cases for all functions and methods so that whenever a change causes a fault, it
can be quickly identified and fixed.

P G R M SN COLLEGE CHANNANIKADU 22
ANDROID APP FOR FARMERS

5.1.2 INTEGRATION TESTING

Data can be lost across any interface; one module can have an adverse effect on

another, sub functions when combined, may not produce the desired major functions.
Integration testing is a systematic testing to discover errors associated within the
interface. The objective is to take unit tested modules and build a program structure.
All the modules are combined and tested as a whole. Here the Server module and
Client module options are integrated and tested. This testing provides the assurance
that the application is well integrated functional unit with smooth transition of data.
Integration testing takes as its input modules that have been unit tested, groups them
in larger aggregates, applies tests defined in an integration test plan to those
aggregates, and delivers as its output the integrated system ready for system testing.
The purpose of integration testing is to verify functional, performance and reliability
requirements placed on major design items. These design items, i.e. assemblages
groups are exercised through their interfaces using black box testing, success and error
cases being simulated via appropriate parameter and data inputs. Simulated usage of
shared data areas and inter-process communication is tested and individual subsystems
are exercised through their input interface. Test cases are constructed to test that all
components within assemblages interact correctly, for example across procedure calls
or process activations, and this is done after testing individual modules, i.e. unit testing

5.1.3 VALIDATION TESTING

For each input forms validation testing are done to ensure that only allowed
values will be entered. Entering incorrect values does the validation testing and
it is checked whether the errors are being considered. Incorrect values are to be
discarded. The errors are rectified.

5.1.4 SYSTEM TESTING

System testing was performed to verify that all system elements have been
proper integrated and perform allocated function. Security testing was done to

P G R M SN COLLEGE CHANNANIKADU 23
ANDROID APP FOR FARMERS

check the security mechanisms built into the system, which will protect it from
improper penetration, performance testing was done to test the runtime
performance of the software.

For user acceptance testing the system was given to the end user to use.

5.1.5 OUTPUT TESTING

After performing the validation testing, the next step is the output testing of
the enhanced system. No system could be useful if it does not produce the
required output in the required format. The outputs generated or the displayed
by the system are tested by asking the users about the format required by them.

5.1.6 USER ACCEPTANCE TESTING

User acceptance testing comprises a completed and successful end-to-end


system test with review of the results by one or more users with specific
knowledge. Users may apply a variety of validation techniques. For example:
generate a report from the new system and compare the results with the same
report from the current system, data inspection and others.

Prior to this testing the system was delivered to the clients along with the
steps for implementation. In user acceptance testing the system was run in the
client environment by system users. The users were allowed to test the system
and raise any issues for a specific period after the system is assumed to be
complete and error free.

P G R M SN COLLEGE CHANNANIKADU 24
ANDROID APP FOR FARMERS

5.2 SYSTEM IMPLEMENTATION

Implementation is the stage of the project when the theoretical design is


turned into a working system. The implementation stage is a systems project in its own
right. It includes careful planning, investigation of the current system and its
constraints on implementation, design of methods to achieve the changeover, training

of the staff in the changeover procedure and evaluation of changeover method.

The first task in implementation is planning-deciding on the methods and time-


scale to be adopted. Once the planning has been completed, the major efforts are to
ensure that the programs in the system are working properly. At the same time
concentrate on training the staff. When the staff has been trained, the complete system,
involving both computer and user can be executed effectively.

Depending upon the nature of the system, extensive user training may be
required. Programming itself is a design work. The initial parameters of the
management information system should be modified as a result of programming
efforts; programming provides a reality test for the assumptions made by the analyst.

The implementation of a system involves people from different sections and


systems analysts are confronted with the practical problem of controlling activities of
people outside their own data processing sections. Prior to this point in the project,
system analyst has interviewed staff’s different sections with the permission of their
respective mangers but the implementation phase involves the staff of user
departments carrying out specific task, which require supervision and control to
critical schedules. Some of these problems may also need to be employed on the task
of implementation in addition to their own present departmental tasks.

P G R M SN COLLEGE CHANNANIKADU 25
ANDROID APP FOR FARMERS

EDUCATION AND TRAINING


To achieve the objective and benefits expected from computer based, it is
essential for the people who will be involved to be confident of their role in the new
system. This involves them in understanding the overall system and its effect on the
organization and in being able to carry out effectively their specific task. As systems
become more complex, the need for education and training is more and more
important.

The implementation of new system involves people successful


implementation depends upon the right people at the right place at the right time.
Planning networks and charts can show the number and type of people required at
the place and the time, but successful implementation requires staff selection and
training for that part of the system or which the staff will be responsible. Trained
personal will be needed as soon as the implementation activities begin, or training
must begin before that stage. Selection for training must take place at an early stage.
Broad estimate of the numbers and types of people required should be submitted to
the management for approval. Then, as development proceeds, these estimates will
be progressively improved. The managers of the departments concerned, both user
and operations, defined type and quality of people required for implementation and
operation of the new system, with advice from the project team. In large organization
the personal manager will naturally also become involved.

Training requirements are easy to determine. They arise from the changes that
the systems analyst is bringing about. User managers must inform of how the whole
system works its objective, new documentation, files and procedures. These
requirements will be setout in principle in the user system specification. Thus the
new system can be explained to the user management and new tasks specified in job
specification, with the analysis on hand to answer and queries which may arise.

POST IMPLEMENTATION REVIEW


After the system is implemented and conversion is complete, a review
should be conducted to determine whether the system is meaning expectation and

P G R M SN COLLEGE CHANNANIKADU 26
ANDROID APP FOR FARMERS

where improvements are needed. A post implementation review measures the system
performance against predefined requirements. it determines how well the system
continues to meet performance specification. It also provides information to
determine whether major redesign or modification is required. A post-
implementation review is an evaluation of a system in terms of the extent to which
the system accomplishes stated objectives and actual project costs exceed initial
estimates. It is usually a review of major problems that need converting and those
that surfaced during the implementation phase. The post implementation study
begins with the review team, which gathers and reviewers requests for evaluation.
Unexpected change in the system that affects the user or system performance is a
primary factor that prompts system review. Once request is filed, the user is asked
how well the system is functioning to specifications or how well the measured
benefits have been realized. Suggestions regarding changes and improvements are
also asked.

Review Plan

• The review team prepares a formal review plan around the objectives of the
review, the type of evaluation to be carried out and the time schedule required. An
overall plan covers the following areas:

• Administrative plan:

Review area objectives, operating costs actual operating performance and benefits.

• Personal requirements plan:

Review performance objectives and training performance to data.

• Hardware plan:

Review performance specification.

• Documentation review plan:

P G R M SN COLLEGE CHANNANIKADU 27
ANDROID APP FOR FARMERS

Review the system development effort.

• Approaches to software evaluation


• For software evaluation following approaches have been discussed:

• Bench marking:

Benchmark is nothing but a sample program specially required to evaluate the


comparative performance of hardware or software.

• Experience of other users:

• Vendors generally give a list of users who are satisfied with their work. But
it is advisable to seek the opinion independently from the existing users whose
configuration and operational environment is closely identical.

• Report of independent research organization:

Now-a-days many research organizations undertake project of evaluating the


proprietary software offered by various software agencies. These evaluations are
objective and comprehensive in nature. They publish the report at regular interval.
The prospective buyer of a software package can have faith in their evaluation.

P G R M SN COLLEGE CHANNANIKADU 28
ANDROID APP FOR FARMERS

CHAPTER 6

P G R M SN COLLEGE CHANNANIKADU 29
ANDROID APP FOR FARMERS

CHAPTER 6

SYSTEM MAINTENANCE AND FUTURE ENHANCEMENT

6.1 SYSTEM MAINTENANCE


Software maintenance is the process of modifying a software system or
component after its delivery in order to correct faults, improve the performance
and other attributes, or to adapt to the changed environment. maintenance covers
a wide range of activities including correcting the error and design coding,
updating the documentation and test data, and upgrading the user hardware and
software. maintenance is always necessary to keep the software usable and
useful. hardware also requires periodic maintenance to keep the system into its
standards. after installation is completed and user start is adjusted to the changes
created by the candidate system.

6.2 FUTURE ENHANCEMENT

The project “ANDROID APP FOR FARMERS” is designed for any future
addition so that any user requirements can be made easy. Though the system is working on
certain assumptions it can be modified easily to any kind of requirements.
New features can be added to the software to ensure the credibility of the software.
Features like,
• Finger print identification.
• Image recognition.

P G R M SN COLLEGE CHANNANIKADU 30
ANDROID APP FOR FARMERS

CHAPTER 7

P G R M SN COLLEGE CHANNANIKADU 31
ANDROID APP FOR FARMERS

CHAPTER 7

APPENDICS

7.1 TABLE DESIGN

Table 1
Table Name: Login
Field Name Data Type Description
Login_id Int Login id
User name varchar User Name
Password varchar Password
User type varchar Type of user

Table 2

Table Name: Agriculture Officers


Field Name Data Type Description
Officer_id int Officer id
Login_id int Login id
First_name varchar First Name
Last_name varchar Last Name
Phone varchar Phone
Email varchar Email

Table 3
Table Name: News
Field Name Data Type Description
News_id int News id
Title varchar Title
Description varchar Description
Date varchar Date

P G R M SN COLLEGE CHANNANIKADU 32
ANDROID APP FOR FARMERS

Table 4
Table Name:Dealers
Field Name Data Type Description
Dealer_id int Dealers id
Login_id int Login id
First_name varchar First Name
Last_name varchar Last Name
Qualifications varchar Qualification
Phone varchar Phone
Email varchar Email

Table 5
Table Name: Crop Types
Field Name Data Type Description
Type_id Int Type id
Type_name varchar Type Name
Type_description varchar Type Description

Table 6
Table Name: Fertilisers
Field Name Data Type Description
Fertiliser_id Int Fertiliser id
Fertiliser_name varchar Fertiliser Name
Description varchar Description
Features varchar Features

P G R M SN COLLEGE CHANNANIKADU 33
ANDROID APP FOR FARMERS

Table 7

Table Name:Farmers

Field Name Data Type Description


Farmer int Farmer id
Login_id int Login id
First_Name varchar First Name
Last_Name varchar Last Name
Place varchar Place
Pin code varchar Pin code
Gender varchar Gender
DOB varchar Date of birth
Phone varchar Phone
Email varchar Email
Latitude varchar Latitude
Longitude varchar Longitude

Table 8
Table Name: Users
Field Name Data Type Description
User_id Int User id
Login_id Int Login id
First_name varchar First name
Last_name varchar Last name
Latitude varchar Latitude
Longitude varchar Longitude
Phone varchar Phone
Email varchar Email
House_name varchar House name
Place varchar Place
Pin code varchar Pin code
District varchar District

P G R M SN COLLEGE CHANNANIKADU 34
ANDROID APP FOR FARMERS

Table 9
Table Name: Complaint
Field Name Data Type Description
Complaint_id int Complaint id
User_id int User id
Complaint varchar Complaint
Reply varchar Reply
Date varchar Date

Table 10
Table Name: Tutorials
Field Name Data Type Description
Tutorial_id Int Tutorial id
Officer_id Int Officer id
Title varchar Title
Description varchar Description
File_path varchar File path
File_name varchar File name

Table 11
Table Name: Enquiry
Field Name Data Type Description
Enquiry_id Int Enquiry id
Farmer_id Int Farmer id
Description varchar Description
Reply varchar Reply
Date varchar Date

P G R M SN COLLEGE CHANNANIKADU 35
ANDROID APP FOR FARMERS

Table 12
Table Name: Farmers Crops

Field Name Date Type Description


Crop_id Int Crop id
Type_id Int Type id
Crop_name varchar Crop Name
Availability varchar Availability
Description varchar Description
Image varchar Image
Amount varchar Amount

Table 13
Table Name: Order Master
Field Name Data Type Description
OM_id Int Order Master id
Date varchar Date
User_id Int User id
Total_amount varchar Total Amount
Order_status varchar Oder Status

Table 14
Table Name: Oder Details
Field Name Data Type Description
OD_id int Oder Details id
OM_id int Oder Master id
Crop_id int Crop id
Quantity varchar Quantity
Amount varchar Amount

P G R M SN COLLEGE CHANNANIKADU 36
ANDROID APP FOR FARMERS

Table 15
Table Name: Payment
Field Name Data Type Description
Payment_id Int Payment id
Om_id Int Oder Master
Amount varchar Amount
Pay_date varchar Pay date

Table 16
Table Name: Message

Field Name Date Type Description


Message_id Int Message id
Sender_id Int Sender id
Receiver_id Int Receiver id
Message varchar Message
Date varchar Date

P G R M SN COLLEGE CHANNANIKADU 37
ANDROID APP FOR FARMERS

7.2 DATA FLOW DIAGRAMS

7.2.1 LEVEL 0 DFD

Admin
Dealers

Agriculture Officers Farmers App Farmers

Public Users

P G R M SN COLLEGE CHANNANIKADU 38
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 39
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 40
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 41
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 42
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 43
ANDROID APP FOR FARMERS

7.3 SCREEN LAYOUT

P G R M SN COLLEGE CHANNANIKADU 44
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 45
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 46
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 47
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 48
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 49
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 50
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 51
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 52
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 53
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 54
ANDROID APP FOR FARMERS

P G R M SN COLLEGE CHANNANIKADU 55
ANDROID APP FOR FARMERS

7.4 PROGRAM CODE

Home Page Html

ead>

<title>Farmer's App</title>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<link
href="https://fonts.googleapis.com/css?family=Poppins:200,300,400,500,600,700,800&displ
ay=swap" rel="stylesheet">

<link
href="https://fonts.googleapis.com/css?family=Lora:400,400i,700,700i&display=swap"
rel="stylesheet">

<link href="https://fonts.googleapis.com/css?family=Amatic+SC:400,700&display=swap"
rel="stylesheet">

<link rel="stylesheet" href="/static/css/open-iconic-bootstrap.min.css">

<link rel="stylesheet" href="/static/css/animate.css">

<link rel="stylesheet" href="/static/css/owl.carousel.min.css">

<link rel="stylesheet" href="/static/css/owl.theme.default.min.css">

<link rel="stylesheet" href="/static/css/magnific-popup.css">

P G R M SN COLLEGE CHANNANIKADU 56
ANDROID APP FOR FARMERS

<link rel="stylesheet" href="/static/css/aos.css">

<link rel="stylesheet" href="/static/css/ionicons.min.css">

<link rel="stylesheet" href="/static/css/bootstrap-datepicker.css">

<link rel="stylesheet" href="/static/css/jquery.timepicker.css"

<link rel="stylesheet" href="/static/css/flaticon.css">

<link rel="stylesheet" href="/static/css/icomoon.css">

<link rel="stylesheet" href="/static/css/style.css">

</head>

<body class="goto-here">

<div class="py-1 bg-primary">

<div class="container">

<div class="row no-gutters d-flex align-items-start align-items-center px-md-


0">

<div class="col-lg-12 d-block">

<div class="row d-flex">

<div class="col-md pr-4 d-flex topper align-items-


center">

<div class="icon mr-2 d-flex justify-content-center align-items-center"><span


class="icon-phone2"></span></div>

<span class="text">+91 7685465478</span>

P G R M SN COLLEGE CHANNANIKADU 57
ANDROID APP FOR FARMERS

</div>

<div class="col-md pr-4 d-flex topper align-items-


center">

<div class="icon mr-2 d-flex justify-content-


center align-items-center"><span class="icon-paper-plane"></span></div>

<span
class="text">youremail@email.com</span>

</div>

<div class="col-md-5 pr-4 d-flex topper align-items-


center text-lg-right">

<span class="text">Helping to make a better


life.</span>

</div>

</div>

</div>

</div>

</div>

</div>

<nav class="navbar navbar-expand-lg navbar-dark ftco_navbar bg-dark ftco-navbar-light"


id="ftco-navbar">

P G R M SN COLLEGE CHANNANIKADU 58
ANDROID APP FOR FARMERS

<div class="container">

<a class="navbar-brand" href="admin_home">Farmer's App</a>

<button class="navbar-toggler" type="button" data-toggle="collapse" data-


target="#ftco-nav" aria-controls="ftco-nav" aria-expanded="false" aria-label="Toggle
navigation">

<span class="oi oi-menu"></span> Menu

</button>

<div class="collapse navbar-collapse" id="ftco-nav">

<ul class="navbar-nav ml-auto">

<li class="nav-item active"><a href="admin_home" class="nav-


link">Home</a></li>

<li class="nav-item dropdown">

<a class="nav-link dropdown-toggle" href="#" id="dropdown04" data-

toggle="dropdown" aria-haspopup="true" aria-expanded="false">Manage pages</a>

<div class="dropdown-menu" aria-labelledby="dropdown04">

<!-- <a href="admin_manageagriofficer">Manage Agricultural Officers</a><br> -->

<a href="admin_managenews">Manage News and Notifications</a><br>

<a href="admin_managecrops">Manage Crops</a><br>

P G R M SN COLLEGE CHANNANIKADU 59
ANDROID APP FOR FARMERS

<a href="admin_manage_tutorials">Manage Tutorials</a><br>

<a href="admin_managefertilizers">Manage Fertilizers</a><br>

</div>

<li class="nav-item"><a href="admin_viewfarmers" class="nav-link">View


Farmers</a></li>

<!-- <li class="nav-item"><a href="admin_view_dealers" class="nav-


link">View Dealers</a></li> -->

<li class="nav-item"><a href="admin_viewcomplaint" class="nav-link">View


Complaints</a></li>

<li class="nav-item"><a href="/" class="nav-link">Logout</a></li>

</ul>

</div>

</div>

</nav>

<!-- END nav -->

<section id="home-section" class="hero">

<div class="home-slider owl-carousel">

P G R M SN COLLEGE CHANNANIKADU 60
ANDROID APP FOR FARMERS

<div class="slider-item" style="background-image:

url(/static/images/Farmer.jpg);">

<div class="overlay"></div>

<div class="container">

<div class="row slider-text justify-content-center align-items-center" data-


scrollax-parent="true">

<div class="col-md-12 ftco-animate text-center">

<h1 class="mb-2">Welcome Administrator</h1>

<h2 class="subheading mb-4">Manage Everything Here</h2>

</div>

</div>

</div>

</div>

</div>

</section>

{% include 'footer.html' %}

P G R M SN COLLEGE CHANNANIKADU 61
ANDROID APP FOR FARMERS

Login Page Html

{% include 'public_header.html' %}

<br><br><br>

<form method="POST" enctype="multipart/form-data">

<h2 align="center">LOGIN</h2>

<table align="center" class="table" style="width :50px; border-radius: 15px">

<tr>

<td>

<input type="text" name="username" class="form-


control" placeholder="Enter Username" style="border-radius: 15px">

</td>

</tr>

<tr>

<td>

<input type="password" name="password"


class="form-control" placeholder="Enter Password" style="border-radius: 15px">

</td>

</tr>

<tr>

P G R M SN COLLEGE CHANNANIKADU 62
ANDROID APP FOR FARMERS

<td align="center" colspan="2">

<input type="submit" name="submit" value="Login"


class="btn btn-success">

</td>

</tr>

</table>

</form><br><br>

{% include 'footer.html')

Agriofficer Home Html

{% include 'agriofficer_header.html' %}

<h1 align="center"><b><i>Welcome Officer</i></b></h1>

{% include 'footer.html' %}

P G R M SN COLLEGE CHANNANIKADU 63
ANDROID APP FOR FARMERS

User Registration Html

% include 'public_header.html' %}

<br><br><br>

<form method="POST" enctype="multipart/form-data">

<h2 align="center">Public User Registration </h2>

<table align="center" class="table" style="width :50px; border-radius: 15px">

<tr>

<td>First Name</td>

<td>

<input type="text" name="fname" class="form-control"


style="border-radius: 15px">

</td>

</tr>

<tr>

<td>Last Name </td>

<td>

<input type="text" name="lname" class="form-control" style="border-radius: 15px">

</td>

P G R M SN COLLEGE CHANNANIKADU 64
ANDROID APP FOR FARMERS

</tr>

<tr>

<td>House Name</td>

<td>

<input type="text" name="hname" class="form-


control" style="border-radius: 15px">

</td>

</tr>

<tr>

<td>Pincode</td>

<td>

<input type="number" name="pin" class="form-


control" style="border-radius: 15px">

</td>

</tr>

<tr>

<td>Phone</td>

<td>

<input type="text" name="phone" class="form-control"


style="border-radius: 15px">

P G R M SN COLLEGE CHANNANIKADU 65
ANDROID APP FOR FARMERS

</td>

</tr>

<tr>

<td>Email</td>

<td>

<input type="email" name="email" class="form-


control" style="border-radius: 15px">

</td>

</tr>

<tr>

<td>Place</td>

<td>

<input type="text" name="place" class="form-control"


style="border-radius: 15px">

</td>

</tr>

<tr>

<td>Username</td>

<td>

P G R M SN COLLEGE CHANNANIKADU 66
ANDROID APP FOR FARMERS

<input type="text" name="uname" class="form-


control" style="border-radius: 15px">

</td>

</tr>

<tr>

<td>Password</td>

<td>

<input type="password" name="pass" class="form-


control" style="border-radius: 15px">

</td>

</tr>

<tr>

<td align="center" colspan="2">

<input type="submit" name="preg" value="Register"


class="btn btn-success">

</td>

</tr>

</table>

</form><br><br>

P G R M SN COLLEGE CHANNANIKADU 67
ANDROID APP FOR FARMERS

{% include 'footer.html' %

Dealers Home Html

% include 'dealers_header.html' %}

<h1>Dealers Home</h1>

{% include 'footer.html' %}

Admin Python

rom flask import *

from database import *

import uuid

admin=Blueprint('admin',__name__)

@admin.route('/admin_home',methods=['get','post'])

def admin_home():

return render_template('admin_home.html')

P G R M SN COLLEGE CHANNANIKADU 68
ANDROID APP FOR FARMERS

@admin.route('/admin_manageagriofficer',methods=['get','post'])

def admin_manageagriofficer():

data={}

if 'action' in request.args:

action=request.args['action']

id=request.args['id']

else:

action=None

print(action)

if action=="delete":

q="delete from login where login_id=(select login_id from agricultureofficers


where officer_id='%s')"%(id)

delete(q)

q="DELETE FROM `agricultureofficers` WHERE `officer_id`='%s'"%(id)

delete(q)

return redirect(url_for('admin.admin_manageagriofficer'))

if action=="update":

q="SELECT * FROM `agricultureofficers` WHERE `officer_id`='%s'"%(id)

res=select(q)

P G R M SN COLLEGE CHANNANIKADU 69
ANDROID APP FOR FARMERS

data['update_officer']=res

if 'usubmit' in request.form:

fname=request.form['ufirst_name']

lname=request.form['ulast_name']

phon=request.form['uphone']

mail=request.form['uemail']

q="UPDATE `agricultureofficers` SET


`first_name`='%s',`last_name`='%s',`phone`='%s',`email`='%s' WHERE
`officer_id`='%s'"%(fname,lname,phon,mail,id)

update(q)

return redirect(url_for('admin.admin_manageagriofficer'))

if "submit" in request.form:

fname=request.form['first_name']

lname=request.form['last_name']

uid=request.form['uid']

pas=request.form['pass']

phone=request.form['phone']

P G R M SN COLLEGE CHANNANIKADU 70
ANDROID APP FOR FARMERS

email=request.form['email']

latitude=request.form['latitude']

longitude=request.form['longitude']

q="INSERT INTO `login` VALUES(NULL,'%s','%s','ag_officer')"%(uid,pas)

ids=insert(q)

q="INSERT INTO `agricultureofficers`

VALUES(NULL,'%s','%s','%s','%s','%s','%s','%s')"%(ids,fname,lname,phone,email,latitude,l
ongitude)

insert(q)

return redirect(url_for('admin.admin_manageagriofficer'))

q="SELECT * FROM `agricultureofficers`"

res=select(q)

data['view_ag']=res

return render_template('admin_manageagriofficer.html',data=data)

@admin.route('/admin_managenews',methods=['get','post'])

P G R M SN COLLEGE CHANNANIKADU 71
ANDROID APP FOR FARMERS

def admin_managenews():

data={}

if 'action' in request.args:

action=request.args['action']

id=request.args['id']

else:

action=None

print(action)

if action=="delete":

q="DELETE FROM `news` WHERE`news_id`='%s'"%(id)

delete(q)

return redirect(url_for('admin.admin_managenews'))

if action=="update":

q="SELECT * FROM `news` WHERE `news_id`='%s'"%(id)

res2=select(q)

data['update_news']=res2

if 'usubmit' in request.form:

utitl=request.form['utitle']

P G R M SN COLLEGE CHANNANIKADU 72
ANDROID APP FOR FARMERS

udesc=request.form['udesc']

q="UPDATE `news` SET `title`='%s',`description`='%s',`date`=CURDATE()


where news_id='%s'"%(utitl,udesc,id)

update(q)

return redirect(url_for('admin.admin_managenews'))

if "submit" in request.form:

titl=request.form['title']

desc=request.form['desc']

q="INSERT INTO `news`


VALUES(NULL,'%s','%s',CURDATE())"%(titl,desc)

insert(q)

return redirect(url_for('admin.admin_managenews'))

q="SELECT * FROM `news`"

aqs=select(q)

data['view_news']=aqs

return render_template('admin_managenews.html',data=data)

P G R M SN COLLEGE CHANNANIKADU 73
ANDROID APP FOR FARMERS

@admin.route('/admin_managecrops',methods=['get','post'])

def admin_managecrops():

data={}

if 'action' in request.args:

action=request.args['action']

id=request.args['id']

else:

action=None

print(action)

if action=="delete":

q="DELETE FROM `croptype` WHERE `type_id`='%s'"%(id)

delete(q)

return redirect(url_for('admin.admin_managecrops'))

if action=="update":

q="SELECT * FROM `croptype` inner join soiltypes using(soil_type_id)


WHERE `type_id`='%s'"%(id)

res=select(q)

data['update_crops']=res

P G R M SN COLLEGE CHANNANIKADU 74
ANDROID APP FOR FARMERS

if 'usubmit' in request.form:

cname=request.form['ucname']

desc=request.form['udesc']

sid=request.form['usid']

q="UPDATE `croptype` SET


`type_name`='%s',`type_description`='%s',`soil_type_id`='%s' WHERE `type_id`='%s'"%
(cname,desc,sid,id)

update(q)

return redirect(url_for('admin.admin_managecrops'))

# q="SELECT * FROM `soiltypes`"

# res=select(q)

# data['view_soil']=res

if "submit" in request.form

cname=request.form['ucname']

desc=request.form['udesc']

# sid=request.form['usid']

q="INSERT INTO `croptype` VALUES(NULL,'%s','%s')"%(cname,desc)

insert(q)

P G R M SN COLLEGE CHANNANIKADU 75
ANDROID APP FOR FARMERS

return redirect(url_for('admin.admin_managecrops'))

# q="SELECT * FROM `croptype` inner join soiltypes using(soil_type_id)"

q="SELECT * FROM `croptype`"

aqs=select(q)

data['view_type']=aqs

return render_template('admin_managecrops.html',data=data)

@admin.route('/admin_managesoil',methods=['get','post'])

def admin_managesoil():

data={}

if 'action' in request.args:

action=request.args['action']

id=request.args['id']

else:

action=None

print(action)

if action=="delete":

P G R M SN COLLEGE CHANNANIKADU 76
ANDROID APP FOR FARMERS

q="DELETE FROM `soiltypes` WHERE `soil_type_id`='%s'"%(id)

delete(q)

return redirect(url_for('admin.admin_managesoil'))

if action=="update":

q="SELECT * FROM `soiltypes` WHERE `soil_type_id`='%s'"%(id)

res=select(q)

data['update_soil']=res

if 'usubmit' in request.form:

usname=request.form['usname']

q="UPDATE `soiltypes` SET `soil_type_name`='%s' WHERE


`soil_type_id`='%s'"%(usname,id)

update(q)

return redirect(url_for('admin.admin_managesoil'))

if "submit" in request.form:

sname=request.form['sname']

q="INSERT INTO `soiltypes` VALUES(NULL,'%s')"%(sname)

insert(q)

print(q)

return redirect(url_for('admin.admin_managesoil'))

P G R M SN COLLEGE CHANNANIKADU 77
ANDROID APP FOR FARMERS

q="SELECT * FROM `soiltypes`"

aqs=select(q)

data['view_soil']=aqs

return render_template('admin_managesoil.html',data=data)

@admin.route('/admin_managefertilizers',methods=['get','post'])

def admin_managefertilizers():

data={}

if 'action' in request.args:

action=request.args['action']

id=request.args['id']

else:

action=None

print(action)

if action=="delete":

q="DELETE FROM `fertilizers` WHERE `fertilizer_id`='%s'"%(id)

delete(q)

return redirect(url_for('admin.admin_managefertilizers'))

if action=="update":

P G R M SN COLLEGE CHANNANIKADU 78
ANDROID APP FOR FARMERS

q="SELECT * FROM `fertilizers` WHERE `fertilizer_id`='%s'"%(id)

res=select(q)

data['update_fert']=res

if 'usubmit' in request.form:

funam=request.form['ufname']

duesc=request.form['udesc']

fueat=request.form['ufeats']

q="UPDATE `fertilizers` SET

`fertilizer_name`='%s',`description`='%s',`features`='%s' WHERE

`fertilizer_id`='%s'"%(funam,duesc,fueat,id)

update(q)

return redirect(url_for('admin.admin_managefertilizers'))

if "submit" in request.form:

fnam=request.form['fname']

desc=request.form['desc']

feat=request.form['feats']

q="INSERT INTO `fertilizers`

P G R M SN COLLEGE CHANNANIKADU 79
ANDROID APP FOR FARMERS

VALUES(NULL,'%s','%s','%s')"%(fnam,desc,feat)

insert(q)

return redirect(url_for('admin.admin_managefertilizers'))

q="SELECT * FROM `fertilizers`"

aqs=select(q)

data['view_fertilizers']=aqs

return render_template('admin_managefertilizer.html',data=data)

@admin.route('/admin_viewfarmers',methods=['get','post'])

def admin_viewfarmers():

data={}

q="SELECT *,CONCAT(`first_name`,' ',`last_name`)AS NAME FROM `farmers`"

res=select(q)

data['view_vifa']=res

return render_template('admin_viewfarmers.html',data=data)

P G R M SN COLLEGE CHANNANIKADU 80
ANDROID APP FOR FARMERS

@admin.route('/admin_viewcomplaint',methods=['get','post'])

def admin_viewcomplaint():

data={}

q="SELECT * FROM `complaint`"

res=select(q)

data['view_vico']=res

j=0

for i in range(1,len(res)+1):

print('submit'+str(i))

if 'submit'+str(i) in request.form:

reply=request.form['reply'+str(i)]

print(reply)

print(j)

print(res[j]['complaint_id'])

q="update complaint set reply='%s' where complaint_id='%s'"

%(reply,res[j]['complaint_id'])

print(q)

P G R M SN COLLEGE CHANNANIKADU 81
ANDROID APP FOR FARMERS

update(q)

return redirect(url_for('admin.admin_viewcomplaint'))

j=j+1

return render_template('admin_viewcomplaint.html',data=data)

@admin.route('/admin_manage_tutorials',methods=['get','post'])

def admin_manage_tutorials():

data={}

if 'action' in request.args:

action=request.args['action']

id=request.args['id']

else:

action=None

print(action)

if action=="delete":

q="DELETE FROM `tutorials` WHERE `tutorial_id`='%s'"%(id)

delete(q)

return redirect(url_for('admin.admin_manage_tutorials'))

P G R M SN COLLEGE CHANNANIKADU 82
ANDROID APP FOR FARMERS

if action=="update":

q="SELECT * FROM `tutorials` WHERE `tutorial_id`='%s'"%(id)

res=select(q)

data['update_fert']=res

if 'usubmit' in request.form

tuitle=request.form['utitle']

duesc=request.form['udesc']

q="UPDATE `tutorials` SET `title`='%s',`description`='%s' WHERE


`tutorial_id`='%s'"%(tuitle,duesc,id)

update(q)

return redirect(url_for('admin.admin_manage_tutorials'))

if "submit" in request.form:

titl=request.form['title']

des=request.form['desc']

value=request.files['file1']

log_id=session['login_id']

P G R M SN COLLEGE CHANNANIKADU 83
ANDROID APP FOR FARMERS

print(log_id)

path='static/files/'+str(uuid.uuid4())+value.filename

value.save(path)

splitvalue=path.split('.')

print(splitvalue[1])

q="INSERT INTO `tutorials` VALUES(NULL,(SELECT `officer_id` FROM


`agricultureofficers` WHERE
`login_id`='%s'),'%s','%s','%s','%s')"%(log_id,titl,des,path,splitvalue[1])

insert(q)

return redirect(url_for('admin.admin_manage_tutorials'))

q="SELECT * FROM `tutorials`"

aqs=select(q)

data['view_tutorials']=aqs

return render_template('admin_manage_tutorials.html',data=data)

@admin.route('/admin_view_dealers',methods=['get','post'])

def admin_view_dealers():

P G R M SN COLLEGE CHANNANIKADU 84
ANDROID APP FOR FARMERS

data={}

q="select * from dealers"

res=select(q)

data['view_vifa']=res

return render_template('admin_view_dealers.html',data=data)

Public Python

rom flask import *

from database import *

public=Blueprint('public',__name__)

@public.route('/',methods=['get','post'])

def home():

return render_template('index.html')

@public.route('/login',methods=['get','post'])

def login():

P G R M SN COLLEGE CHANNANIKADU 85
ANDROID APP FOR FARMERS

if 'submit' in request.form:

uname=request.form['username']

pwd=request.form['password']

q="select * from login where username='%s' and


password='%s'"%(uname,pwd)

print(q)

res=select(q)

if res:

session['login_id']=res[0]['login_id']

if res[0]['usertype']=="admin":

return redirect(url_for('admin.admin_home'))

if res[0]['usertype']=="agriofficer":

return redirect(url_for('agriofficer.agriofficer_home'))

if res[0]['usertype']=="Public_user":

return redirect(url_for('user.user_home'))

if res[0]['usertype']=="dealers":

return redirect(url_for('dealers.dealers_home'))

return render_template('login.html')

@public.route('/dealer_registration',methods=['get','post'])

def dealer_registration():

P G R M SN COLLEGE CHANNANIKADU 86
ANDROID APP FOR FARMERS

if 'dreg' in request.form:

name=request.form['dname']

phone=request.form['phone']

email=request.form['email']

place=request.form['place']

uname=request.form['unam

e']

pasde=request.form['pass']

q="insert into login values(null,'%s','%s','dealers')"%(uname,pasde)

id=insert(q)

q="insert into dealers


values(null,'%s','%s','%s','%s','%s')"%(id,name,phone,email,place)

insert(q)

return render_template('dealer_registration.html'

@public.route('/public_user_registration',methods=['get','post'])

def public_user_registration():

if 'preg' in request.form:

P G R M SN COLLEGE CHANNANIKADU 87
ANDROID APP FOR FARMERS

fname=request.form['fname']

lname=request.form['lname']

hname=request.form['hname']

pin=request.form['pin']

phone=request.form['phone']

email=request.form['email']

place=request.form['place']

uname=request.form['uname']

psw=request.form['pass']

q="insert into login values(null,'%s','%s','Public_user')"%(uname,psw)

id=insert(q)

q="insert into public_user


values(null,'%s','%s','%s','%s','%s','%s','%s','%s')"%(id,fname,lname,hname,place,pin,phone,e
mail)

insert(q)

P G R M SN COLLEGE CHANNANIKADU 88
ANDROID APP FOR FARMERS

return render_template('public_user_registration.html')

Main.py

from flask import *

from public import public

from admin import admin

from agriofficer import agriofficer

from dealers import dealers

from api import api

app=Flask(__name__)

app.secret_key="qwd"

app.register_blueprint(public)

app.register_blueprint(admin,url_prefix='/admin')

app.register_blueprint(agriofficer,url_prefix='/agriofficer')

app.register_blueprint(dealers,url_prefix='/dealers')

P G R M SN COLLEGE CHANNANIKADU 89
ANDROID APP FOR FARMERS

app.register_blueprint(api,url_prefix='/api')

app.run(debug=True,port=5014,host="192.168.14.78")

P G R M SN COLLEGE CHANNANIKADU 90
ANDROID APP FOR FARMERS

CHAPTER 9

P G R M SN COLLEGE CHANNANIKADU 91
ANDROID APP FOR FARMERS

CHAPTER 9
BIBLOGRAPHY
8.1 Web Resources
• http://www.articles.techrepublic.com

• http://www.wikipedia.org

• http://www.exforsys.com
• http://www.google.com

8.2 Book References


• Mastering Visual C# .NET by Jason Price , TMH Publications
Microsoft SQL Server Black Book by Patrick Dalton, Prentic Hall Publications
• Software Engineering and Application by Rogger S. Pressman, TMH Publications.

P G R M SN COLLEGE CHANNANIKADU 92

You might also like