Professional Documents
Culture Documents
CHAPTER 1
P G R M SN COLLEGE CHANNANIKADU 1
ANDROID APP FOR FARMERS
CHAPTER 1
INTRODUCTION
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.1 Admin
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.3 Public
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
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.
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
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.
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.
Operational feasibility
Technical feasibility
Economic feasibility.
P G R M SN COLLEGE CHANNANIKADU 7
ANDROID APP FOR FARMERS
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
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.
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
The criteria that are applied during an evaluation of available languages are:
• Performance consideration
All the above requirements are considered while choosing the programming
language for the project inventory control system.
3.4 ANDROID
P G R M SN COLLEGE CHANNANIKADU 11
ANDROID APP FOR FARMERS
3.5 PYTHON
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.
P G R M SN COLLEGE CHANNANIKADU 13
ANDROID APP FOR FARMERS
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.
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
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.
• Controlled Redundancy.
• Data Independence
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
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.
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.
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.
P G R M SN COLLEGE CHANNANIKADU 19
ANDROID APP FOR FARMERS
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
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
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
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
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.
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.
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.
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
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.
P G R M SN COLLEGE CHANNANIKADU 25
ANDROID APP FOR FARMERS
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.
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.
• Hardware plan:
P G R M SN COLLEGE CHANNANIKADU 27
ANDROID APP FOR FARMERS
• Bench marking:
• 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.
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
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
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 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
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
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
P G R M SN COLLEGE CHANNANIKADU 37
ANDROID APP FOR FARMERS
Admin
Dealers
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
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
ead>
<title>Farmer's App</title>
<meta charset="utf-8">
<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">
P G R M SN COLLEGE CHANNANIKADU 56
ANDROID APP FOR FARMERS
</head>
<body class="goto-here">
<div class="container">
P G R M SN COLLEGE CHANNANIKADU 57
ANDROID APP FOR FARMERS
</div>
<span
class="text">youremail@email.com</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
P G R M SN COLLEGE CHANNANIKADU 58
ANDROID APP FOR FARMERS
<div class="container">
</button>
P G R M SN COLLEGE CHANNANIKADU 59
ANDROID APP FOR FARMERS
</div>
</ul>
</div>
</div>
</nav>
P G R M SN COLLEGE CHANNANIKADU 60
ANDROID APP FOR FARMERS
url(/static/images/Farmer.jpg);">
<div class="overlay"></div>
<div class="container">
</div>
</div>
</div>
</div>
</div>
</section>
{% include 'footer.html' %}
P G R M SN COLLEGE CHANNANIKADU 61
ANDROID APP FOR FARMERS
{% include 'public_header.html' %}
<br><br><br>
<h2 align="center">LOGIN</h2>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
P G R M SN COLLEGE CHANNANIKADU 62
ANDROID APP FOR FARMERS
</td>
</tr>
</table>
</form><br><br>
{% include 'footer.html')
{% include 'agriofficer_header.html' %}
{% include 'footer.html' %}
P G R M SN COLLEGE CHANNANIKADU 63
ANDROID APP FOR FARMERS
% include 'public_header.html' %}
<br><br><br>
<tr>
<td>First Name</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
P G R M SN COLLEGE CHANNANIKADU 64
ANDROID APP FOR FARMERS
</tr>
<tr>
<td>House Name</td>
<td>
</td>
</tr>
<tr>
<td>Pincode</td>
<td>
</td>
</tr>
<tr>
<td>Phone</td>
<td>
P G R M SN COLLEGE CHANNANIKADU 65
ANDROID APP FOR FARMERS
</td>
</tr>
<tr>
<td>Email</td>
<td>
</td>
</tr>
<tr>
<td>Place</td>
<td>
</td>
</tr>
<tr>
<td>Username</td>
<td>
P G R M SN COLLEGE CHANNANIKADU 66
ANDROID APP FOR FARMERS
</td>
</tr>
<tr>
<td>Password</td>
<td>
</td>
</tr>
<tr>
</td>
</tr>
</table>
</form><br><br>
P G R M SN COLLEGE CHANNANIKADU 67
ANDROID APP FOR FARMERS
{% include 'footer.html' %
% include 'dealers_header.html' %}
<h1>Dealers Home</h1>
{% include 'footer.html' %}
Admin Python
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":
delete(q)
delete(q)
return redirect(url_for('admin.admin_manageagriofficer'))
if action=="update":
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']
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']
ids=insert(q)
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'))
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":
delete(q)
return redirect(url_for('admin.admin_managenews'))
if action=="update":
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']
update(q)
return redirect(url_for('admin.admin_managenews'))
if "submit" in request.form:
titl=request.form['title']
desc=request.form['desc']
insert(q)
return redirect(url_for('admin.admin_managenews'))
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":
delete(q)
return redirect(url_for('admin.admin_managecrops'))
if action=="update":
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']
update(q)
return redirect(url_for('admin.admin_managecrops'))
# res=select(q)
# data['view_soil']=res
if "submit" in request.form
cname=request.form['ucname']
desc=request.form['udesc']
# sid=request.form['usid']
insert(q)
P G R M SN COLLEGE CHANNANIKADU 75
ANDROID APP FOR FARMERS
return redirect(url_for('admin.admin_managecrops'))
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
delete(q)
return redirect(url_for('admin.admin_managesoil'))
if action=="update":
res=select(q)
data['update_soil']=res
if 'usubmit' in request.form:
usname=request.form['usname']
update(q)
return redirect(url_for('admin.admin_managesoil'))
if "submit" in request.form:
sname=request.form['sname']
insert(q)
print(q)
return redirect(url_for('admin.admin_managesoil'))
P G R M SN COLLEGE CHANNANIKADU 77
ANDROID APP FOR FARMERS
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":
delete(q)
return redirect(url_for('admin.admin_managefertilizers'))
if action=="update":
P G R M SN COLLEGE CHANNANIKADU 78
ANDROID APP FOR FARMERS
res=select(q)
data['update_fert']=res
if 'usubmit' in request.form:
funam=request.form['ufname']
duesc=request.form['udesc']
fueat=request.form['ufeats']
`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']
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'))
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={}
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={}
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'])
%(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":
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":
res=select(q)
data['update_fert']=res
if 'usubmit' in request.form
tuitle=request.form['utitle']
duesc=request.form['udesc']
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])
insert(q)
return redirect(url_for('admin.admin_manage_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={}
res=select(q)
data['view_vifa']=res
return render_template('admin_view_dealers.html',data=data)
Public Python
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']
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']
id=insert(q)
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']
id=insert(q)
insert(q)
P G R M SN COLLEGE CHANNANIKADU 88
ANDROID APP FOR FARMERS
return render_template('public_user_registration.html')
Main.py
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
P G R M SN COLLEGE CHANNANIKADU 92