Вы находитесь на странице: 1из 121

DEVELOPMENT OF MOBILE BASED AGRICULTURE

SCHEDULING SYSTEM FOR FARMERS IN REGIONAL


LANGUAGE (PUNJABI) USING WEATHER
CONDITIONS

Thesis

Submitted to the Punjab Agricultural University


in partial fulfillment of the requirements
for the degree of

MASTER OF TECHNOLOGY
in
COMPUTER SCIENCE AND ENGINEERING
(Minor Subject: Information Technology)

By

Navjot Kaur
(L-2014-AE-213-M)

School of Electrical Engineering and Information Technology


College of Agricultural Engineering and Technology
© PUNJAB AGRICULTURAL UNIVERSITY
LUDHIANA-141004

2016
CERTIFICATE I

This is to certify that the thesis entitled, “DEVELOPMENT OF MOBILE BASED


AGRICULTURE SCHEDULING SYSTEM FOR FARMERS IN REGIONAL
LANGUAGE (PUNJABI) USING WEATHER CONDITIONS” submitted for the degree
of M.Tech, in the subject of Computer Science and Engineering (Minor subject:
Information Technology) of the Punjab Agricultural University, Ludhiana, is a bonafide
research work carried out by Navjot Kaur (L-2014-AE-213-M) under my supervision and
that no part of this thesis has been submitted for any other degree.

The assistance and help received during the course of investigation have been fully
acknowledged.

__________________________
(Dr. (Mrs.) B.K. Sawhney)
Major Advisor
Associate Professor
School of Electrical Engineering
& Information Technology,
Punjab Agricultural University,
Ludhiana-141004
CERTIFICATE II

This is to certify that the thesis entitled, “DEVELOPMENT OF MOBILE BASED


AGRICULTURE SCHEDULING SYSTEM FOR FARMERS IN REGIONAL
LANGUAGE (PUNJABI) USING WEATHER CONDITIONS” submitted by Navjot
Kaur (L-2014-AE-213-M) to the Punjab Agricultural University, Ludhiana, in partial
fulfillment of the requirements for the degree of M.Tech, in the subject of Computer Science
and Engineering (Minor subject: Information Technology) has been approved by the
Student’s Advisory Committee along with the Head of Department after an oral examination
on the same, in collaboration with an External Examiner.

__________________________ ______________________________
(Dr. (Mrs.) B.K. Sawhney) (Dr. J.S. Ubhi )
Major Advisor External Examiner
Associate Professor
Deptt. of Electronics & Communication,
Sant Longowal Institute of Engineering
and Technology,
Sangrur

____________________________
(Dr. Jaskarn Singh Mahal)
Director
School of Electrical Engineering
& Information Technology,
Punjab Agricultural University,
Ludhiana-141004

___________________________
(Dr. (Mrs.) Neelam Grewal)
Dean, Postgraduate Studies
ACKNOWLEDGEMENT

Fore mostly, I bow my head with reverence to ‘Almighty Lord’ who showed the
blessings on me during the course of this research and brought it to a logical end.
I express my profound gratitude, indebtedness and appreciation to my Major Advisor
Dr. (Mrs.) B.K. Sawhney, Associate Professor, School of Electrical Engineering & Information
Technology, PAU, Ludhiana, for her valuable guidance, constant encouragement and
unending help during the tenture of this study.
I am thankful to all the members of my Advisory Committee Dr. O.P. Gupta,
Associate Professor, Dr. Derminder Singh, Associate Professor and Er. Salam Din, Associate
Professor of School of Electrical Engineering & Information Technology for their valuable
suggestions and expert guidance on various issues related to this research work.
I wish to express my deepest sense of gratitude to my parents Mr. Bikkar Singh and
Mrs. Simarjit Kaur, my husband Mr. Gulwinderpal Singh and my brother Mr. Harinderjot
Singh for their unconditional love, support and sacrifices, which can never be forgotten and
whose ever willing help has a great role in my life.
A debt of gratitude is also owned for the unending help and encouragement received
from my friends Rajvir, Mumraj, Karanveer, Shiveta and Swarn that will remain indelible in
my memory.
I take this opportunity to extend my sincere thanks to all the teaching and the non-
teaching staff of School of Electrical Engineering & Information Technology for their kind
cooperation, generous help as and when needed.
In the end, I am thankful to all those who may not have been mentioned but are not
forgotten.

_____________
(Navjot Kaur)
Title of the Thesis : Development of mobile based agriculture
scheduling system for farmers in regional
language (Punjabi) using weather conditions

Name of the Student : Navjot Kaur


and Admission No. L-2014-AE-213-M
Major Subject : Computer Science and Engineering

Minor Subject : Information Technology

Name and Designation : Dr. (Mrs.) B.K. Sawhney


of Major Advisor Associate Professor
School of Electrical Engineering &
Information Technology
Degree to be awarded : M.Tech (Computer Science & Engineering)

Year of award of Degree : 2016

Total pages in Thesis : 66 + Appendix + Vita

Name of University : Punjab Agricultural University,


Ludhiana-141 004, Punjab, India

ABSTRACT

In Indian agriculture, farming activities like sowing, harvesting and irrigation plays very
important role in productivity. These activities must be performed in suitable manner and
most importantly at appropriate time in order to get good yield. But sadly most of the farmers
are unaware about the impact of these activities on yield of their crop. So application is
developed to educate farmers about it. The developed software application is basically for
dissemination of information to farmers about the proper way of performing various farming
activities in regional language Punjabi, of two main crops of Punjab- wheat and paddy. This
application will assists farmers in performing these activities in proper manner and help them
in improving their productivity of crops. Based on date of sowing, farmers will get
notifications about farming activities. Additional advice will be provided along with the
notification on the basis of weather conditions. This system is an android based application
developed in regional language Punjabi for overcoming lingual barrier of farmers. The
application is developed using Android Studio which is the official Integrated Development
Environment (IDE) for developing an Android application.

Keywords: Android, Scheduling, Farming Activities, Wheat, Paddy, Punjabi.

_____________________________ _______________________

Signature of the Major Advisor Signature of the Student


Koj pRbMD dw isrlyK : mOsmI hlwqW dI vrqoN krky ikswnW leI KyqrI BwSw
(pMjwbI) iv`c mobwiel KyqI AnusUcI pRxwlI dw
ivkws
ividAwrQI dw nwm Aqy dwKlw nM. : nvjoq kOr
(AYl-2014-ey.eI.-213-AYm)
mu`K ivSw : kMipaUtr swieMs Aqy ieMjnIAirMg

inmn ivSw : ieMnPrmySn tYknolojI


pRmu`K slwhkwr dw nwm Aqy Ahudw : fw. bI.ky. swhnI
sihXogI pRoPYsr
skUl AwP ielYktRIkl ieMjnIAirMg AYNf
ieMnPrmySn tYknolojI
ifgrI nwl snmwinq krn dw swl : 2016

Koj pRbMD iv`c ku`l pMny : 66 + AMiqkw + vItw

XUnIvristI dw nwm : pMjwb KyqIbwVI XUnIvristI, luiDAwxw-141004,


pMjwb, Bwrq

swr-AMS

BwrqI KyqI ivvsQw iv`c, bIjweI, vwFI Aqy isMcweI vrgIAW ikrswnI gqIivDIAW dI
auqpwdkqw iv`c Aihm BUimkw hY[ vDIAw JwV lYx leI ieh swrIAW gqIivDIAW suc`jy FMg nwl
krnIAW cwhIdIAW hn Aqy ies qoN vI mh`qvpUrn ieh hY ik ieh swry kMm shI smyN qy krny
cwhIdy hn[ pr APsos dI g`l ieh hY ik iehnW gqIivDIAW dy &sl dy JwV aupr pYx vwly
pRBwvW qoN ikswn Anjwx hn[ ies leI ikswnW nUM is`iKAq krn leI AYplIkySn ivksq kIqI
geI[ ieh swPtvyAr mu`K qOr qy pMjwb dIAW do pRmu`K &slW – kxk Aqy Jony leI v`Ko-v`KrIAW
ikrswnI gqIivDIAW nUM shI FMg nwl krn leI ikswnW iv`c jwxkwrI dw pswr krn leI KyqrI
BwSw pMjwbI iv`c iqAwr kIqw igAw[ ieh AYplIkySn ikswnW nUM ieh gqIivDIAW suc`jy FMg nwl
krn iv`c shweI hovygI Aqy &slW dI auqpwdkqw nUM vDwaux iv`c auhnW mdd krygI[ bIjweI
imqI dy ADwr qy, ikswnW nUM v`Ko-v`KrIAW ikrswnI gqIivDIAW sbMDI sUcnw imldI rhygI[
sUcnw dyx dy nwl nwl mOsmI hlwqW dy ADwr qy ikswnW nUM slwh vI id`qI jwvygI[ ieh pRxwlI
AYNfrwief ADwirq hY Aqy ikswnW dIAW BwSw sbMDI AOkVW nwl nij`Tx leI KyqrI BwSw pMjwbI
iv`c iqAwr kIqI geI hY[ ieh AYplIkySn AYNfrwief stUfIE dI vrqoN krky iqAwr kIqI geI
hY jo ik AYNfrwief AYplIkySn iqAwr krn leI ie`k AiDkwrq ieMtIgRyitf ifvYlpmyNt
ienvwiernmYNt (IDE) hY[

mu`K Sbd: AYNfrwief, AnusUcI, ikrswnI gqIivDIAW, kxk, Jonw, pMjwbI

__________________ ________________

pRmu`K slwhkwr dy hsqwKr ividAwrQI dy hsqwKr


CONTENTS

CHAPTER TOPIC PAGE NO.

I INTRODUCTION 1–4

II REVIEW OF LITERATURE 5 – 13

III MATERIAL AND METHODS 14 – 37

IV RESULTS AND DISCUSSION 38 – 61

V SUMMARY 62 – 64

REFERENCES 65 – 66

APPENDIX i – xliv

VITA
LIST OF TABLES

Table No. Title Page No.

3.1 Structure of farmer table 21

3.2 Structure of admin table 21

3.3 Structure of wheatOct table 21

3.4 Structure of wheatseed table 22


LIST OF FIGURES

Figure No. Title Page No.

1.1 Mobile Penetration in Urban and Rural Segment 1

3.1 Data Flow Diagram for users 20

3.2 Data Flow Diagram for admin 20

3.3 String.xml file 22

3.4 Android Cycle 26

3.5 Architecture of Android 30

3.6 Model View Controller 32

3.7 Work Flow of App Development 34

3.8 JSON Structure 36

3.9 JSON Call 36

4.1 Login Activity 39

4.2 Registration Activity 40

4.3 Registration Activity showing validation violated message 41

4.4 Home Activity 41

4.5 Weather Fragment 42

4.6 Wheat Fragment 43

4.7 Notification Fragment of Wheat Crop 43

4.8 Notification of Wheat Crop 44

4.9 Confirmation Message 44

4.10 Confirmation message regarding changing of sowing date 45

4.11 After Notification Activity of Wheat 45

4.12 Schedule Wheat Activity 46

4.13 Schedule of October 46

4.14 Schedule of November 46

4.15 Schedule of March 46

4.16 Wheat Seed Activity 47

4.17 Wheat Seed Type1 Activity 48

4.18 Wheat Seed Type2 Activity 48


Figure No. Title Page No.

4.19 Wheat Seed Type3 Activity 49

4.20 Paddy Fragment 50

4.21 Notification Fragment of Paddy 50

4.22 Notification in notification panel of Paddy Crop 51

4.23 Confirmation Message of Paddy Crop 51

4.24 Confirmation message about changing of sowing date of Paddy 52

4.25 After Notification Activity of Paddy 52

4.26 Schedule Paddy Activity 53

4.27 Schedule of May 53

4.28 Schedule of June 53

4.29 Schedule of September 53

4.30 Paddy Seed Activity 54

4.31 Paddy Seed Type1 Activity 55

4.32 Paddy Seed Type2 Activity 55

4.33 Paddy Seed Type3 Activity 56

4.34 Login Activity of Admin 57

4.35 Drawer of Home Activity 57

4.36 Activity for adding new seeds of Wheat 58

4.37 Activity for adding new information of schedule of October 58

4.38 Options for altering previous Information 59


CHAPTER I

INTRODUCTION

The society is going through technological era. The involvement of technology is


there in each and every phase of the life. Whereas these days, the most common way of
transmitting voice, data and services in the world is the mobile communication technology.
Strategic reforms in the telecommunications sector since 1990s, facilitates strong
Information and Communication Technology (ICT) infrastructure in India. In 2012, India and
China accounted for nearly 40 per cent of the total new mobile connections across the world.
Evidently, the Indian market plays a key role in the ever-expanding mobile network globally.
The Indian mobile subscriber base stood at 970 million in March 2015 and is expected to
cross one billion by 2016. The Indian mobile subscriber base contributes to around 15 percent
of the world mobile subscriptions of 6.5 billion (Cellular Operators Association of India
(COAI), 2015).

Fig 1.1 Mobile Penetration in Urban and Rural Segment


Horizontal line ( x-axis) depicts year and vertical line (y-axis) depicts percentage
(Source: COAI Annual Reports 2015)
Rural mobile subscriber base has been increasing steadily over last seven years. It
was 27 percent in the 2008 and by 2015 the rural subscriber base has reached till 42 percent
of the total subscriber base. It is estimated by the Mobile industry that the mobile growth will
now happen from rural segment. Telecom Regulatory Authority of India (TRAI) report states
that 93 percent of the internet users are using mobile devices to access the internet
application. It means that mobile devices are fast replacing personal computers to access
content available on internet. This clearly indicates that the Internet revolution via mobile
telephony is taking place from the rural areas (COAI, 2015). So mobile phones can be used to
disseminate information even in rural areas.
Mobile phones are used very commonly by everyone. The development of mobile
applications (Mobile app) has increased the usability of mobiles beyond voice and text
communications. Mobile app is a computer program designed to run on mobile devices such
as smartphones and tablet computers. Due to rapid growth in the use of smartphones and
falling internet access costs, the development of mobile apps has increased dramatically.
Earlier mobile apps were developed mainly for entertainment and communication purposes
only. But now trend has been changed and mobile apps are focused on other sectors as well
like finance, agriculture and even daily routine activities. Mobile app for agricultural and rural
development (m-ARD apps) is one of the emerging fields that focus on the enhancement of
agricultural and rural development. As mobiles are part of day-to-day life of everyone,
including farmers, so they can be utilized for providing accurate and timely information to
farmers, reminding them about farming activities and helping them in improving their
productivity.
There are many advantages of mobile apps but the most important one is that they are
quite easy to use as compared to websites. In order to use websites one must know how to
operate a computer which is a quite cumbersome task for a common man like farmer. On the
other hand mobile apps are very user friendly; one can easily operate it and get benefitted
from it.

1.1 Need of a Scheduling Mobile app for Punjabi Farmers


Agriculture is one of the main livelihoods in India especially in Punjab. Indian Punjab is
called the ―India’s bread-basket‖. It produces wheat, paddy, cotton and other important crops.
So productivity of crops of Punjab has great impact on the Indian economy. Agriculture
involves number of activities like sowing, irrigation, fertilization, harvesting etc. All these
activities must be performed at appropriate time and also in suitable manner for good
productivity and proper utilization of resources. Moreover, weather conditions also affect the
productivity of crops. But most of the farmers do not have proper or up to date information.
As a result farmers do not perform these farming activities on time or in proper manner. They
just follow hit or trail method or old traditional methods. This leads to exploitation and
wastage of natural resources, also productivity of their crops get affected and so is economy
of country.
Agricultural experts provide information to farmers about proper timing and proper
manner of doing various farming activities by organizing various camps in villages. Even
Punjab Agricultural University (PAU) monthly magazine has published columns related to
farming activities of various crops to remind farmers about various activities that are to be
performed in upcoming month.

2
Weather conditions play very important role in Indian agriculture. Productivity will
be increased if all these activities are done by considering weather conditions as well. Like if
there is time to irrigate fields but according to weather forecasting there is possibility of rain
in coming one-two days so irrigation can be postponed accordingly. This will save resources
like water, electricity and also save the crop from waterlogging. These day as life of each and
every person is very busy so it is possible that one may forget timing of irrigation or putting
manure to his fields due to his hectic life schedule and it will have adverse impact on
productivity of crop. So developed mobile based agriculture scheduling system, that by taking
in account weather conditions, remind the farmers about various farming activities and
contribute in increasing the productivity and their economic conditions as well. It also
provides basic information such as type of seeds available or recommended by PAU, which
fertilizer to be used and in what quantity etc. about various crops. This helps in reducing the
wastage of resources and money as well.
Now-a-days so many information systems are available but still farmers do not get
advantage from them due to language problem. As most of the mobile apps developed for
agricultural assistance has English language user interface. So language barrier is there. As
most of the agriculturists either can’t communicate in English or they reluctant to do so.
Farmers will be more interested in using any mobile app if it will be in their regional
language. That’s why the proposed mobile based scheduling system is developed in regional
language Punjabi focusing mainly on Punjabi farmers.
The proposed system termed as ―Development of mobile based agriculture scheduling
system for farmers in regional language (Punjabi) using weather conditions‖ is android based
mobile app. It is a scheduling app designed for two crops wheat and paddy in which
registered farmer can enter date of sowing of his crop and app will give notifications to him
about various farming activities from date of sowing till harvesting. It is developed in regional
language Punjabi so that more and more farmers are able to utilize it in their agricultural
activities and get benefitted from it. It enables farmer to perform all these activities timely and
also in proper manner. This mobile app also displays weather in regional language Punjabi to
improve the understandability of weather by farmers. The weather conditions are also taken
into consideration while notifying farmers about various farming activities so that natural
resources like rainfall is utilized properly and also wastage of other resources is reduced. The
user interface of mobile app is very easy to use and focuses mainly on assisting farmers in
agricultural activities. This mobile app also provides information about the type of seeds
recommended by PAU. So that farmers can get latest up to date information. The essential
features of the mobile app can be summarized as follows:
 Scheduling system to notify registered users about important farming activities.
 Weather is displayed in regional Language Punjabi.

3
 User interface of app is in Regional language Punjabi.
 Information about type of seeds of wheat and paddy recommended by PAU
 Displays monthly schedule of wheat and paddy.
1.2 Objectives
The objectives of the proposed system are as follows:
i. To study the basic information required for farmers such as varieties of seeds,
types of fertilizers and information about various farming activities.
ii. To develop mobile based agriculture scheduling system for farmers in regional
language (Punjabi) using weather conditions like temperature, humidity.

4
CHAPTER II

REVIEW OF LITERATURE

Silva and Ratnadiwakara (2005) studied about using ICT to reduce transaction costs
in agriculture through better communication in Sri Lanka. They found that there were notable
costs attached to information search and hence transaction costs related with all six stages of
the agricultural value chain ongoing with the decision to grow and ended with sale of produce
at the wholesale market. In the decision stage and selling stages, the relative proportion of
information search costs was found to be highest among the farmer group in the case study of
smallholder vegetable farmers in rural Sri Lanka. The study also found that if farmers had
used the phone at various points in the agricultural value chain their information search costs
could have been decreased considerably. Consequently it was reasonable to suggest an
cohesive system using a mobile phone platform that addressed the total information needed
from the decision making stage to selling stages of agricultural produce to assist farmers
significantly reduce information search costs.
Singh (2008) conducted study about the diffusion of mobile phones in India. He
concluded that mobile phones were becoming the foremost means of retrieving
communication. At the end of 2005–2006, there were 90 million mobile subscribers in India
in comparison to 50 million subscribers for landlines. The increase in mobile phones had been
phenomenal in comparison with landlines since the introduction of mobiles in the country.
The main aim of his study was to estimate future trends and analyze the pattern and rate of
adoption of mobile phones in India. He used S-shaped growth curve models for the same. It
was found that mobile-density (number of mobile phones per 100 inhabitants) in India would
increase from 8.1 in 2005–2006 to 36.5 in 2010–2011 and 71 in 2015–2016. Consequently,
the mobile subscriber base was projected to increase from 90 million in 2005–2006 to 433
million in 2010–2011 and nearly 900 million in 2015–2016. The predictable rapid growth in
the mobile subscriber base would have significant implications for future plans of mobile
operators, infrastructure providers, handset suppliers and vendors.
Mittal and Tripathi (2009) concluded on role of mobile phone technology in
improving small farm productivity. Mobile phones have the potential to provide solution to
the current information asymmetry in numerous lagging sectors like agriculture. India’s
agricultural sector suffered from low growth rates and low productivity. Problems in access to
information were weak points at each stage of the agri-supply chain. For small farmer-based
economy like India, access to information could perhaps enable improved incomes and
productivity to the farmers. Through group discussions and in-depth interviews with farmers,
they tried to find answers to the use and impact of mobile phones and mobile-enabled services
on agricultural productivity. The answers to these questions were of relevance to develop
better policy environment conducive for small and medium farmers and have repercussions
for mobile phone operators, information service providers, and policymakers. The study had
revealed that although, mobile phones could act as catalyst to improving farm productivity
and rural incomes, the superiority of information, appropriateness of information and
trustworthiness of information were the three significant features that had to be delivered to
the farmers to meet their needs and expectations. There exist critical binding constraints that
restricted the ability of the farming community to realize full-potential gains and it was more
so for small than large farmers.
Sahota (2009) accompanied a study on usage of mobile phones for accessing
agricultural information under the Indian Farmers Fertilizer Cooperative Limited (IFFCO)-
Airtel Kisan Card initiative and found that proactive usage of the service by the farmers was
very little. Nobody had made a voice call or sent as SMS to the service providers to seek extra
agricultural information. It was observed that most of the farmers who had bought the mobile
phone as a part of the initiative were utilizing it for social interacting. Even the initiative also
had facility for sending video clips or still photographs to the experts for seeking advice, it
was found that the farmers were not able to use this feature due to their inadequate
technological skills. Further, farmers (especially small landholders) sensed that the advice
was not feasible, as the inputs suggested by the experts were either not available in the local
market or were too expensive.
Alibaygi et al (2010) surveyed the effectiveness of rural ICT centers. They concluded
that Rural ICT centers played a significant role in rural development through improving e-
governance in rural areas. The main purpose of this survey research was to examine the
efficiency of rural ICT Centers for developing e-governance in the rural societies of the
Kermanshah Township, situated in the west of Iran. The data were collected in two phases.
The firstly Delphi technique was used, carried out by the participation of ICT experts to
determine the effectiveness indicators. The second phase engaged a structured interview using
a questionnaire. The majority of people did not use internet services despite its accessibility in
the ICT Centers. The ICT Centers also had little effectiveness in improving rural households’
income, employment rate, dispersion of agricultural material among farmers, and e-
commerce. They were to some extent effective in reducing the relocation of rural people to
urban areas, their day-to-day trips to near cities, and postal necessities as well as improving e-
governance in rural areas.
Masuki et al (2010) studied the role of mobile phones in improving communication
and information delivery for agricultural development in South Western Uganda. They
highlighted the critical role mobile phones could play in greater efficiency for farmers in rural
setting. One of the key findings was that mobile phones were gradually accessible to lower-
income groups in rural areas. As of from the discussions and observations made, it was found

6
that farmers were more enthusiastic about using the phone to access information on
agriculture, natural resources management. This called for various characters along the
product value chain to look into the chances that mobile phones could best be utilized to lift
agricultural development that accounted for more than 30 percent of the county’s Gross
Domestic Product (GDP) given the rapid growth of the mobile in the country. Chances arisen
from the proliferation of mobile phones experienced in most developing countries like
Uganda needed to be explored especially in the absence of other ICT infrastructure, like fixed
phones and internet.
Maumbe et al (2010) reported the evolution of information and communication
technology (ICT) applications in agriculture and rural development based on proportional
experiences of South Africa and Kenya. The framework postulates that complete deployment
of ICT in agriculture and rural development would be a result of several phases of change that
started with e-government policy plan, development and employment. They argued that ICT
used in agriculture and rural development was a dominant instrument for improving
agricultural and rural development and standards of living throughout Sub-Saharan Africa.
There were so many impairments included the lack of awareness, low literacy, infrastructure
deficiencies, language and cultural hurdles in ICT usage, the low e-inclusivity and the need to
supply for the special needs of some users. They reviewed successful applications of ICT in
agriculture and urged greater use of ICT-based interventions in agriculture as a vehicle for
encouraging rural development in Africa.
Mittal et al (2010) studied the socio-economic impact of mobile phones on Indian
agriculture. They stated that as a telephonic device, the mobile empowers access to
information sources that may not otherwise be accessible. As an information platform to
receive messages, menu or voice message information, mobiles provides the skill to get
linked to new knowledge and information sources not formerly available. Even at their initial
stage, mobile phones were being used in Indian agriculture and started to deliver agricultural
productivity improvements, an influence that was enhanced by the new mobile-enabled
information services. The most common benefit of mobile telephony found in the research
was derived from the use of mobile phones as a basic communications device as for many of
the farmers interviewed, it was the only appropriate phone access they had. The barriers
applied more to small than to large farmers; large farmers were more able to leverage the
profits of the communication and information they could access. The limitations included
failings in physical infrastructure that affected access to markets, storage and irrigation. Issues
regarding the accessibility of critical goods and services including seeds, fertilizers, medicines
and credit to small farmers also existed. Increased public and private investment and policy
changes might also be needed to encourage better access to superior quality inputs and credit
for small farmers. Increased extension services and capacity-building efforts could balance

7
information dissemination via mobile phones and associated services to accelerate the
adoption of new practices. Social networks might play a dynamic role in building the trust
and confidence required to influence the acceptance of new mentalities an actions by small
farmers. Furthermore, basic information would need to be complemented by a range of other
activities such as demonstrations and broader communication efforts. In the case of
fishermen, there were, in addition to economic benefits, safety benefits and enhanced quality
of life from decreased isolation and vulnerability.
Kameswari (2011) discussed the agricultural information seeking behavior of farmers
in the state of Uttarakhand, India. It tried to clarify the reasons behind use of certain media –
including ICTs - by the farmers over other existing sources. It was observed that, though
farmers had access to a wide range of media/ sources, they mostly trusted on middlemen, and
native and certified sources for agricultural information. Among new ICTs, mobile phones
were broadly accessible in the study area but were frequently being used for post-sale inquiry
rather than paddy negotiation, accessing markets or paddy information or increasing
production efficiency. In the rural Indian context, the availability of ICTs does alter the
reciprocal connection between the seller (farmer) and the buyer (middlemen). In the absence
of formal and effective institutions, the middleman was also the supplier of seeds, fertilizers,
pesticides and credit to the farmers and this skewed relation limited the advantage that could
be derived from use of ICTs. While the study indicated that the possible advantage from use
of ICTs in rural areas were offset by an absence of other input agencies, interventions in other
parts of the country indicated that the entire agricultural supply chain could be made more
effective by use of ICTs. Hence, rather than negating the likely benefits that could be derived
from the use of ICTs in agriculture sector, this study pointed to issues that needed to be
addressed simultaneously.
Qiang et al (2011) stated the role of mobile applications in agriculture and rural
development. They reported that m-ARD apps offered innovative, dynamic, interdisciplinary
services. Their main findings were:
 Enabling platforms were likely the most significant factor for m-ARD apps to move
from the pilot stage to the scalability and sustainability stages—beyond donor and
government funding. Such platforms were built on the links between handsets,
software applications, and payment tools that supported interactions among
stakeholders in the m-app ecosystem. Platforms could provide access to more users,
offer effective technical standards, and incorporate payment mechanisms.
 Numerous other mechanisms, such as incubators and central hubs, could support the
development of ecosystems for m-ARD apps.

8
 Some m-ARD apps were achieving scalability, replicability, and sustainability.
Despite numerous challenges, a number of m-ARD apps were doing well, with a
good equilibrium of cost, marketing, and pricing strategies.
 Commercial m-ARD apps needed to improve or enlarge their services in response to
user needs and ensure that they provided enough value to produce sustainable
demand and revenues—increased users’ willingness to pay and overcoming ability to
pay issues even at low economies of scale.
Ramaraju et al (2011) studied about ICT in agriculture. ICT in agriculture, an emerging
field concentrated on the improvement of agriculture in India. It called for application of
advanced ways to use ICT in the field of agriculture. The basic problems in adopting ICT by
farmers were ICT illiteracy, availability of relevant and localized contents in their respective
languages, reasonable and easy availability and other issues such as awareness and
willingness for adoption of new technologies etc. The study was carried out to develop an
understanding of the agricultural related ICT needs and problems tackled in using ICT by the
farmer’s in numerous agro and socio-economic situations; with emphasis on the small and
marginal farmers. A primary survey was piloted using structured Schedules / Questionnaires,
Focus Group Debates and Participatory Rural Evaluation. Overall 26 ICT initiatives in
agriculture was studied, covering 1381 agrarians in 57 designated sample villages in 12 states
of India to elicit the need felt by farmers, prioritize their perceptions and fetch out the issues
involved in the development of ideal ICT applications for agriculture. The research
confirmed that the most common information gadget possessed and accessed by the farmers is
the Mobile Phone (82percent) followed by Television (73percent) and the Newspaper
(67percent). Most of the Indian farmers had mobile phones and they were also attracted to use
their mobiles for retrieving information. Farmers found it more suitable with voice based
advices/information, as they opined that they could discuss their queries while
communicating with experts in their own language.
Yadav et al (2011) assessed the impact of ICT – enabled Knowledge Sharing Agri-
portals in Uttarakhand. They concluded that it was argued that Information and
Communication Technologies (ICT) could lead to development in developing countries.
Because of this, developing countries have been rushing to implement ambitious ICT projects
in rural areas through the direct-indirect regulation of organizations such as, the World Bank,
United Nations (UN) and other donor/local agencies. The main focus of the involvements had
been the employment of these ICT projects, rather than understanding their impacts at the
recipient level. This deficiency of understanding had led to many failures of ICT projects
reported in the literature. The analytical research design was used to conduct the
investigation. Two Agri portals viz. Agropedia and aAQUA were designated by survey
method. Interview Schedule, Impact assessment index and opinionnaire were established to

9
gather data from the farmers. Findings of the study discovered that majority of farmers were
medium aged, educated up to Intermediate, with primary occupation as farming, general
caste, medium family income, with majority of male, had nuclear family and medium family
size, obsessed medium level of communication media, high level of agricultural apparatus,
average household possession, medium level of social participation, and contact fellow
farmers for agricultural information. Television was the most widely accessed media,
majority had low farming experience, medium animal possession, produce 2-3 crops a year,
all of them were aware of the Agri-portals’, majority of them visited the selected Agri-portals
for market information on periodic basis, shared the information provided through both the
Agri-portals with neighbors, satisfied with Agri-portals’ references, gained medium
knowledge and utilized to medium extent. Maximum number of farmers preached that
uploaded data of Agropedia and aAQUA was moderately relevant, with high technical words,
moderately valuable content, with suitable readability and had the opinion that internet was
the best way to learn new things. Maximum farmers reported slightly positive changes in
income, quality of produce, crop diversification due to Agropedia and aAQUA. The utmost
important limitation identified by the farmers was least number of trainings.
Gichamba and Lukandu (2012) suggested a model for designing m-agriculture
applications for dairy farming. They concluded that Mobile technology could be applied in
agriculture to improve the various processes that were involved between the production of
produce in the farming. The presented M-Agriculture model offered a workable solution
towards the design and implementation of mobile applications in dairy farming. From the
research, it was marked that most of the areas with inadequacies could be solved using mobile
technology. The designed model could be used by software developers to create mobile
applications that were focused on dairy farming and to implement the numerous business
processes involved in that agrarian sector. The model could also be adopted by policy
organizations and government and researchers as well. Further work might be done to test the
model in other areas of agriculture, e.g. crop farming.
Saha et al (2012) developed m-Sahayak- the innovative android based application for
real-time assistance in Indian agriculture and health sectors. Mobile or smart phones (Android
based) were becoming a vital device for all people irrespective of the age and literacy. In
India, mobile technology had released a paradigm shift in the communication medium to
reach out to the common people. Extension of mobile-phone based any-time, any-where
scientific expert advice to the farmers was a possibility in India, i.e., information was
available earlier for electronic processing, and communication had merged with Information
Technology to create ICT impacts as a whole. ICT enabled environment was becoming a day-
to-day reality everywhere in India. Tele-health allowed health care professionals to diagnose
and treat patients in remote locations using ICT. The application took care of certain problems

10
in agriculture and health care by simultaneously capturing data and directing them to a
specified server. Agricultural Scientists or doctors can view or listen to this information and
deliver proper solutions, accordingly. The development was tested satisfactorily.
Lomotey et al (2013) developed MobiCrop: supporting crop farmers with a cloud-
enabled mobile application. Mobile technology was increasingly being adopted in the
agricultural space as a measure to assist farmers in decision. The MobiCrop project was
started by the scholars from the College of Agriculture at the University of Saskatchewan,
Canada. The aim of the project was to enable farmers to have easy access to up to date
information on pesticides and further make decisions on which pesticides to apply, how to
and when to apply them, and so on. Due to its complexity, MobiCrop was designed as a
mobile distributed system that followed a three-layered deployment. Since the data that was
being pushed to the mobile resided on the database server, caching procedure on the mobile
had been proposed to support offline convenience of pesticide information.
Prasad et al (2013) developed AgroMobile: a cloud-based framework for
agriculturists on mobile platform. They concluded that use of mobile devices was very
common, including the agrarians. Introduction of ICT had seen a keen role in daily life of
farmers. Previously, farmers used to depend on clouds for rains were looking into the Cloud
Computing (CC) for their resolutions towards tilling of better crops in modern agricultural
world. The conventional methods used by the farmers, particularly in India, were very slow
and untrustworthy. The crops were spoiled in field itself due to disease attacks and lack of
information resources. This loss grew more than 40 percent in total annually. They proposed
various ways in which a farmer could utilize Mobile Cloud Computing (MCC) on their
handsets using application called AgroMobile, to assist them for relatively better cultivation
and marketing.
Razaque et al (2013) concluded on the use of mobile phone among farmers for
agriculture development. Mobile phone usage in world was playing a dynamic role for the
enhancement of farmers business towards agriculture. Communication through mobile phones
was considered very significant in enhancing farmers’ access to better understand agricultural
market situation. Farming communities cherished mobile phone as easy, fast and convenient
way to communicate and get prompt answers of respective problems. The mobile phone had
created an opportunity for the farmers particularly to get the information about marketing and
weather. The use of mobile phone also kept them aware for weather forecast for agriculture
input application which might be exaggerated by unfore seen dis-asters as communicated by
metrological department. This device had given new direction and approach to farmers to
communicate directly and share about current advances with each other. The studies disclosed
that mobile phones have saved energy, time of farmers and ultimately improved their income.

11
Mobile phones have provided a chance to the farmers to communicate directly with market
brokers and customers for selling their product at good paddy.
Bhalchandra et al (2014) studied role of information technology in agriculture
marketing and it's scope in Pune district. Information technology (IT), one of the modern
human made technologies is prompting life, training, research and management pattern etc.
Information Technology is utilized to develop life, agricultural research, education and
extension to improve quality. The study took place in Pune District, Maharashtra to study
impact of IT on farmers and to find out holes in the existing information system. It also
focused on how this market information could be used for planning, production and holding
stocks. The sample size was 50 including rural and semi urban population. The Major
findings were, the farmers in the age group of 30–50 are using IT for their crop production.
Agricultural marketing was male dominated field. Graduates and post graduates were using
IT effectively. IT could be the best mean not only to develop agricultural extension but also to
expand agriculture research in Pune India. The paper focused on the scope of IT in Pune
District only.
Ghogare and Monga (2015) discussed the introduction and figuration of E-agriculture
applications. E-Agriculture is an emerging field focusing on the upgrading of rural and
agricultural development through advanced information and communication processes. Some
issues with agriculture and rural development were discussed. The main aim of their research
was to reach farmers for their alertness, usage and perception in e-Agriculture. E-Agriculture
is a platform for supporting marketing of products related to agriculture. The work on E-
agriculture transported the information regarding agricultural details to farmers via message
and hereby projected to switch over E-agriculture. The details such as daily alert, seasonal
alert and other additional details could be sent to farmers. The daily alert could be sent to all
farmers whereas seasonal alert could be sent to farmers only for selected farmers based on
clustering result. Finally the other or additional detail which was proclaimed by agriculture
could be sent to all farmers. Experimental result showed better results when compared with
the existing work.
Mohan (2015) stated the importance of mobile in dissemination of agriculture
information among Indian farmers. Applications such as text and Multimedia Messaging
Service (MMS) and Voice Stream, are used to disseminate information to the farming
community. These applications are customized based on subjectivity such as literacy, usage
pattern, social acceptance, domain specific and lifestyle of rural farmers in various states.
These practices were nothing but innovative business models, which were adopted based on
user per capita. Most of the initiatives were push-based methods providing opportunity to fill
the knowledge transfer to fulfil the users’ basic needs. The mobile-based projects for farmers
had objectives, which benefited farmers and such projects were based on development

12
agenda. These objectives suit market (input, output) paddy’s, availability status, agricultural
extension, social connectivity and financial-support systems. ICT initiatives have come a long
way in the last two decades in India in the Agriculture domain. The penetration of mobile
phone in the rural sector had opened up vast possibilities. Initially mobile was used as the
communication medium by rural sector but now it had been used as information
dissemination tool. This tool could also be used in the area of agriculture information, rural
health and rural education sector. There was a greater need to identify the underlying factors
that supported the adoption of mobile-based services in the rural sector so that a more focused
approach could be taken by the government agencies as well Private sector.
Sharma et al (2015) developed E-Agro Android Application. E-Agro offered
expertise service to farmers regarding cultivation of crops, pricing, fertilizers and diseases etc.
and even suggestions regarding modern techniques for cultivation, usage of bio-fertilizers.
Their main aim was concentrated on bringing the modern agricultural techniques to the
remote farmers. The persistently increasing importance and application of Information
Technologies in Agriculture had given birth to a new field called E-Agro, which focused on
improving agricultural and rural development through a variety of technologies. The user
interface of the application is in English.
Caine et al (2016) concluded on mobile applications for weather and climate
information: their use and potential for smallholder farmers. Mobile phones are gradually
being used to provide smallholder farmers with agricultural related information. There is
currently great curiosity in their scope to transfer climate and weather information. A
literature review, interviews with experts and 15 case study reviews were conducted. This
focused principally on Sub Saharan Africa but included examples from India also. The study
identified areas of substantial potential which include: the use of gradually available mobile
data connections to ensure locally relevant content was available to farmers in well-timed
fashion; development of decision making tools to enable farmers to interpret information for
their own contexts and management options.
Ghanshyam et al (2016) developed agronomy-an android application regarding
farmer utility. The availability of agricultural information directly to farmers by single tap of
their finger without him being dependent on anyone will enable the farmers to take superior
decisions shortly. This will not only substitute greater productivity but will improve a
farmer’s life reducing stress and also instilling enthusiasm to learn new technology which is
essential in this era of Digital Revolution. Some other areas whose information is regularly
required by farmers are about seeds and fertilizers, the loan schemes, etc. The application was
offered in 2 Indian regional languages but agricultural data from web services was only in
English.

13
CHAPTER III

MATERIALS AND METHODS

The software developer needs to consider the entire user requirements and must
follow proper software engineering approach while developing software/app. If systematic
approach is not followed the software development will become quite unmanageable task and
it might also fail to fulfil the needs of users. The Software development life cycle (SDLC) is a
prefect way out. It provides systematic outline for software development by dividing task into
various phases. Each phase has a beginning, an end, a series of specific activities and
deliverables. So there is a proper flow of activities and progress of task is clearly visible. For
development of aforesaid application, the software engineering approach has been used which
is as under:
3.1 Software Development Life Cycle (SDLC)
The SDLC is a process that consists of a detailed plan describing how to develop,
maintain, replace and alter or enhance specific software. The life cycle defines a procedure for
improving the quality of software and the overall development process. SDLC consists of all
the steps of software starting from its inception to its implementation. The SDLC is a
methodology that forms the outline for planning and controlling the creation, testing and
delivery of a software. The SDLC is a sequence of phases that provide a model for the
development and lifecycle management of an application. The intent of a SDLC process is to
produce a product that is effective, fulfil users’ requirement and at the same time of high
quality. Once an application is formed, the SDLC maps the proper deployment and
maintenance of application. SDLC defines the chief stages of development life cycle which
are used by analyst, system designers and developers to plan and execute sequence of events
required to achieve a quality software or system at scheduled time and estimated cost. The
typical SDLC is composed of following phases:
3.1.1 System analysis
3.1.2 Feasibility analysis
3.1.3 Requirement analysis
3.1.4 System Design
3.1.5 Coding
3.1.6 Testing
3.1.7 Implementation
3.1.8 Maintenance
3.1.1 System Analysis
This is the first and very important phase of SDLC. This phase is critical to the
success of the software. In this phase the needs of user for developing new software are
considered and also problems in existing system are identified. Requirement gathering is very
brainstorming phase as this is a brief investigation of the system under consideration and
gives a clear picture of expectations of user from new software. The initial system study
involves the planning of a system proposal which lists the definition of problem, objectives of
the study and terms of reference for study, Constraints, Expected benefits of the new system
etc. The system proposal is prepared by the system analyst and places it before the user for
approval. If user accepts the proposal the cycle proceeds to the next stage. The user may also
reject the proposal or request for some modifications in the proposal. The system study phase
passes through the following steps:
I. Existing system: A number of mobile based information systems exist in India that
is used to disseminate knowledge from technical institutes or researchers to non-
technical users like farmers. These system give farmers information about market
prices, weather, type of fertilizers, crop diseases etc. Still farmers are not able to get
full benefit from them. One reason is language barrier. As most of the information
system are in English and most rural agriculturists in India either can’t
communicate in English or hesitate to do so. So communication gap is there. Also
in India weather plays important role in agriculture. If farming activities are not
performed by considering weather conditions exploitation of resources is there. To
the best of author’s knowledge there is no such mobile based scheduling system
that considers weather conditions for reminding farmers about various farming
activities in regional language (Punjabi).
II. Proposed system: The aforesaid app is android based mobile app. It is mobile based
scheduling system gives farmers notification about various farming activities of
two crops wheat and paddy in regional language Punjabi. This overcomes language
barrier and farmers can get full benefit from it. This app also considers weather
conditions while notifying farmers and leads to sustainable farming.
The major operations which are performed by the aforesaid mobile based scheduling system
are:
 The app gives notifications of farming activities of two crops that is wheat and paddy.
 Each user has to first register himself and only then he can access the application.
 Register user can turn on the notifications for particular crop by entering the date of
sowing of crop.
 Register user can turn off the notifications any time.

15
 Registered user can also view upcoming activities of any month in advance.
 The app also provides basic information about the type of seeds recommended by
PAU, fertilizers.
 The user interface of app is in regional language Punjabi.
 Weather is displayed in regional language Punjabi to improve the understandability of
farmers of weather conditions.
 The administrator can view, update or delete information anytime through admin app.
Administrator can also enter new information.
The advantages of proposed system are:
 This mobile based app has simple easy to use user interface and farmers can operate
it easily.
 The app provides notification to user by considering weather conditions of his place.
This helps in sustainable use of resources.
 Improves the productivity of crops by assisting farmer in farming activities.
 Boon in today’s hectic life schedule.
 Detailed information about type of seeds, fertilizers.
 Easily accessed by users as smartphones are used by all these days.
 Helps in sustainable use of resources.
3.1.2 Feasibility Analysis
Feasibility analysis is used to analyze the strengths and weaknesses of a proposed
project, in order to improve a project and accomplish desired results. The nature and
components of feasibility studies depend largely on the areas in which examined projects are
implemented. Feasibility is defined as the practical level to which a project can be
accomplished successfully. To estimate feasibility, a feasibility study is executed, which
decides whether the solution considered is practical and feasible in the software. Information
such as resource accessibility, cost approximation for software development, benefits of the
software to the association after it is developed and cost to be acquired on its maintenance are
measured during the feasibility study. The objective of the feasibility study is to establish the
motives for developing the software that is adequate to users, flexible to change and
conformable to established standards. Feasibility Analysis contains the following points:
 Study the organizational system such as users, policies, functions and objectives.
 Problem with the present system like its redundancies, inconstancies and other
inadequacies in functionality and performance which are evaluated by interviewing
users of the system.
 After analyzing the present system, identifying main problems that are to be solved.
Identify different processes for solving problems.

16
 Different types of automation or computerization are considered to solve the existing
problems and finding possible alternatives.
 On the basis of advantages and disadvantages of each alternative, feasibility study is
analyzed to come out with the best alternative.
 The result is feasibility report for the project to be implemented.
Various types of feasibility that are commonly considered include technical feasibility,
operational feasibility and economic feasibility.
3.1.2.1 Technology and System Feasibility
The technical aspect discovers—if the project feasibility is within the boundaries of
current technology and does the technology exist at all, or if it is obtainable within given
resource constraints (i.e., budget, schedule). In the technical feasibility, the system experts
look between the necessities of the organization, such as,
 Input device which can enter a huge quantity of data in the effective time
 Output devices which can produce output in a bulk in an effective time
 The choice of processing unit depends upon the type of processing prerequisite in the
organization.
 Determine whether the technology used is stable and established.
 Ease of learning
The scheduling app is android based app which is very stable and established technology.
3.1.2.2 Operational Feasibility
Operational feasibility is a measure of how healthy a proposed system resolves the
problems, and takes benefit of the opportunities recognized during scope definition and how it
accomplishes the requirements recognized in the requirements analysis phase of system
development. Operational feasibility assesses the willingness of the organization to support
the proposed system. Operational feasibility is dependent on human resources available for
the project and involves projecting whether the system will be utilized if it is developed and
implemented.
As the user interface of app is in regional language Punjabi, it removes language
barrier and farmers will be more interested in using this app.
3.1.2.3 Economic feasibility
Economic analysis could also be stated as cost/benefit analysis. It is the most
regularly used method for evaluating the usefulness of a new system. In economic analysis
the procedure is to regulate the benefits and savings that are expected from an aspirant system
and compare them with costs. If profits compensate costs, then the decision is made to design
and implement the system.

17
The scheduling app improves the economic conditions of users (farmers) by
improving productivity of the crops. So it is economical to use this app as cost of smartphones
and internet access is very low these days.
3.1.3 Requirement Analysis
Requirements analysis comprises defining users’ needs and objectives in the
framework of planned customer use, environments, and recognized system characteristics to
determine necessities for system functions. Preceding analyses are studied and restructured,
refining mission and environment definitions to uphold system definition. The purpose of
Requirements Analysis is to:
 Enhance customer objectives and requirements.
 Define primary performance objectives and refine them into requirements;
 Identify and outline constraints that bound solutions.
 Define functional and performance requirements based on customer provided
measures of effectiveness.
3.1.3.1 Steps in the Requirement Analysis Process
i. Fix system boundaries
At this stage, scope of the proposed system is decided. As the scheduling app is in
regional language Punjabi so its scope are Punjabi farmers.
ii. Identify the customer
Next step in requirement analysis is to identify the ―users‖ of the software. This app
is designed for farmers so its main users are farmers who register themselves with the
app.
iii. Requirement gathering
In the requirement gathering stage, the information about various farming activities
and varieties of seeds, have been collected from PAU published books – Package of
Practices for the crops of Punjab and monthly magazine of PAU – Progressive
farming.
iv. Requirement Analysis Process
In this proposed system once all the user requirements have been gathered a
structured analysis and modelling of the requirements has done.
v. Requirement Specification
Requirement specification assists as an initial point for software and database design.
It terms the functions and performance of the system and the operational and user
interface constraints that will administrates system development. Software
Requirement Specification is a document which involves all the product requirements
to be designed and developed.

18
3.1.4 System Design
Based on the user requirements and the thorough analysis of a new system, the new
system must be designed. This is the stage of system designing. It is the most critical phase in
the development of a system. The rational system design arrived at as a result of system
analysis and is transformed into physical system design. In the design phase the SDLC
procedure continues to move from the what questions of the analysis phase to the how. The
logical design shaped during the analysis is revolved into a physical design - a detailed
description of what is required to solve original problem. Input, output, codification schemes
databases, forms and processing specifications are drawn up in detail. In the design stage, the
language to be used for programming and the hardware and software platform in which the
new system will run are also decided. There are several tools and methods used for describing
the system design of the system. These tools and procedures are: Flowchart, Data flow
diagram (DFD), Data dictionary, Structured English, Decision table and Decision tree.
3.1.4.1 Data Flow Diagram
Data Flow Diagram (DFD) is a two-dimensional diagram that describes how data is
processed and transmitted in a system. The graphical depiction recognizes each source of data
and how it interacts with other data sources to reach a mutual output. In order to draft a data
flow diagram one must
 Identify external inputs and outputs
 Determine how the inputs and outputs relate to each other
 Explain with graphics how these connections relate and what they result in.
Role of DFD:
 It is a documentation support which is understood by both programmers and non-
programmers. As DFD postulates only what processes are accomplished not how
they are performed.
 A physical DFD postulates where the data flows and who processes the data.
 It permits analyst to isolate areas of interest in the organization and study them by
examining the data that enter the process and viewing how they are altered when
they leave.
i. DFD for users
The thorough proposed DFD for users is shown in Fig 3.1. This DFD postulates those
functions which the user can perform and these functions are:
1. Registration for a new account.
2. Login into app through registered account.
3. View weather information in Punjabi.

19
4. View information about seeds of two crops, wheat and paddy, varieties of seeds
recommended by PAU.
5. View monthly schedule of wheat and paddy.
6. Set notification for farming activities.

Fig 3.1 DFD for users


ii. DFD for administrator
The detailed DFD of admin app is shown in Fig 3.2. DFD postulates the functions
which admin can perform and these are given below:
1. Add new information
2. View information of app
3. Update existing information
4. Delete existing information

Fig 3.2 DFD for admin

20
3.1.4.2 Design of database tables
Table Name: farmer
Description: The Table 3.1 contains login and registration information of the users. This
table has fields like f_id, f_name, f_password, f_conpass and f_contact which stores farmer’s
id, farmer’s name, password, confirm password and farmer’s contact number respectively.
When user registers himself, the information of the user is stored in this table. When user tries
to login by entering his contact number and password, their value is checked against entries in
this table and if values get matched then user can successfully login into app.

Table 3.1: Structure of farmer table

Table Name: admin


Description: The Table 3.2 contains login information of administrator. This table has only
one user that administrates the app.

Table 3.2: Structure of admin table

Table Name: wheatOct


Description: The Table 3.3 contains information about monthly schedule of wheat crop of
October month. It has two fields notId and not. Similar tables having same structure, as that of
wheatOct table, are made for each month to store information of that particular month.

Table 3.3: Structure of wheatOct table

21
Table Name: wheatseed
Description: The Table 3.4 contains information about the varieties of seed of wheat crop. It
has two fields seedId and seed. Similar table having same structure is made for paddy crop.

Table 3.4: Structure of wheatseed table

3.1.4.3 Strings.xml file


Some information is also written in string.xml file of android studio. Format of
string.xml file is:
<string name = ―name of string‖> text string </string>
Where attribute ―name‖ specifies the unique name of string by which string is identified and
―text string‖ is data stored under that name.

Fig 3.3 String.xml file

3.1.5 Coding
The system design needs to be employed in order to make it a workable system. This
leads to the coding of design into computer language, i.e., programming language. This is also
known as the programming phase in which the programmer translates the program
specifications into computer instructions, which are known as programs. It is a significant
stage where the defined procedures are transformed into control provisions by the help of a
computer language. The programs synchronize the data movements and control the complete

22
process in a system. A well transcribed code reduces the testing and maintenance effort. It is
usually felt that the programs must be segmental in nature. This helps in fast development,
maintenance and future variations, if required.
The scheduling app is an android based system. For coding Android Studio Integrated
development environment is used in whose backend core Java language is used and database
is created through MySQL server.
3.1.6 Testing
Testing is the procedure of evaluating a system or its module(s) with the intent to find
whether it fulfills the identified requirements or not. In additional words, testing is executing
a system in order to recognize any gaps, errors, or missing necessities in contrary to the actual
requirements. Beforehand actually implementing the new system into actions, a trial run of
the system is done eliminating all the bugs, if any. It is a vital phase of a successful system.
After organizing the entire programs of the system, a test plan should be developed and run
on a given set of test data. The output of the test run should meet the expected results. The
succeeding test run are carried out for current system:
3.1.6.1 Unit testing
3.1.6.2 Integration testing
3.1.6.3 Program testing
3.1.6.4 System testing
3.1.6.1 Unit testing
The objective of unit testing is to segregate each part of the program and show that
individual parts are accurate in terms of requirements and functionality.
In the current app, each module interface has been tested to ensure its proper functioning.
3.1.6.2 Integration testing
After unit testing integration testing that is the testing of collective parts of an
application is done to govern if they function properly that is to ensure that no error is there in
flow of information from one module to another.
3.1.6.3 Program testing
When the programs have been coded and compiled and carried to working conditions,
they must be independently tested with the equipped test data. All verification and validation
be checked and any disagreeable trend must be noted and debugged.
3.1.6.4 System testing
Finally the whole system is tested jointly to ensure that it fulfills user requirements.
At this stage the test is done on real data. The results are studied to ensure that app is error
free. If any error is faced it is corrected accordingly and further tested for expected output.
The aforesaid app is tested for proper functioning as a whole and it gave desired
result and satisfies user requirement.

23
3.1.7 Implementation
After having the user approval of the new system developed, the implementation
phase begins. Implementation is the phase of a project during which theory is turned into
practice. The major steps involved in this phase are:
 Attainment and Installation of Hardware and Software
 Conversion
 User Training
 Documentation
The scheduling app can be installed on any android based smartphone and its user
interface is so easy to operate that no user training is required.
3.1.8 Maintenance
Maintenance is essential to eradicate errors in the system during its working life and
to adjust the system to any deviations in its working environments. It must meet the
possibility of any future enhancement, future functionality and any other extra functional
features to cope up with the latest future needs. It has been seen that there are always few
errors found in the systems that must be noted and modified. It also means timely review of
the system. If a major alteration to a system is needed, a new project may need to be set up to
carry out the change. The new project will then go through all the above life cycle phases.
3.2 Proposed Software Tools
In the Requirement Analysis phase the requirements of the anticipated system are
identified and then converted into system design. In the design stage, the programming
language and the hardware and software platform in which the new system will run are also
decided. Following are the software tools proposed for the system development:
3.2.1 Android
Android is a mobile operating system (OS) based on the Linux kernel and developed
by Google. With a user interface based on direct manipulation, Android is designed primarily
for touchscreen mobile devices such as smartphones and tablet computers, with specialized
user interfaces for televisions (Android TV), cars (Android Auto), and wrist watches
(Android Wear). Android's default user interface is based on direct manipulation, using touch
inputs, that loosely correspond to real-world actions, like swiping, tapping, pinching, and
reverse pinching to manipulate on-screen objects, and a virtual keyboard. The response to
user input is designed to be immediate and provides a fluid touch interface, often using the
vibration capabilities of the device to provide hepatic feedback to the user. Internal hardware
such as accelerometers, gyroscopes and proximity sensors are used by some applications to
respond to additional user actions. Android comes with an Android market which is an online

24
software store. It allows Android users to select, and download applications developed by
third party developers and use them.
Android is open source and anyone can use it to build applications. Android provides
a rich application framework that allows one to build innovative apps and games for mobile
devices in a Java language environment. Android apps are built as a combination of distinct
components that can be invoked individually. For instance, an individual activity provides a
single screen for a user interface, and a service independently performs work in the
background. From one component one can start another component using an intent. One can
even start a component in a different app, such as an activity in a maps app to show an
address. This model provides multiple entry points for a single app and allows any app to
behave as a user's "default" for an action that other apps may invoke.
3.2.1.1 Application
Android apps are written in the Java programming language. The Android Software
development Kit(SDK) tools compile code—along with any data and resource files—into an
Android package (APK), which is an archive file with an .apk suffix. One APK file contains
all the contents of an Android app and is the file that Android-powered devices use to install
the app. Once installed on a device, each Android app lives in its own security sandbox:
 The Android operating system is a multi-user Linux system in which each app is a
different user.
 By default, the system assigns each app a unique Linux user Identity(ID). The system
sets permissions for all the files in an app so that only the user ID assigned to that app
can access them.
 Each process has its own virtual machine, so an app's code runs in isolation from
other apps.
 By default, every app runs in its own Linux process. Android starts the process when
any of the app's components need to be executed, then shuts down the process when
it's no longer needed or when the system must recover memory for other apps.
In this way, the Android system implements the principle of least privilege. That is, each app,
by default, has access only to the components that it requires to do its work and no more. This
creates a very secure environment in which an app cannot access parts of the system for
which it is not given permission.
i. App Components
App components are the essential building blocks of an Android app. Each
component is a different point through which the system can enter your app. Not all
components are actual entry points for the user and some depend on each other, but each one
exists as its own entity and plays a specific role—each one is a unique building block that

25
helps define app's overall behavior. There are four different types of app components. Each
type serves a distinct purpose and has a distinct lifecycle that defines how the component is
created and destroyed. The components are:
 Activities: An activity represents a single screen with a user interface. For example,
an email app might have one activity that shows a list of new emails, another activity
to compose an email, and another activity for reading emails. Although the activities
work together to form a cohesive user experience in the email app, each one is
independent of the others. As such, a different app can start any one of these activities
(if the email app allows it). For example, a camera app can start the activity in the
email app that composes new mail, in order for the user to share a picture.

Fig 3.4 Android Cycle


Android system initiates its program with in an Activity starting with a call on onCreate()
callback method. There is a sequence of callback methods that start up an activity and a
sequence of callback methods that tear down an activity.
 Services: A service is a component that runs in the background to perform long-
running operations or to perform work for remote processes. A service does not
provide a user interface. For example, a service might play music in the background
while the user is in a different app, or it might fetch data over the network without

26
blocking user interaction with an activity. Another component, such as an activity,
can start the service and let it run or bind to it in order to interact with it.
 Content Providers: A content provider manages a shared set of app data. One can
store the data in the file system, an SQLite database, on the web, or any other
persistent storage location app can access. Through the content provider, other apps
can query or even modify the data (if the content provider allows it). Content
providers are also useful for reading and writing data that is private to app and not
shared. For example, the Note Pad sample app uses a content provider to save notes.
A content provider is implemented as a subclass of ContentProvider and must
implement a standard set of APIs that enable other apps to perform transactions.
 Broadcast Receivers: A broadcast receiver is a component that responds to system-
wide broadcast announcements. Many broadcasts originate from the system—for
example, a broadcast announcing that the screen has turned off, the battery is low, or
a picture was captured. Apps can also initiate broadcasts—for example, to let other
apps know that some data has been downloaded to the device and is available for
them to use. Although broadcast receivers don't display a user interface, they may
create a status bar notification to alert the user when a broadcast event occurs. More
commonly, though, a broadcast receiver is just a "gateway" to other components and
is intended to do a very minimal amount of work. For instance, it might initiate a
service to perform some work based on the event. A broadcast receiver is
implemented as a subclass of BroadcastReceiver and each broadcast is delivered as an
Intent object.
ii. Activating Components
Three of the four component types—activities, services, and broadcast receivers—are
activated by an asynchronous message called an intent. Intents bind individual components to
each other at runtime, whether the component belongs to app or another.
Intent is created with an Intent object, which defines a message to activate either a
specific component or a specific type of component—intent can be either explicit or implicit,
respectively. For activities and services, intent defines the action to perform (for example, to
"view" or "send" something) and may specify the Uniform Resource Locator (URI) of the
data to act on (among other things that the component being started might need to know). For
example, intent might convey a request for an activity to show an image or to open a web
page. In some cases, one can start an activity to receive a result, in which case, the activity
also returns the result in an Intent. For broadcast receivers, the intent simply defines the
announcement being broadcast.
The other component type, content provider, is not activated by intents. Rather, it is
activated when targeted by a request from a ContentResolver. The content resolver handles all

27
direct transactions with the content provider so that the component that's performing
transactions with the provider doesn't need to and instead calls methods on the
ContentResolver object. This leaves a layer of abstraction between the content provider and
the component requesting information (for security). There are separate methods for
activating each type of component:
 One can start an activity by passing an Intent to startActivity() or
startActivityForResult() (when you want the activity to return a result).
 One can start a service (or give new instructions to an ongoing service) by passing an
Intent to startService(). Or one can bind to the service by passing an Intent to
bindService().
 One can initiate a broadcast by passing an Intent to methods like sendBroadcast(),
sendOrderedBroadcast(), or sendStickyBroadcast().
 One can perform a query to a content provider by calling query() on a
ContentResolver.
iii. The Manifest File
Before the Android system can start an app component, the system must know that the
component exists by reading the app's AndroidManifest.xml file (the "manifest" file). App
must declare all its components in this file, which must be at the root of the app project
directory. The manifest does a number of things in addition to declaring the app's
components, such as:
 Identify any user permissions the app requires, such as Internet access or read-access
to the user's contacts.
 Declare the minimum Application Programming Interface (API) Level required by
the app, based on which APIs the app uses.
 Declare hardware and software features used or required by the app, such as a
camera, bluetooth services, or a multitouch screen.
 API libraries the app needs to be linked against (other than the Android framework
APIs), such as the Google Maps library.
iv. App Resources
An Android app is composed of more than just code—it requires resources that are
separate from the source code, such as images, audio files, and anything relating to the visual
presentation of the app. For example, one should define animations, menus, styles, colors, and
the layout of activity user interfaces with XML (Xtensible Markup Language) files. Using
app resources makes it easy to update various characteristics of app without modifying code
and—by providing sets of alternative resources. For every resource that one include in

28
Android project, the SDK build tools define a unique integer ID, which one can use to
reference the resource from app code or from other resources defined in XML.
One of the most important aspects of providing resources separate from source code
is the ability for one to provide alternative resources for different device configurations. For
example, by defining user Interface(UI) strings in XML, one can translate the strings into
other languages and save those strings in separate files. Then, based on a language qualifier
that one append to the resource directory's name (such as res/values-fr/ for French string
values) and the user's language setting, the Android system applies the appropriate language
strings to UI.
3.2.1.2 User Interface (UI)
All user interface elements in an Android app are built using View and ViewGroup
objects. A View is an object that draws something on the screen that the user can interact
with. A ViewGroup is an object that holds other View (and ViewGroup) objects in order to
define the layout of the interface. Android provides a collection of both View and ViewGroup
subclasses that offer common input controls (such as buttons and text fields) and various
layout models.
i. Layout
A layout defines the visual structure for a user interface, such as the UI for an activity
or app widget. One can declare a layout in two ways:
 Declare UI elements in XML: Android provides a straightforward XML vocabulary
that corresponds to the View classes and subclasses, such as those for widgets and
layouts.
 Instantiate layout elements at runtime: Application can create View and ViewGroup
objects (and manipulate their properties) programmatically.
The Android framework gives one the flexibility to use either or both of these methods for
declaring and managing application's UI. For example, one could declare application's default
layouts in XML, including the screen elements that will appear in them and their properties
and then add code in application that would modify the state of the screen objects, including
those declared in XML, at run time.
The advantage to declaring UI in XML is that it enables one to better separate the
presentation of application from the code that controls its behavior. UI descriptions are
external to application code, which means that one can modify or adapt it without having to
modify source code and recompile. In general, the XML vocabulary for declaring UI elements
closely follows the structure and naming of the classes and methods, where element names
correspond to class names and attribute names correspond to methods. In fact, the
correspondence is often so direct that one can guess what XML attribute corresponds to a
class method, or guess what class corresponds to a given XML element.

29
ii. Input Controls
Input controls are the interactive components in app's user interface. Android
provides a wide variety of controls one can use in UI, such as buttons, text fields, seek bars,
checkboxes, zoom buttons, toggle buttons, and many more.
3.2.1.3 Android Architecture
Android operating system is a stack of software components which is roughly divided
in to five sections and four main layers as shown in Fig 3.5 architecture diagram.

Fig 3.5 Architecture of Android


 Linux Kernel: At the bottom of the layers is Linux - Linux 3.6 with approximately
115 patches. This provides a level of abstraction between the device hardware and it
contains all the essential hardware drivers like camera, keypad, display etc. Also, the
kernel handles all the things that Linux is really good at such as networking and a
vast array of device drivers, which take the pain out of interfacing to peripheral
hardware.
 Libraries: On top of Linux kernel there is a set of libraries including open-source
Web browser engine WebKit, well known library libc, SQLite database which is a
useful repository for storage and sharing of application data, libraries to play and
record audio and video, SSL libraries responsible for Internet security etc.
 Android Libraries: This category encompasses those Java-based libraries that are
specific to Android development. Examples of libraries in this category include the
application framework libraries in addition to those that facilitate user interface
building, graphics drawing and database access. A summary of some key core
Android libraries available to the Android developer is as follows −

30
 android.app − Provides access to the application model and is the cornerstone
of all Android applications.
 android.content − Facilitates content access, publishing and messaging
between applications and application components.
 android.database − Used to access data published by content providers and
includes SQLite database management classes.
 android.os − Provides applications with access to standard operating system
services including messages, system services and inter-process
communication.
 android.text − Used to render and manipulate text on a device display.
 android.view − The fundamental building blocks of application user
interfaces.
 android.widget − A rich collection of pre-built user interface components
such as buttons, labels, list views, layout managers, radio buttons etc.
 android.webkit − A set of classes intended to allow web-browsing
capabilities to be built into applications.
Having covered the Java-based core libraries in the Android runtime, it is now time to
turn our attention to the C/C++ based libraries contained in this layer of the Android
software stack.
 Android Runtime: This is the third section of the architecture and available on the
second layer from the bottom. This section provides a key component called Dalvik
Virtual Machine which is a kind of Java Virtual Machine (VM) specially designed
and optimized for Android. The Dalvik VM makes use of Linux core features like
memory management and multi-threading, which is intrinsic in the Java language.
The Dalvik VM enables every Android application to run in its own process, with its
own instance of the Dalvik virtual machine. The Android runtime also provides a set
of core libraries which enable Android application developers to write Android
applications using standard Java programming language.
 Application Framework: The Application Framework layer provides many higher-
level services to applications in the form of Java classes. Application developers are
allowed to make use of these services in their applications. The Android framework
includes the following key services –
i. Activity Manager − Controls all aspects of the application lifecycle and activity
stack.
ii. Content Providers − Allows applications to publish and share data with other
applications

31
iii. Resource Manager − Provides access to non-code embedded resources such as
strings, color settings and user interface layouts.
iv. Notifications Manager − Allows applications to display alerts and notifications
to the user.
v. View System − An extensible set of views used to create application user
interfaces.
 Applications: All the Android application are at the top layer. One will write own
application to be installed on this layer only. Examples of such applications are
Contacts Books, Browser, Games etc.
3.2.1.4 Programming Model
Model View Controller: Model-View-Controller (MVC) is a software architecture
architectural pattern. The model is the data, the view is the window on the screen, and the
controller is the glue between the two taking the data and presenting that to the view. In other
words, the MVC architectural pattern requires the isolation of business logic (Model) from
the user interface (View), with the Controller receiving user input and coordinating the other
two. This separation supports the modularization of an application's functionality and
provides the following benefits:
 Separation of Model from View components makes it possible to implement several
user interfaces that reuse the common core business logic.
 Duplication of low-level Model code is eliminated across multiple UI
implementations.
 Decoupling of Model and View code results in an improved ability to write unit tests
for the core business logic code.

Fig 3.6 Model View Controller


• Modularity of components allows core logic developers and UI developers to work
simultaneously without affecting the other.
Basically, it says that there are three distinct responsibilities for our application:

32
 Model: It manages the app data and state. Model is not concerned with user interface
or presentation. It persists somewhere and same model should be reused in different
interfaces. In android, model is content providers-data managers that are the
recommended form of inter-application data sharing.
 View: View presents the model to the user in an appropriate interface. It allows user
to manipulate data. View does not store any data except to cache state. It is easily
reusable and configurable to display different data. In android, view is activity. This
is the application’s primary user interface component. Every individual screen of an
Android application is derived from the Activity Java class.
 Controller: Controller is intermediary between model and view. It updates the view
when the model changes and also when the user manipulates the view. In android,
services act as controller. These are background components that behave like UNIX
daemons and windows services. They run invisibly and perform ongoing unattended
processing.
3.2.1.5 Development Tool
Android Studio 1.5 Preview has been used to develop the proposed scheduling app.
Android Studio is the official Integrated Development Environment (IDE) for Android app
development. On top of IntelliJ's powerful code editor and developer tools, Android Studio
offers even more features that enhance one’s productivity when building Android apps, such
as:
 A flexible Gradle-based build system
 A fast and feature-rich emulator
 A unified environment where one can app develop for all Android devices
 Instant Run to push changes to running app without building a new APK
 Code templates and GitHub integration to help build common app features and
import sample code
 Extensive testing tools and frameworks
 Lint tools to catch performance, usability, version compatibility, and other problems
 C++ and Native Development Kit (NDK) support
 Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud
Messaging and App Engine
Project Structure: Each project in Android Studio contains one or more modules with source
code files and resource files. Types of modules include:
 Android app modules
 Library modules
 Google App Engine modules

33
By default, Android Studio displays project files in the Android project view. This view is
organized by modules to provide quick access to your project's key source files. All the build
files are visible at the top level under Gradle Scripts and each app module contains the
following folders:
 manifests: Contains the AndroidManifest.xml file.
 java: Contains the Java source code files, including JUnit test code.
 res: Contains all non-code resources, such as XML layouts, UI strings, and bitmap
images.
One can also customize the view of the project files to focus on specific aspects of app
development.
i. Workflow of Android App
The workflow to develop an app for Android needs some specialized tools. The
following list provides an overview of the process used to build proposed app :

Fig 3.7 Work Flow of App Development


1. Set up Phase: Firstly Android Studio 1.5 Preview is installed and project is created.
2. Write app: Android Studio includes a variety of tools and intelligence to help work
faster, write quality code, design a UI and create resources for different device types.
The logic of app is implemented in this phase.

34
3. Build and Run: During this phase, the project is built into a debuggable APK
package that can be installed and run on the emulator or an Android-powered device.
4. Debug, profile and test: This is the iterative phase in which one continues writing
app but with a focus on eliminating bugs and optimizing app performance. Of course,
creating tests will help in those endeavors. To view and analyze various performance
metrics such as memory usage, network traffic, central processing unit impact, and
more, use Android Monitor. Then the built app is tested and debugged until it
satisfies all objectives.
5. Publish: Then built app is accessible by registering and then registered user can login
and access the app.
3.2.2 JavaScript Object Notation (JSON)
JSON is an open standard data exchange format based on a JavaScript syntax subset.
JSON is text-based, lightweight, and generally considered easily readable/writeable. Although
closely connected to JavaScript, JSON is language-independent. Though independent, JSON
uses conventions similar to other languages (e.g., C, C++, Java, Perl and Python), making
JSON an ideal data-exchange language. JSON characteristics include the following:
 Flexibility, allowing the programmer to define keys.
 Less overhead, as content is mostly data.
 Portable data.
 Non-proprietary.
 Common and convenient format for Web services.
JSON is preferred by some over XML as a data exchange format because it is less
verbose, works quickly, reduces data size and simplifies document processing. It is used
extensively in web development, especially because it seamlessly transfers information
between potentially incompatible technologies. For example, it could involve a Java
application running on a UNIX box or a C# application running on Windows.
JSON is a way that data can be stored in a structured format, where each piece of data
will usually have an identifier (known as a key) and a value (which can be in multiple
formats). It also can have a nested structure where a key can have multiple children (keys)
etc. It is often referred to as a JavaScript version of XML. The core reason for using JSON is
built around the concept of key value pairs (KVPs) which are ideal because they give one
very precise control over the specific data you want to look for or extract and manipulate.
JSON uses a subset of JavaScript for interchanging web services. As shown in Fig 3.8 firstly
JSON service request is generated to access data/service from service provider and service
provider then generates JSON service Response.

35
Fig 3.8 JSON structure
In the developed scheduling app JSON format is used to fetch data from weather API
response. In activity JSON request is created to access the URL of weather API and then
JSON response is used to read data returned by weather API.

Fig. 3.9 JSON CALL


JSON format is also used to insert data into database tables and to fetch data from
database tables in proposed app in register and login activity respectively. In developed app
data is read from MySQL database and is shown in an Android activity. To fetch data PHP
script is used which encodes data into JSON format. The main components are:
 MySQL database: MySQL is a freely available open source Relational Database
Management System (RDBMS) that uses Structured Query Language (SQL).
SQL is the most popular language for adding, accessing and managing content in
a database. It is most noted for its quick processing, proven reliability, ease and
flexibility of use. MySQL is most commonly used for Web applications and for
embedded applications and has become a popular alternative to proprietary
database systems because of its speed and reliability. MySQL can run on UNIX,

36
Windows and Mactonish OS. In the proposed system MySQL is used to create
database tables.
 PHP (Hypertext Preprocessor) web service: In the proposed system PHP script is
used to store and fetch data from the database over web services and also to
encode data in to JSON format.

37
CHAPTER IV
RESULTS AND DISCUSSION

Agriculture involves number of farming activities from sowing till harvesting. The
timing of all these farming activities, like sowing, irrigation, fertilization etc., plays an
important role in the productivity of the crop. If these activities are not performed at correct
time then it will have negative effect on the productivity of the crop and also resources get
exploited by unnecessary usage. The agriculture experts also emphasize on the importance of
proper timing of these farming activities. They even organized camps in villages to aware
farmers about this. But still most of the farmers do not know the importance of timely doing
of these activities or sometimes they even forget to perform them at appropriate time due to
their busy life schedule. As a result their hard work is not paid fruitfully.
Today is era of technology. Due to easy availability of smartphones and internet
everything is available just at a single click. So if all these information related to farming
activities is provided to farmers in proper organized way then they will be more interested in
using it. In order to channelize proper availability of information to the farmers the
scheduling app is developed that reminds farmers about various farming activities of two
crops, wheat and paddy, by giving notifications to them about timing of upcoming farming
activities. So that they can perform them on time and also make proper utilization of available
resources. This scheduling app also gives information about seeds recommended by PAU.
The farmer can select finest seed that is suitable to their farms and get benefitted by having
good yield. The app is developed in Punjabi concentrating on farmers of Punjab so that there
will not be any language barrier and more and more farmers are able to use it.
The scheduling app has been built in an effective and efficient way. On the basis of
requirements and the detailed analysis of the proposed system, the new app has been
designed. System analysis of the scheduling app involved comparing the deficiency of the
existing system and its practical usage to the advantages of the scheduling app. In order to
make this app easy for farmers to use, this app is developed in regional language Punjabi. The
requirements recognized in the Requirement Analysis phase were converted into a system
design that specifically described the proposal of the app and was used as an input to system
development in the next phase. This phase is the primarily step in moving from problem
domain to solution. In the design phase, the programming language and the hardware and
software requirements were decided.
4.1 Design of Activities of the user mobile app
The activities of app are designed very cautiously and every attempt is made to make
user interface as user friendly as possible because user interface is main channel of interaction
between farmers and the scheduling app. So it must be easy to use.
4.1.1 Login Activity
This is the first activity that opens when user installs the app. User needs to provide a
correct contact number and a password, which user enters while registering, in order to login
into the app. If information provided by the user matches with the data in the database table
then user successfully login into the app else message of login failed is displayed and user
need to reenter correct information. A link to the register activity is also provided for
registration of new users.

Fig 4.1 Login Activity

4.1.2 Registration Activity


A new user who wants to access the app needs to register first before login. By
clicking on register button in login activity, the register activity gets open. A new user
registers by entering full name, password and contact number. A user needs to enter password
again in confirm password textbox for confirmation. When user enters the information in all
textboxes, on the click of register button, the data is transferred to database table ―farmer‖ and

39
user is directed to login activity again. Registered user then needs to login in order to access
―Smart Khetibari‖ app.

Fig 4.2 Registration Activity

Validations are applied on all the textboxes for proper functioning of the app. Like
information in each textbox is must that is each textbox, either it is of name, contact,
password or confirm password, will not be empty while registering. If any such textbox is
empty app will give message of information is must in each textbox. Also data in password
and confirm password fields must match for successful registration. Another validation is
contact number must be valid one that is of 10 digits. If any such validation is violated then
registration will be unsuccessful and then user needs to register again. Fig 4.3 shows message
that app will display when one of the field is empty. If all such information is correct user will
be directed to login activity for login into the app.

40
Fig 4.3 Registration activity showing validation violated message

4.1.3 Home Activity


When registered user successfully login into app then user is directed to Home
activity. Home activity’s drawer provides user three options- weather, wheat and paddy.

Fig 4.4 Home Activity

41
4.1.4 Weather Fragment
By clicking on weather option in home activity’s drawer weather fragment gets open.
The weather is displayed in regional language Punjabi for improving the understandability of
farmer of weather.

Fig 4.5 Weather Fragment


Weather fragment displays the information like city name, date when weather is last updated,
description of weather, humidity and temperature. It also displays the image of description of
weather to give more clarity about weather condition. In right corner menu there is also
option of changing of city that is farmer can change the preferred location whose weather he
is interested in viewing.
4.1.5 Wheat Fragment
By clicking on wheat option in home activity drawer, user is directed to fragment
called wheat fragment. This fragment gives user three option either to set notification for
farming activities of wheat crop or to view monthly schedule of each month of wheat crop or
to view information about seeds of wheat recommended by PAU.

42
Fig 4.6 Wheat Fragment

4.1.6 Notification fragment


First option on wheat fragment is of setting notification about farming activities of
wheat crop. When this option is clicked, app opens new fragment through which user can first
select crop, then set sowing date of crop and after that set notification switch to on mode in
order to get notifications of upcoming farming activities. Fig 4.7 shows Notification Fragment
of wheat crop. Fig 4.8 shows notification in the notification panel generated by notification
fragment.

Fig. 4.7 Notification Fragment of Wheat

43
Fig. 4.8 Notification of Wheat Crop

User can also switch off the notifications of wheat, which user has set previously, anytime by
setting the switch again to off mode. App will display message about confirming the
switching off the notification. If yes button is pressed, then notifications will be switched off.
Fig 4.9 shows confirmation message that app generates in this case.

Fig. 4.9 Confirmation Message

44
After setting notification, if user again clicks on notification option or visits notification
fragment then Fig.4.10 confirmation message will be displayed by app. User can change date
of sowing by clicking on yes button.

Fig. 4.10 Confirmation message regarding changing of sowing date


4.1.7 After Notification Activity
When user clicks on notification in the notification panel, another activity opens that
displays weather based on latitude and longitude of the user, notification in detail and also
displays suggestions regarding farming activities according to weather conditions. Fig 4.11
shows after notification activity of wheat crop.

Fig. 4.11 After Notification Activity of Wheat

45
4.1.8 Schedule Wheat Activity

Fig. 4.12 Schedule Wheat Activity Fig. 4.13 Schedule of October

Fig 4.14 Schedule of November


Fig 4.15 Schedule of March

Second option on wheat fragment is of monthly schedule of wheat crop. By clicking


on it, it displays list of months from October to April as crop period of wheat is within this

46
time. Fig 4.12 shows schedule wheat activity. By clicking on any month, monthly schedule of
that month, that is farming activities to be performed in that month, is displayed. Fig 4.13
shows the monthly schedule activity of month of October. This activity gives information
about proper timing of performing various farming activities and also of proper quantity of
fertilizers and pesticides to be used. By clicking on back option user will be directed back to
wheat schedule activity, from there user can select any other month of crop period and can
view activities of that month or user can further go back to wheat fragment. Fig 4.14 and
Fig.4.15 show monthly schedule activity of November and March respectively.
4.1.9 Wheat seed activity
When user selects to view information about seeds of wheat recommended by PAU
then wheat seed activity gets open.

Fig. 4.16 Wheat Seed Activity


Depending on conditions and timing of sowing, seeds of wheat are categorized into three
types. Wheat seed activity provides link to three different activities through three buttons. By
clicking on any button new activity opens that displays information related to that specific
type which is mentioned above that button.
4.1.10 Wheat seed type1 activity
By clicking on first button of wheat seed activity, new activity wheat seed type1
opens up. This activity provides information about the seeds of wheat that is best suited for
sowing in area where proper irrigation facilities are available and for sowing on proper time.

47
Fig 4.17 Wheat Seed Type1 Activity
4.1.11 Wheat seed type2 Activity
By clicking on second button of wheat seed activity, new activity wheat seed type2
starts. This activity provides information about the seeds of wheat that is best suited for
sowing in area having proper irrigation facilities and for delayed sowing.

Fig. 4.18 Wheat Seed Type2 Activity

48
4.1.12 Wheat seed Type3 Activity
When user presses third button of wheat seed activity user is directed to the activity
called wheat seed type3. This activity displays information about seeds of wheat suitable for
sowing in areas having less irrigation facilities. Fig. 4.19 shows wheat seed type3 Activity.
There are three types of seeds of wheat that come under this category. Information related to
them is demonstrated in this activity. When user clicks on back button then user will be
directed to wheat seed activity again. From there user can either go back to wheat fragment or
can navigate forward to other wheat seed type activities.

Fig. 4.19 Wheat Seed Type3 Activity

4.1.13 Paddy Fragment


The third main option in drawer of home activity is of paddy. By clicking on this,
app opens paddy fragment. Same as wheat fragment paddy fragment also provides three
options either to set notifications of crop or to view monthly schedule of paddy or to view
seeds of paddy crop recommended by PAU.

49
Fig. 4.20 Paddy Fragment

4.1.14 Notification fragment of paddy


First option on paddy fragment is of setting notification about farming activities of
paddy crop. When this option is clicked, app opens new fragment through which user can
select crop, then set sowing date of paddy and then set notification switch in order to get
notification of upcoming farming activities. Fig 4.21 shows Notification Fragment of paddy
crop. Fig 4.22 shows notification in the notification panel generated by notification fragment.

Fig. 4.21 Notification Fragment of Paddy

50
Fig. 4.22 Notification in notification panel of paddy crop

User can also switch off the notifications of paddy, which user has set previously, anytime by
setting the switch again to off mode. App will display message about confirming the
switching off the notification. If yes button is pressed, then notifications will be switched off.
Fig 4.23 shows confirmation message that app generates in this case.

Fig. 4.23 Confirmation Message of Paddy Crop

51
After setting notification, if user again clicks on notification option or visits notification
fragment then Fig.4.24 confirmation message will be displayed by app. User can change date
of sowing by clicking on yes button.

Fig. 4.24 Confirmation message about changing of sowing date of Paddy


4.1.15 After Notification Activity
When user clicks on notification in the notification panel, another activity opens that
displays weather based on latitude and longitude of user, notification in detail and also
displays suggestions regarding farming activities by considering weather conditions.

Fig. 4.25 After Notification Activity of Paddy

52
4.1.16 Schedule Paddy Activity

Fig. 4.26 Schedule Paddy activity Fig. 4.27 Schedule of May

Fig 4.28 Schedule of June Fig 4.29 Schedule of September

Second option on Paddy fragment is of monthly schedule of paddy crop. By clicking


on it, it displays list of months from May to September as crop period of paddy is within this

53
time. Fig 4.26 shows schedule paddy activity. By clicking on any month, monthly schedule of
that month that is farming activities to be performed in that month is displayed. Fig 4.27
shows the monthly schedule activity of month of May. This activity gives information about
proper timing of doing various farming activities and also of proper quantity of fertilizers and
pesticides to be used. By clicking on back option user will be directed back on paddy
schedule activity, from there user can select any other month of crop period and can view
activities of that month or he can further go back to paddy fragment. Fig 4.28 and Fig.4.29
show monthly schedule activity of June and September respectively.
4.1.17 Paddy seed Activity
When user selects to view information about seeds of paddy recommended by PAU
then paddy seed activity gets open. This activity displays three different types of seeds of
paddy. Paddy seed activity provides link to three different activities through three buttons. By
clicking on any button new activity opens that displays information related to that specific
type which is mentioned above that button.

Fig. 4.30 Paddy Seed Activity

4.1.18 Paddy seed type1 activity


By clicking on first button of paddy seed activity, new activity paddy seed type1
opens. This activity provides information about the seeds of paddy recommended by PAU.

54
These are types of seeds of paddy that provide good yield. Fig. 4.31 shows paddy seed type1
activity. This activity provides basic information about these seeds and also timing of their
sowing.

Fig 4.31 Paddy seed type1 Activity


4.1.19 Paddy seed type2 Activity
By clicking on second button of paddy seed activity, new activity paddy seed type2
opens. This activity provides information about the seeds of paddy special type Basmati.

Fig. 4.32 Paddy seed type2 Activity

55
4.1.20 Paddy seed Type3 Activity
When user presses third button of paddy seed activity user is directed to the activity
called paddy seed type3. This activity displays information about seeds of Basmati. Fig. 4.33
shows paddy seed type3 Activity. When user clicks on back button then user will be directed
back to paddy seed activity again. From there user can either go back to paddy fragment or
can navigate forward to other paddy seed type activities.

Fig. 4.33 Paddy seed type3 Activity

4.2 Design of Activities of the admin mobile app


Administrator (admin) module of the app is used to update, delete old information or
to add new information. Design of various activities of admin app is as follows:
4.2.1 Login Activity
This is the first activity of the admin module of the app. The administrator needs to
login first in order to access the app. Admin can login by entering contact number and
password. Fig.4.34 shows login activity of admin app.

56
Fig 4.34 Login Activity of Admin
4.2.2 Home Activity
When admin successfully logins into app, home activity of the admin app gets open.
Home activity’s drawer provides admin various options and admin needs to select one out of
them, whose information admin wants to add or update. Fig 4.35 shows various options.

Fig 4.35 Drawer of Home Activity

57
4.2.3 Add New Information Activity
Admin can add new information related to monthly schedule of any month or of
seeds of wheat and paddy by clicking on appropriate option from drawer and activity of that
option gets open.

Fig 4.36 Activity for adding new seeds of wheat

Fig 4.37 Activity for adding new information of schedule of October

58
Similarly new information of any month can be added by selecting activity of that month
from home activity’s drawer and in the same way information related to seeds can be added.
This activity also provides link to view previous information.
4.2.4 Activity for viewing previous information
This activity displays all the previous information of selected month that is stored in
database. By clicking on any record admin gets two options either to delete the previous
entered information from the database or to update the previous entered information. Admin
can delete or update the information by clicking appropriate option.

Fig 4.38 Options for altering previous information


The developed app has two modules one is for users and other is for admin. Admin
has complete access to the data of the app. Admin can update or delete the previously stored
information from the database or can enter new information as well.
When the new user installs the app in his android smartphone user needs to register
first, as only registered user can access the app. Once the user gets registered user can login
into the app by entering the correct details and can have full access to the information of the
app. The app is mainly designed for two crops- wheat and paddy. Firstly user needs to select
one of the two crops. On selecting any crop out of the two, user gets further three options.
User can either set notifications for farming activities of selected crop or view a list of seeds
recommended by PAU of that crop or monthly schedule of selected crop.
By clicking on notification option, the farmer can set notifications for farming
activities of selected crop out of wheat and paddy. By setting date of sowing of crop user can
set notifications for upcoming farming schedule. The app will send notifications to the farmer,
time to time reminding farmer about timing of various activities related to crop. When user

59
clicks on notification in the notification panel then new page opens that displays weather
based on latitude and longitude of user as well as notification in detail. It also provides
suggestion to user related to activity by considering weather conditions. The app also shows
weather information in Punjabi.
When user clicks on PAU recommended seeds option, app displays list of all the
seeds of selected crop that are recommended by PAU for sowing. It also gives information
like correct time span of sowing of that variety of seed, yield per hectare of that variety and
other basic information like best suitable conditions for good productivity. Another feature of
app is that user can also view complete monthly schedule of selected crop from sowing till
harvesting that is list of all the farming activities to be performed within this period. When
any of the months is selected within crop period of that crop, then complete detail of farming
activities of that month is displayed by the app. It offers complete detail of correct timing of
doing any farming activity. The information about correct quantity of pesticides and fertilizers
to be used for selected crop is also provided by the app. This helps in avoiding wastage of
resources and also a step towards a sustainable agriculture.
The ―Smart Khetibari‖ app is an android based app and is developed using Android
Studio preview 1.5. Android Studio is the official Integrated Development Environment
(IDE) for Android app development. On top of IntelliJ's powerful code editor and developer
tools, Android Studio offers even more features that enhance one’s productivity when
building Android apps. It has a flexible gradle-based build system, fast and feature-rich
emulator and much more. The database of the app has been designed using MySQL. In the
proposed system PHP script is used to fetch the data from the database and to encode data in
to JSON format. Also insertion of data is done in the same way. Some data of the app is
written in string file which is in xml format. JSON format is used to read the data from
weather API and to display that data in the app. The most important feature of this app is that
it is developed in regional language Punjabi, thereby, overcoming the limitation of a lingual
barrier in using app.
There are number of agriculture related apps that provides various forms of
information about market prices of crops, weather, farm equipment to farmers. All these type
of information plays very important role in improving the productivity of crops. Agricultural
app development is one of the emerging fields these days. Every month one or another
agricultural app is coming in the market these days. But still there is no such app that
provides farmers the information about various farming activities in regional language
Punjabi. As accurate performing of farming activities plays very important role in agriculture.
If any such farming activity is delayed or not performed in correct manner it affects the yield
of crop. So ―Smart Khetibari‖ app is developed to provide such information to farmers. It
reminds farmers about various farming activities of two crops – wheat and rice, through

60
notifications. The app is developed in regional language Punjabi to overcome the language
problem of farmers. Because if farmer do not understand the language of the app then whole
information provided by app will be useless for him. Even weather displayed in this app is in
Punjabi to improve the understandability of farmer about weather and act accordingly. The
app not only provides notifications but also suggestions related to the farming activities by
considering weather conditions of the user’s place. This helps in avoiding wastage of
resources and proper utilization of resources leads to sustainable agriculture.
The developed app is an android based app. As android phones are available even at
low prices so it is easily affordable. Moreover, cost of internet access is also decreasing these
days so it is easily accessible too even in rural areas. This app is quite user friendly that it can
be functioned with mediocre intelligence and without any preliminary training. Also app is
easy to operate as compared to websites.

61
CHAPTER V

SUMMARY

The aim of the research titled ―Development of mobile based agriculture scheduling
system for farmers in regional language (Punjabi) using weather conditions‖ was to develop
agricultural scheduling system for farmers using mobile technology. It is an android based
app that could be easily used by farmers of Punjab as its user interface is in regional language
Punjabi. This app is mainly designed for two crops wheat and paddy. It provides the basic
information about the varieties of seeds, of these crops, recommended by PAU and also other
information such as suitable conditions and time of sowing of these varieties. So that farmer
can select that variety which is best suitable to his farm conditions and get good yield.
Another functionality of this app is that it provides monthly schedule of farming
activities of wheat and paddy crop. The information is displayed month wise and complete
detail is provided about timing of various farming activities like irrigation, fertilization etc.
The quantity of pesticides and fertilizers to be used is also provided by this app. So that the
over use of pesticides and fertilizers is avoided and soil degradation due to excessive use of
pesticides is avoided. The farmer can also set notification about the farming activities. App
will remind farmers by providing the notification for all the upcoming farming activities of
selected crop. This will improve the productivity of crop by notifying farmers about various
activities at appropriate time, as timely performing of these activities plays an important role
in productivity of crop. This app not only provides notification about upcoming farming
activity but also provides suggestions related to that activity by considering weather of user’s
place. As weather plays very important role in Indian agriculture so if farming activities are
performed by considering weather conditions it will be very useful and avoid wastage of
resources. App also displays weather in Punjabi on Home activity so that farmer can also
utilize this information by himself. So main features of this app are:
 Developed for two crops wheat and paddy.
 Provides basic information about varieties of seeds of these two crops recommended
by PAU.
 Provides monthly schedule of these two crops of various farming activities.
 Give notification for selected crop of upcoming farming activities.
 Displays weather in Punjabi.
 Helps in proper utilization of resources.
The research is completely explained in five chapters and can be summarized as follows:
Initially, the importance of agriculture based mobile apps is covered. As agriculture
based apps provides information to farmers with just a single tap of finger so they are quite
helpful for farmers and also in dissemination of information from researchers to farmers.
Decreasing costs of mobile phones and internet access makes smartphones part of day to day
life of everyone. So these days mobile apps are better way of providing latest information to
the farmers. Therefore farming schedule can be provided to farmers through app in regional
language Punjabi. In Chapter II, review of the related work is done. Study of various apps
related to agriculture that provides different type of information to farmers and how it helps
the farmers in improving the productivity of their crop is done. Chapter III defines the
materials and methodologies that have been used to develop the proposed app. The app is an
android based that is developed using Android Studio which is the official Integrated
Development Environment (IDE) for Android app development. Database is made in MySQL
and few data is embedded in app itself to make it work offline also. The result of development
work is covered in chapter IV. The aim of the research was to develop mobile based
agriculture scheduling system for farmers that provides basic information to farmers about
various farming activities by using weather conditions. The aim has been met successfully as
the app provides notification to farmers about farming activities by considering farming
activities and also provides information about seeds recommended by PAU. Also the lingual
barrier of farmers is overcome by developing user interface of app in Punjabi. Finally, the
research work is summarized in Chapter V and the scope of the future research work is
explained.
The developed app is complete and ready for implementation but every work has
scope for future improvement. The same is applied for this work also. So future scope of the
work is as follows:
i. Add more crops
This app is developed for two crops wheat and paddy. More crops like cotton, barley,
sugarcane can be added to provide farmers information farming activities of these
crops also.
ii. Display pictures
This app provides information about symptoms of various diseases of crops and how
to tackle them. But all this information is provided textually. Pictures of symptoms of
diseases can be added to this app to improve the understanding of farmers.
iii. Platform
This app is an android based app. So it operates only on android phone. Similar app
can be developed by changing platform that is instead of android windows, iOS or
any other platform.
iv. Another Language
This app is developed in regional language Punjabi so it is useful for farmers who
know Punjabi. Similar app can be developed in any other regional language.

63
v. Add more information
This app can be extended by adding more information related to agriculture like
market price of various crops, various farming equipment etc.
This app could be helpful for farmers as all the information related to various farming
activities is just available at the single tap of finger. App notifies farmers so that he can
perform all these activities at time and can improve the yield of his crop. The use of this app
also avoids wastage of resources. By using this app, farmers will use only required quantity of
fertilizers and pesticides and avoid over use of pesticides. Therefore it is a step towards
sustainable agriculture.

64
REFERENCES

Amirhossein A, Mehdi K, and Esmail K (2011) Effectiveness of rural ICT centers: A


perspective from west of Iran. Procedia Comput Sci 3:1184–88.

Android API Guides (2016).Retrieved from https://developer.android.com/guide/components.

Anonymous (2015) Package of Practices for Karif Crops. Pp 1-25. Punjab Agricultural
University, Ludhiana.

Anonymous (2016) Package of Practices for Rabi Crops. Pp 1-15. Punjab Agricultural
University, Ludhiana.

Bhalchandra B B, Waman W V (2014) Role of information technology in agriculture


marketing and its scope in Pune district. Int J Mgmt, IT Eng 4:199-210.

Caine A, Dorward P, Clarkson G, Evans N, Canales C, Stern D and Stern R (2016) Mobile
applications for weather and climate information: their use and potential for
smallholder farmers. Working Paper No. 150 CGIAR Research Program on Climate
Change, Agriculture and Food Security (CCAFS). Copenhagen Denmark.

De Silva H and Ratnadiwakara D (2005) Using ICT to Reduce Transaction Costs in


Agriculture through Better Communication: A Case-study from Sri Lanka. Colombo,
Sri Lanka: LIRNEasia, mimeo, 20.

Ghanshyam K, Pooja K, Pooja N and Yogita G (2016) AGRONOMY-An Android


Application Regarding Farmer Utility. J Emerging Tech Innov Res 3:86- 89.

Ghogare S A and Monga P M (2015) ―E-Agriculture‖ Introduction and Figuration of its


Application. Afr J Info Sys 4:120-36.

Gichamba A and Lukandu I A (2012) A model for designing M-agriculture applications for
dairy Intl J Adv Res Comput Sci Software Eng 5:44-47.

Kameswari V L V (2011) ICTS for Agrultural extension: A study in the Indian Himalayan
Region. The Electronic J Info Sys in Dev Countries 48:1-12. Retrieved from
http://www.ejisdc.org.

Lomotey R K, Jamal S, Chai Y and Deters R (2013) MobiCrop: Supporting Crop Farmers
with a Cloud-Enabled Mobile App. Proc 6th Service-Oriented Computing and
Applications.Vol 1, pp 182 – 89, Koloa, HI, USA.

Maumbe B M, and Okello J (2010) Uses of Information and Communication Technology


(ICT) in agriculture and rural development in sub-Saharan Africa: Experiences from
South Africa and Kenya. Int J ICT Res Dev in Afr 1:1-22.

Masuki K F G, Kamugisha R, Mowo J G, Tanui J, Tukahirwa J, Mogoi J and Adera E O


(2010) Role of mobile phones in improving communication and information delivery
for agricultural development: Lessons from South Western Uganda. Workshop at
Makerere University Pp 22-23 Makerere University, Uganda.

Mittal S and Tripathi G (2009) Role of mobile phone technology in improving small farm
productivity. Agr Econ Res Rev 22:451-59.

Mittal S, Gandhi S, and Tripathi G (2010) Socio-economic impact of mobile phones on


Indian agriculture. Working paper 246. Indian Council for Res on Int Econ Relations,
New Delhi.
Mohan J (2015), Importance of mobile in dissemination of Agriculture Information among
Indian Farmers . Intl J Emerging Techno in Computational App Sci 15: 75-79.

Prasad S, Peddoju S K and Ghosh D (2013) AgroMobile: A cloud-based framework for


Agriculturists on mobile platform. Int J Adv Sci Techno 59:41-52.

Qiang C Z and Kuek S C and Dymond A, Esselaar S and Unit, ICT Sector (2011) Mobile
applications for agriculture and rural development. World Bank, Washington, DC

Ramaraju G.V., Anurag, T.S. Singh, H. K. and Kumar S. (2011) ICT in agriculture: Gaps and
way forward. Info Tech in Dev Countries 21:17-21.

Razaque A, Chhachhar and Hassan M S (2013) The use of mobile phone among farmers for
agriculture development. Int J Scientific Res 2:95-98.

Saha B, Ali K, Basak P and Chaudhuri A (2012) Development of m-Sahayak- the innovative
android based application for real-timeassistance in Indian agriculture and health
sectors. Proc 6th International Conference on Mobile Ubiquitous Computing,
Systems, Services and Technologies. pp 133-137. Barcelona, Spain.

Sahota C (2009) Use of Mobile Phones in Agricultural Extension: A Study in Uttarakhand,


Unpublished M.Sc. Thesis, Department of Agricultural Communication, Govind
Ballabh Pant University of Agriculture & Technology, Pantnagar Uttarakhand, India.

Sharma S, Patodkar V, Simant S and Shah C (2015) E-Agro Android Application-Integrated


Farming Management Systems for sustainable development of farmers. Int J Eng Res
Gen Sci 3: 368-72.

Singh S K (2008) The diffusion of mobile phones in India. Telecommunications Policy 32:
642–51.

Yadav K (2011) Impact assessment of IC –enabled knowledge sharing agri-portals in


Uttarakhand. Ph.D thesis, Govind Ballabh Pant University of Agriculture &
Technology, Pantnagar Uttarakhand, India.

66
APPENDIX-I

content_login.xml

<?xml version="1.0" encoding="utf-8"?>


<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
cardView:cardElevation="2dp"
cardView:cardCornerRadius="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="2dp">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@drawable/regbck"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.ndhillon.farmerhelper.LoginActivity"
tools:showIn="@layout/activity_login">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:background="@drawable/login"
android:layout_marginTop="@dimen/activity_margin_top"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<EditText android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="ਆਪਣਾ ਮ੅ਬਾਇ਱ ਨੰਬਰ ਭਰ੅ "
android:inputType="number"
android:id="@+id/editLogContact"
android:layout_below="@+id/imageView"
android:layout_marginTop="@dimen/activity_margin_top" />
<EditText android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:hint="ਆਪਣਾ ਪਾਵਲ਼ਰਡ ਭਰ੅ "
android:ems="10"
android:id="@+id/editPassword"
android:layout_below="@+id/editLogContact"
android:layout_marginTop="@dimen/activity_margin_top" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="਱੆ ਗਗਨ"

i
android:id="@+id/buttonLogin"
android:layout_below="@+id/editPassword"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="40dp"
android:layout_marginStart="65dp"
android:layout_marginTop="42dp" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ਰਗਜਵਟਰ"
android:id="@+id/buttonReg"
android:layout_alignTop="@+id/buttonLogin"
android:layout_toRightOf="@+id/buttonLogin"
android:layout_toEndOf="@+id/buttonLogin"
android:layout_marginLeft="35dp"
android:layout_marginStart="42dp" />
</RelativeLayout>
</android.support.v7.widget.CardView>

LoginActivity.java

public class LoginActivity extends AppCompatActivity {


RequestQueue requestQueue;
JsonObjectRequest request;
HashMap<String, String> params;
ProgressDialog pd;
EditText edtLogContact, edtLogPassword;
Button btnLogin, btnReg;
RegBean regBean;
SharedPreferences preferences;
SharedPreferences.Editor editor;
void createJsonRequest() {
request = new JsonObjectRequest( Request.Method.POST,
"http://farmerhelper.site90.com/crop_scripts/login.php",new JSONObject(params),
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject jsonObject) {
pd.dismiss();
try { int i = jsonObject.getInt("success");
if (i == 1) {
Toast.makeText(LoginActivity.this,"਱੅ ਗਗਨ ਸ਼੅
ਗਗਆ",Toast.LENGTH_SHORT).show();
editor.putBoolean(Utils.pref_key, true);
editor.commit();
finish();
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
startActivity(intent);
finish();} else { pd.dismiss();
Toast.makeText(LoginActivity.this, "਱੅ ਗਗਨ ਨਸ਼ੀ ਸ਼੅ਇਆ,ਦੁਬਾਰਾ ਕਰ੅",
Toast.LENGTH_SHORT).show(); }} catch (JSONException e) {
e.printStackTrace();
Toast.makeText(LoginActivity.this, "Exception: " + e, Toast.LENGTH_SHORT).show();

ii
pd.dismiss();}} },
new Response.ErrorListener() {@Override
public void onErrorResponse(VolleyError volleyError) {
pd.dismiss();
Toast.makeText(LoginActivity.this, "Error" + volleyError, Toast.LENGTH_SHORT).show();
}});}
View.OnClickListener clickListener = new View.OnClickListener() {
@Override public void onClick(View v) {
int id = v.getId() ;
switch (id){
case R.id.buttonReg:
Intent i = new Intent(LoginActivity.this,RegisterActivity.class);
startActivity(i);
break;
case R.id.buttonLogin:
regBean.setContact(edtLogContact.getText().toString().trim());
regBean.setPassword(edtLogPassword.getText().toString().trim());
params.put("contact",regBean.getContact());
params.put("password",regBean.getPassword());
createJsonRequest();
pd = new ProgressDialog(LoginActivity.this);
pd.setMessage("ਗਕਰਪਾ ਕਰਕ੃ ਰੁਕ.੅ .");
pd.show();
requestQueue.add(request);
break; } }};
void initViews(){
edtLogContact = (EditText)findViewById(R.id.editLogContact);
edtLogPassword = (EditText)findViewById(R.id.editPassword);
btnLogin = (Button)findViewById(R.id.buttonLogin);
btnReg = (Button)findViewById(R.id.buttonReg);
btnLogin.setOnClickListener(clickListener);
btnReg.setOnClickListener(clickListener);
regBean = new RegBean();
preferences = getSharedPreferences(Utils.pref_name,MODE_PRIVATE);
editor = preferences.edit();}
@Override
protected void onCreate (Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.logo);
initViews();
requestQueue = Volley.newRequestQueue(this);
params = new HashMap<String,String>();}}

content_register.xml

<?xml version="1.0" encoding="utf-8"?>


<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"

iii
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
cardView:cardElevation="2dp"
cardView:cardCornerRadius="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="2dp">
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@drawable/regbck"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.ndhillon.farmerhelper.RegisterActivity"
tools:showIn="@layout/activity_register">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/registration"
android:id="@+id/imageView2"
android:layout_marginTop="35dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<EditText android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/editName"
android:hint="ਆਪਣਾ ਨਾਮ ਭਰ੅"
android:layout_below="@+id/imageView2"
android:layout_marginTop="30dp"
android:layout_alignRight="@+id/editRegPass"
android:layout_alignEnd="@+id/editRegPass" />
<EditText android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/editRegPass"
android:inputType="textPassword"
android:ems="10"
android:hint="ਆਪਣਾ ਪਾਵਲ਼ਰਡ ਭਰ੅"
android:layout_below="@+id/editName"
android:layout_marginTop="40dp" />
<EditText android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/editConPass"
android:inputType="textPassword"
android:ems="10"
android:hint="ਆਪਣਾ ਪਾਵਲ਼ਰਡ ਦੁਬਾਰਾ ਭਰ੅"
android:layout_below="@+id/editRegPass"
android:layout_marginTop="40dp" />

iv
<EditText android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/editContact"
android:inputType="number"
android:hint="ਆਪਣਾ ਮ੅ਬਾਇ਱ ਨੰਬਰ ਭਰ੅ "
android:layout_below="@+id/editConPass"
android:layout_marginTop="40dp" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ਦਬਾਓ"
android:id="@+id/btnSubmit"
android:layout_marginTop="@dimen/activity_margin_top"
android:layout_below="@+id/editContact"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
</ScrollView>
</android.support.v7.widget.CardView>

RegisterActivity.java

public class RegisterActivity extends AppCompatActivity {


RequestQueue requestQueue;
JsonObjectRequest request;
HashMap<String, String> params;
ProgressDialog pd;
RegBean regBean;
SharedPreferences preferences;
SharedPreferences.Editor editor;
void createJsonRequest() {
request = new JsonObjectRequest(Request.Method.POST,
"http://farmerhelper.site90.com/crop_scripts/insertfarmer.php",
new JSONObject(params),
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject jsonObject) {
pd.dismiss();
try {
int i = jsonObject.getInt("success");
String j = jsonObject.getString("message");
if (i == 1) {
Toast.makeText(RegisterActivity.this, "ਰਗਜਵਟਰ੃਴ਨ ਸ਼੅ ਗਈ,ਸ਼ੁਣ ਱੅ ਗਗਨ ਕਰ੅",
Toast.LENGTH_SHORT).show();
editor.putBoolean(Utils.pref_key, true);
editor.commit();
finish();
Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);
startActivity(intent);
finish();
} else {
pd.dismiss();

v
Toast.makeText(RegisterActivity.this, "ਰਗਜਵਟਰ੃਴ਨ ਨਸ਼ੀ ਸ਼੅ਈ,ਦੁਬਾਰਾ
ਕਰ੅",Toast.LENGTH_SHORT).show(); }}
catch (JSONException e) { e.printStackTrace();
Toast.makeText(RegisterActivity.this, "Exception: " + e, Toast.LENGTH_SHORT).show();
pd.dismiss(); } }},
new Response.ErrorListener() { @Override
public void onErrorResponse(VolleyError volleyError) {
pd.dismiss();
Toast.makeText(RegisterActivity.this, "Error" + volleyError, Toast.LENGTH_SHORT).show(); }} );}
EditText edtName, edtConPass, edtPassword, edtContact;
Button btn;
View.OnClickListener clickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.btnSubmit) {
regBean.setName(edtName.getText().toString().trim());
regBean.setConpass(edtConPass.getText().toString().trim());
regBean.setContact(edtContact.getText().toString().trim());
regBean.setPassword(edtPassword.getText().toString().trim());
if (regBean.name.isEmpty()) {
Toast.makeText(RegisterActivity.this, "ਆਪਣਾ ਨਾਮ ਭਰ੅", Toast.LENGTH_LONG).show();
} else if (regBean.password.isEmpty()) {
Toast.makeText(RegisterActivity.this, "ਆਪਣਾ ਪਾਵਲ਼ਰਡ ਭਰ੅", Toast.LENGTH_LONG).show();
} else if (regBean.contact.isEmpty()) {
Toast.makeText(RegisterActivity.this, "ਆਪਣਾ ਮ੅ਬਾਇ਱ ਨੰਬਰ ਭਰ੅ ",
Toast.LENGTH_LONG).show();
}else if (regBean.conpass.isEmpty()){
Toast.makeText(RegisterActivity.this,"ਆਪਣਾ ਪਾਵਲ਼ਰਡ ਭਰ੅",Toast.LENGTH_LONG).show();
}else if (regBean.contact.length() != 10) {
Toast.makeText(RegisterActivity.this, "ਵਸ਼ੀ ਮ੅ਬਾਇ਱ ਨੰਬਰ ਭਰ੅", Toast.LENGTH_LONG).show();
}else if (!regBean.password.equals(regBean.conpass)) {
Toast.makeText(RegisterActivity.this, "ਪਾਵਲ਼ਾਰਡ ਮ੃਱ ਨਸ਼ੀਂ ਖਾਂਦ੃", Toast.LENGTH_LONG).show();
}else { params.put("name", regBean.getName());
params.put("conpass", regBean.getConpass());
params.put("password", regBean.getPassword());
params.put("contact", regBean.getContact());
createJsonRequest();
pd = new ProgressDialog(RegisterActivity.this);
pd.setMessage("ਗਕਰਪਾ ਕਰਕ੃ ਰੁਕ.੅ .");
pd.show();
requestQueue.add(request); }}}};
void initViews() {
edtName = (EditText) findViewById(R.id.editName);
edtConPass = (EditText) findViewById(R.id.editConPass);
edtPassword = (EditText) findViewById(R.id.editRegPass);
edtContact = (EditText) findViewById(R.id.editContact);
btn = (Button) findViewById(R.id.btnSubmit);
btn.setOnClickListener(clickListener);
regBean = new RegBean();

vi
preferences = getSharedPreferences(Utils.pref_name, MODE_PRIVATE);
editor = preferences.edit();}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.logo);
initViews();
requestQueue = Volley.newRequestQueue(this);
params = new HashMap<String, String>();}

content_main.xml

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="@layout/app_bar_main">
</RelativeLayout>

MainActivity.java

import android.app.Fragment;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.text.InputType;
import android.view.View;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity


implements NavigationView.OnNavigationItemSelectedListener {

vii
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.logo);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction().replace(R.id.container, new weather()).commit();}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);}
@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {super.onBackPressed();}}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId() == R.id.change_city){
showInputDialog();}
return false;}
private void showInputDialog(){
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("਴ਗਸ਼ਰ ਬਦ਱੅ ");
final EditText input = new EditText(this);
input.setInputType(InputType.TYPE_CLASS_TEXT);
builder.setView(input);
builder.setPositiveButton("ਦਬਾਓ", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
changeCity(input.getText().toString());}});
builder.show();}
public void changeCity(String city) {
weather wf = (weather)getFragmentManager().findFragmentById(R.id.container);
wf.changeCity(city);
new CityPrefrence(this).setCity(city);}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_weather) {
getFragmentManager().beginTransaction().replace(R.id.container, new weather()).commit();

viii
} else if (id == R.id.nav_wheat) {
getFragmentManager().beginTransaction().replace(R.id.container, new wheat()).commit();}
else if (id == R.id.nav_paddy) {
getFragmentManager().beginTransaction().replace(R.id.container, new rice()).commit();}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;}}

weather.xml

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_margin_top">
<FrameLayout android:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp">
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="40dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/city_field"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:textSize="30sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
<TextView android:id="@+id/updated_field"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/city_field"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="13sp"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
</android.support.v7.widget.CardView>

ix
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="30dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/weather_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="70sp"
android:layout_gravity="center_horizontal" />
<TextView android:id="@+id/details_field"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/weather_icon"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_gravity="center_horizontal‖ />
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="30dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/current_temperature_field"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="40sp"
android:layout_gravity="center_horizontal" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</RelativeLayout>

x
Weather.java

import android.app.Fragment;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AlertDialog;
import android.text.InputType;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import org.json.JSONObject;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class weather extends Fragment {
Typeface weatherFont;
ProgressDialog pd;
TextView cityField;
TextView updatedField;
TextView detailsField;
TextView currentTemperatureField;
TextView weatherIcon;
int z;
long cityId;
String msg;
Handler handler;
public weather() {
handler = new Handler();}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.weather, container, false);
cityField = (TextView) rootView.findViewById(R.id.city_field);
updatedField = (TextView) rootView.findViewById(R.id.updated_field);
detailsField = (TextView) rootView.findViewById(R.id.details_field);
currentTemperatureField = (TextView) rootView.findViewById(R.id.current_temperature_field);
weatherIcon = (TextView) rootView.findViewById(R.id.weather_icon);
weatherIcon.setTypeface(weatherFont);
pd = new ProgressDialog(getActivity());
pd.setMessage("ਗਕਰਪਾ ਕਰਕ੃ ਰੁਕ.੅ .");
pd.show();
return rootView; }
@Override
public void onCreate(Bundle savedInstanceState) {

xi
super.onCreate(savedInstanceState);
weatherFont = Typeface.createFromAsset(getActivity().getAssets(), "font/weather.ttf");
updateWeatherData(new CityPrefrence(getActivity()).getCity());}
private void updateWeatherData(final String city) {
new Thread() {
public void run() {
final JSONObject json = RemoteFetch.getJSON(getActivity(), city);
if (json == null) {
handler.post(new Runnable() {
public void run() {
Toast.makeText(getActivity(),getActivity().getString(R.string.place_not_found),
Toast.LENGTH_LONG).show();
pd.dismiss();}});
} else {
handler.post(new Runnable() {
public void run() {
renderWeather(json);
pd.dismiss();
}});}}}.start();}
private void renderWeather(JSONObject json) {
try {cityId = json.getLong("id");
JSONObject details = json.getJSONArray("weather").getJSONObject(0);
JSONObject main = json.getJSONObject("main");
z = Integer.parseInt(details.getString("id"));
if (cityId == 1264728) {
cityField.setText(R.string.city1);
} else if (cityId == 1262578) {
cityField.setText(R.string.city2);
} else if (cityId == 1274746) {
cityField.setText(R.string.city3);
} else if (cityId == 1278710) {
cityField.setText(R.string.city4);
} else if (cityId == 1268782) {
cityField.setText(R.string.city5);
}else if (cityId == 1276070) {
cityField.setText(R.string.city6);}
else if (cityId==1264138){
cityField.setText(R.string.city7);}
else if (cityId==1279403){
cityField.setText(R.string.city8);}
else if (cityId==1271891){
cityField.setText(R.string.city9);}
else if (cityId==1271949){
cityField.setText(R.string.city10);}
else if (cityId==1271883){
cityField.setText(R.string.city11);}
else if (cityId==1262951){
cityField.setText(R.string.city12);}
else if (cityId==1260107){
cityField.setText(R.string.city13);}
else if (cityId==1257402){
cityField.setText(R.string.city14);}
else if (cityId==1262097){
cityField.setText(R.string.city15);}
else if (cityId==1261598){

xii
cityField.setText(R.string.city16);}
else if (cityId==1269937){
cityField.setText(R.string.city17);}
else if (cityId==1257951){
cityField.setText(R.string.city18);}
else if (cityId==6992326){
cityField.setText(R.string.city19);}
else if (cityId==1256087){
cityField.setText(R.string.city20);}
else if (cityId==2165798){
cityField.setText(R.string.city21);}
else if (cityId==4163971){
cityField.setText(R.string.city22);}
else {cityField.setText(json.getString("name"));}
switch (z) {
case 200: msg = getString(R.string.thunderstorm_light_rain);break;
case 201: msg = getString(R.string.thunderstorm_rain); break;
case 202: msg = getString(R.string.thunderstorm_heavy_rain); break;
case 210:msg = getString(R.string.thunderstorm); break;
case 211: msg = getString(R.string.thunderstorm); break;
case 212:msg = getString(R.string.thunderstorm); break;
case 221:msg = getString(R.string.thunderstorm); break;
case 230:msg = getString(R.string.thunderstorm_light_rain); break;
case 231: msg = getString(R.string.thunderstorm); break;
case 232:msg = getString(R.string.thunderstorm_heavy_rain); break;
case 300: msg = getString(R.string.light_rain); break;
case 301:msg = getString(R.string.moderate_rain); break;
case 302:msg = getString(R.string.heavy_rain); break;
case 312:msg = getString(R.string.heavy_rain); break;
case 310:msg = getString(R.string.light_rain); break;
case 311: msg = getString(R.string.light_rain); break;
case 313:msg = getString(R.string.light_rain); break;
case 321:msg = getString(R.string.light_rain); break;
case 314:msg = getString(R.string.heavy_rain); break;
case 500: msg = getString(R.string.light_rain); break;
case 501: msg = getString(R.string.moderate_rain); break;
case 502: msg = getString(R.string.heavy_rain); break;
case 503:msg = getString(R.string.heavy_rain); break;
case 504: msg = getString(R.string.heavy_rain); break;
case 511: msg = getString(R.string.light_rain); break;
case 520: msg = getString(R.string.light_rain); break;
case 521: msg = getString(R.string.light_rain); break;
case 522: msg = getString(R.string.heavy_rain); break;
case 531: msg = getString(R.string.heavy_rain); break;
case 800:msg = getString(R.string.clear_sky); break;
case 801: msg = getString(R.string.scattered_clouds); break;
case 803: msg = getString(R.string.broken_clouds); break;
default: msg = getString(R.string.clear_sky); break;
detailsField.setText(msg +"\n" + "ਨਮੀ: " + main.getString("humidity") + "%");
currentTemperatureField.setText(String.format("%.2f", main.getDouble("temp")) + " ℃");
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
DateFormat df = DateFormat.getDateTimeInstance();
String updatedOn = sdf.format(new Date(json.getLong("dt") * 1000));
updatedField.setText("ਗਪਛ਱੃ ਅੱ ਪਡ੃ਟ ਕੀਤਾ : " + updatedOn + " ");

xiii
setWeatherIcon(details.getInt("id"), json.getJSONObject("sys").getLong("sunrise") * 1000,
json.getJSONObject("sys").getLong("sunset") * 1000);} catch (Exception e) {
Log.e("SimpleWeather", "One or more fields not found in the JSON data");}}
private void setWeatherIcon(int actualId, long sunrise, long sunset) {int id = actualId / 100;
String icon = ""; if (actualId == 800) {
long currentTime = new Date().getTime();
if (currentTime >= sunrise && currentTime < sunset) {
icon = getActivity().getString(R.string.weather_sunny);
} else { icon = getActivity().getString(R.string.weather_clear_night);
}} else {switch (id) {
case 2: icon = getActivity().getString(R.string.weather_thunder); break;
case 3: icon = getActivity().getString(R.string.weather_drizzle); break;
case 7:icon = getActivity().getString(R.string.weather_foggy); break;
case 8: icon = getActivity().getString(R.string.weather_cloudy); break;
case 6: icon = getActivity().getString(R.string.weather_snowy); break;
case 5: icon = getActivity().getString(R.string.weather_rainy); break;}} weatherIcon.setText(icon);
} public void changeCity(String city) {updateWeatherData(city);}}

RemoteFetch.java

import android.content.Context;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class RemoteFetch {private static final String OPEN_WEATHER_MAP_API =
"http://api.openweathermap.org/data/2.5/weather?q=%s+city&units=metric";
public static JSONObject getJSON(Context context, String city){
try {URL url = new URL(String.format(OPEN_WEATHER_MAP_API, city));
HttpURLConnection connection =
(HttpURLConnection)url.openConnection();connection.addRequestProperty("x-api-key";
context.getString(R.string.open_weather_maps_app_id)); BufferedReader reader = new
BufferedReader(new InputStreamReader(connection.getInputStream()));
StringBuffer json = new StringBuffer(1024);String tmp="";
while((tmp=reader.readLine())!=null)json.append(tmp).append("\n");
reader.close();JSONObject data = new JSONObject(json.toString());
if(data.getInt("cod") != 200){ return null;} return data;
}catch(Exception e){return null;}}}

CityPrefrence.java

import android.app.Activity;
import android.content.SharedPreferences;
public class CityPrefrence {
SharedPreferences prefs;
public CityPrefrence(Activity activity){
prefs = activity.getPreferences(Activity.MODE_PRIVATE);
}String getCity(); return prefs.getString("city", "muktsar");}
void setCity(String city);prefs.edit().putString("city", city).commit();}}

RegBean.java

import java.io.Serializable;
public class RegBean implements Serializable {

xiv
String name,password,conpass,contact;
public RegBean() {}
public RegBean(String name, String conpass, String password, String contact) {
this.name = name; this.conpass = conpass;
this.password = password;this.contact = contact; }
public String getName() { return name;}
public void setName(String name) {this.name = name;}
public String getConpass() { return conpass; }
public void setConpass(String conpass) {this.conpass = conpass;}
public String getPassword() {return password; }
public void setPassword(String password) {this.password = password;}
public String getContact() {return contact;}
public void setContact(String contact) {this.contact = contact;}}

wheat.xml

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.ndhillon.farmerhelper.ScheduleWheat">
<ListView android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/listView"
android:background="#CCFFCC"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/activity_margin_top" />
</RelativeLayout>

wheat.java

import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import java.util.ArrayList;
public class wheat extends Fragment {
ListView lv;
ArrayList<String> list;
ArrayAdapter<String> adapter;
AdapterView.OnItemClickListener clickListener = new AdapterView.OnItemClickListener() {
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String str = list.get(position);Fragment newFragment;
FragmentTransaction transaction = getFragmentManager().beginTransaction();

xv
switch (position){
case 2:Intent intent2 = new Intent(getActivity(),wheatseed.class);
startActivity(intent2);break;
case 1:Intent intent = new Intent(getActivity(),ScheduleWheat.class);
startActivity(intent); break;
case 0: newFragment = new notFrag();
transaction.replace(R.id.container, newFragment);transaction.addToBackStack(null);
transaction.commit();break;}}};
void initList(){
list = new ArrayList<String>();
list.add("ਨੋਟੀਗਿਕ੄ਸ਼ਨ");list.add("ਖ੃ਤੀ ਰੁਝ੃ਲ਼"੃ );
list.add("ਪੰ ਜਾਬ ਖ੃ਤੀਬਾੜੀ ਯੂਨੀਲ਼ਰਗਵਟੀ ਦੀਆਂ ਗਵ੝ਾਰ਴ੀ ਗਕਵਮਾਂ ");
adapter ArrayAdapter<String>(getActivity(),android.R.layout.simple_list_item_1,list);
lv.setAdapter(adapter); lv.setOnItemClickListener(clickListener); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
savedInstanceState) {View myView = inflater.inflate(R.layout.wheat,container,false);
lv=(ListView)myView.findViewById(R.id.listView);initList(); return myView; }

notfrag.xml

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/activity_margin_top">
<FrameLayout android:id="@+id/container2"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="5dp" >
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="40dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<Spinner android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/spinnerCrop"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_gravity="center_horizontal"
android:textSize="40sp"
android:layout_marginTop="15dp" />
</LinearLayout>
</android.support.v7.widget.CardView>

xvi
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="40dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="ਬਟਨ ਤ੃ ਕਗ਱ਕ ਕਰਕ੃ ਬੀਜਾਈ ਦੀ ਤਾਰੀਕ ਤ੄ਅ ਕਰ੅"
android:id="@+id/textSowDate"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="ਤਾਰੀਕ ਚੁਣ੅"
android:id="@+id/btnSowDate"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="40dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<Switch android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="ਨੋਟੀਗਿਕ੄ਸ਼ਨ"
android:id="@+id/switch1"
android:layout_gravity="center_horizontal"/>
</LinearLayout></android.support.v7.widget.CardView></LinearLayout></RelativeLayout>

notFrag.java

import android.app.AlarmManager;
import android.app.DatePickerDialog;

xvii
import android.app.Fragment;
import android.app.PendingIntent;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.provider.Settings;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.DatePicker;
import android.widget.Spinner;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
public class notFrag extends Fragment {
Spinner spCrop;Switch aSwitch;
ArrayAdapter<String> adapter;
ArrayList<String> cropList;
String str="";String url;
private HandleXmlWheat obj;
ArrayList<WheatBeanNot> list;
SharedPreferences preferences;
SharedPreferences.Editor editor;
DatePickerDialog dpd;
Button b1;TextView t1;
String dateOfSowing; String time,notTime;
int dd,mm,yy;Calendar cal;Boolean switchState;AlertDialog dialog;
View.OnClickListener clickListener = new View.OnClickListener() {
@Override public void onClick(View v) {showDatePickerDialog();}};
void loadDataInSpinner() {cropList = new ArrayList<String>();
cropList.add("--ਿਵ਱ ਚੁਣ੅--");cropList.add("ਕਣਕ");
adapter = new ArrayAdapter<String>(getActivity(),
android.R.layout.simple_spinner_dropdown_item, cropList); spCrop.setAdapter(adapter);
spCrop.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
@Overrid public void onItemSelected(AdapterView<?> parent, View view, int position, long id) ;
str = cropList.get(position);}
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container2, Bundle
savedInstanceState) {View view=inflater.inflate(R.layout.notfrag,container2,false);
spCrop = (Spinner) view.findViewById(R.id.spinnerCrop);
aSwitch = (Switch) view.findViewById(R.id.switch1);
aSwitch.setOnCheckedChangeListener(checkedChangeListener);
b1 = (Button) view.findViewById(R.id.btnSowDate); b1.setOnClickListener(clickListener);

xviii
t1 = (TextView) view.findViewById(R.id.textSowDate);loadDataInSpinner();
preferences = this.getActivity().getSharedPreferences(Utils.pref_not,Context.MODE_PRIVATE);
editor= preferences.edit();switchState = preferences.getBoolean("StateOfSwitch",false);
if (switchState){showAlertDialog(); }
return view;}void showAlertDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());builder.setTitle("ਵੂਚਨਾ");
builder.setMessage("ਬੀਜਾਈ ਦੀ ਤਾਰੀਕ ਤੁਵੀਂ ਤ੄ਅ ਕਰ ਚੁੱ ਕ੃ ਸ਼੅,ਕੀ ਤੁਵੀਂ ਬੀਜਾਈ ਦੀ ਤਾਰੀਕ ਬਦਲਣੀ ਚਾਸ਼ੁੰ ਦ੃
ਸ਼੅");
builder.setCancelable(false);builder.setPositiveButton("ਸ਼ਾਂ", new DialogInterface.OnClickListener()
{ @Override public void onClick(DialogInterface dialog, int which) {
aSwitch.setChecked(false);switchState = false; }});
builder.setNegativeButton("ਨਸ਼ੀਂ", new DialogInterface.OnClickListener() { @Override
public void onClick(DialogInterface dialog, int which) {aSwitch.setChecked(true);
editor.putBoolean("StateOfSwitch", true);editor.commit();}});
dialog = builder.create();dialog.show(); }
void CancelDialog() {AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle("ਜ਼ਰੂਰੀ ਵੂਚਨਾ"); builder.setMessage("ਕੀ ਤੁਵੀਂ ਕਣਕ ਦੀਆਂ ਵੂਚਨਾਲ਼ਾਂ ਬੰ ਦ ਕਰਣਾ ਚਾਸ਼ੁੰ ਦ੃
ਸ਼੅?");builder.setCancelable(false); builder.setPositiveButton("ਸ਼ਾਂ", new
DialogInterface.OnClickListener() {
@Override public void onClick(DialogInterface dialog, int which) {
aSwitch.setChecked(false);switchState = false;}});
builder.setNegativeButton("ਨਸ਼ੀਂ", new DialogInterface.OnClickListener() {@Override
public void onClick(DialogInterface dialog, int which) {aSwitch.setChecked(true);
editor.putBoolean("StateOfSwitch", true);editor.commit();}});
dialog = builder.create();dialog.show(); }
void readFromServer() {Calendar c = Calendar.getInstance();
int month = c.get(Calendar.MONTH); if (str.equals("ਕਣਕ")) {
url = http://farmerhelper.site90.com/crop_scripts/wheatpunjabi_9.xml;}
obj = new HandleXmlWheat(url);obj.fetchXML();while (obj.parsingComplete) ;
list = obj.getWheatlist();WheatBeanNot wbn = list.get(0);time = wbn.getTime();
editor.putString("not", wbn.getNot());
editor.putString("message",getResources().getString(R.string.wNot1));
editor.putString("time", wbn.getTime());editor.putInt("dateOfSowing_day",dd);
editor.putInt("dateOfSowing_month", mm);editor.putInt("dateOfSowing_year",yy);
editor.putString("url",url);editor.commit();try {notDate();} catch (ParseException e) {
e.printStackTrace();}}
public CompoundButton.OnCheckedChangeListener checkedChangeListener = new
CompoundButton.OnCheckedChangeListener() {@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {if(!switchState) {readFromServer(); setNotification();
editor.putBoolean("StateOfSwitch", true);editor.commit(); }
}else {CancelDialog();}}};
public void notDate() throws ParseException {String dt = dateOfSowing;// Start date
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");cal = Calendar.getInstance();
cal.set(Calendar.DAY_OF_MONTH,dd);cal.set(Calendar.MONTH, mm);cal.set(Calendar.YEAR, yy);
try {cal.setTime(sdf.parse(dt));} catch (ParseException e) {e.printStackTrace(); }
notTime = sdf.format(cal.getTime());cal.add(Calendar.DATE, Integer.parseInt(time)); notTime =
sdf.format(cal.getTime());}void showDatePickerDialog() {
Calendar c = Calendar.getInstance();yy = c.get(Calendar.YEAR);mm = c.get(Calendar.MONTH);
dd = c.get(Calendar.DAY_OF_MONTH);dpd = new DatePickerDialog(getActivity(), dateSetListener,

xix
yy, mm, dd);dpd.show();}
DatePickerDialog.OnDateSetListener dateSetListener = new DatePickerDialog.OnDateSetListener()
{@Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
dateOfSowing = dayOfMonth + "/" + (monthOfYear + 1) + "/" + year;dd = dayOfMonth;
mm = monthOfYear;yy = year; t1.setText(dateOfSowing); } };
public void setNotification(){cal.set(Calendar.HOUR_OF_DAY,8);
cal.set(Calendar.MINUTE, 00);cal.set(Calendar.SECOND, 00);Intent n = new Intent("a.b.c.d");
PendingIntent pi = PendingIntent.getBroadcast(getActivity(), 0 , n,
PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager am = (AlarmManager) getActivity().getSystemService(Context.ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP,cal.getTimeInMillis(),pi);}}

Notification.java

import android.app.AlarmManager;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import android.widget.Toast;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
public class Notification extends BroadcastReceiver {
SharedPreferences preferences;SharedPreferences.Editor editor;
String msg,notValue, url,time,timeToAdd,finalT;HandleXmlWheat obj;
ArrayList<WheatBeanNot> list;Calendar cal,c; int dd,yy,mm; Context cxt;
@Override public void onReceive(Context context, Intent intent) {
preferences = context.getSharedPreferences(Utils.pref_not,Context.MODE_PRIVATE);
editor = preferences.edit();msg= preferences.getString("message", "No notification");
notValue=preferences.getString("not","No notification id");preferences.getString("time","No time ");
dd = preferences.getInt("dateOfSowing_day",0);mm = preferences.getInt("dateOfSowing_month",0);
yy =preferences.getInt("dateOfSowing_year",0);url= preferences.getString("url","url of crop");
cxt = context;showNotification(context);retrieveAgain();}
private void showNotification(Context context) {Log.i("notification", "visible");
PendingIntent contentIntent = PendingIntent.getActivity(context, 0,new Intent(context,
AfterNotification.class).putExtra("key",msg),PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder mBuilder = new
NotificationCompat.Builder(context).setSmallIcon(R.mipmap.ic_launcher).setContentTitle("ਵਮਾਰਟ
ਖ੃ਤੀਬਾੜੀ").setContentText(msg);
mBuilder.setContentIntent(contentIntent);mBuilder.setAutoCancel(true);
NotificationManager mNotificationManager = (NotificationManager)
context.getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(1, mBuilder.build());} void retrieveAgain() {obj = new
HandleXmlWheat(url);obj.fetchXML();
while (obj.parsingComplete) ; list = obj.getWheatlist(); int x= Integer.parseInt(notValue)+1;
WheatBeanNot wbn = list.get(x - 1);timeToAdd = wbn.getTime();
editor.putString("not",wbn.getNot()); c = Calendar.getInstance(); int z = c.get(Calendar.MONTH);
switch (z){case 5:dec(x); break;

xx
default: Toast.makeText(cxt,"u have selected wrong month",Toast.LENGTH_SHORT).show();break;}
editor.putString("time", wbn.getTime());editor.commit();try {notDate();} catch (ParseException e)
{e.printStackTrace();}}
void dec(int y){switch (y) {
case 2:editor.putString("message", cxt.getResources().getString(R.string.wNot2));editor.commit();
break;case 3:editor.putString("message", cxt.getResources().getString(R.string.wNot3));
editor.commit(); break;}}public void notDate() throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");cal = Calendar.getInstance();
cal.set(Calendar.DAY_OF_MONTH,dd);cal.set(Calendar.MONTH,mm);cal.set(Calendar.YEAR,yy);
cal.add(Calendar.DATE, Integer.parseInt(timeToAdd));finalT = sdf.format(cal.getTime());
cal.set(Calendar.HOUR_OF_DAY, 8);cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);Intent n = new Intent("a.b.c.d");
PendingIntent pi = PendingIntent.getBroadcast(cxt, 0, n,PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager am = (AlarmManager)cxt.getSystemService(Context.ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pi);}}

content_after_notification.xml

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.ndhillon.farmerhelper.AfterNotification"
tools:showIn="@layout/activity_after_notification">
<ScrollView android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="40dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/Notcity_field"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:textSize="30sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>

xxi
<TextView android:id="@+id/weather_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="70sp"
android:layout_gravity="center_horizontal" />
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:id="@+id/textAfterNot"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout></android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="30dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="6dip"
android:background="#CCFFCC">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:id="@+id/textAfterNot2"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout> </android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="30dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="6dip"
android:background="#CCFFCC">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:id="@+id/textAfterNot3"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout></android.support.v7.widget.CardView></LinearLayout></ScrollView>
</RelativeLayout>

xxii
AfterNotification.java

import android.Manifest;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Typeface;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.provider.Settings;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.net.URL;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
public class AfterNotification extends AppCompatActivity implements LocationListener {
TextView textView, txt,txt1,txt2;
TextView weatherIcon;Typeface weatherFont;
String not;AlertDialog dialog;
RequestQueue requestQueue;
JsonObjectRequest request;
HashMap<String, String> params;
LocationManager locationManager;
String city;long NotCityId; int z;URL url;
ProgressDialog pd;Boolean check;
void showAlertDialog() {AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("ਜੀ.ਪੀ.ਐਵ. ਬੰ ਦ ਸ਼੄"); builder.setMessage("ਗਿ੍ਰਪਾ ਕਰਕ੃ ਜੀ.ਪੀ.ਐਵ. ਔਨ ਕਰ੅।");
builder.setCancelable(false);

xxiii
builder.setPositiveButton("ਜੀ.ਪੀ.ਐਵ. ਚ਱ਾਓ", new DialogInterface.OnClickListener() {
@Override public void onClick(DialogInterface dialog, int which) {
Intent i = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);startActivity(i);}});
builder.setNegativeButton("ਜੀ.ਪੀ.ਐਵ. ਨਾ ਚ਱ਾਓ", new DialogInterface.OnClickListener() {
@Override public void onClick(DialogInterface dialog, int which) {dialog.dismiss(); finish();}});
dialog = builder.create();dialog.show();}
void createJsonRequest() {request = new JsonObjectRequest(Request.Method.POST,
"http://api.openweathermap.org/data/2.5/weather?q=%city&APPID=f98be727697ba571c043b32573d
f71b3&units=metric", new JSONObject(params),new Response.Listener<JSONObject>() {
@Override public void onResponse(JSONObject jsonObject) { pd.dismiss();try {
NotCityId= jsonObject.getLong("id");
Log.e("Weather data", " " + jsonObject.get("base").toString());
JSONArray ary = jsonObject.getJSONArray("weather");JSONObject obj = new
JSONObject(ary.get(0).toString());z = Integer.parseInt(obj.getString("id"));
JSONObject coord = jsonObject.getJSONObject("main"); if (NotCityId == 1264728) {
txt.setText(R.string.city1);} else if (NotCityId == 1262578) { txt.setText(R.string.city2);
} else if (NotCityId == 1274746) { txt.setText(R.string.city3)} else if (NotCityId == 1278710) {
txt.setText(R.string.city4);} else if (NotCityId == 1268782) {txt.setText(R.string.city5); }
else if (NotCityId== 1276070) {txt.setText(R.string.city6);}else if (NotCityId==1264138){
txt.setText(R.string.city7);else if (NotCityId==1279403){txt.setText(R.string.city8);}
else if (NotCityId==1271891){ txt.setText(R.string.city9);}else if (NotCityId==1271949){
txt.setText(R.string.city10);}else if (NotCityId==1271883){txt.setText(R.string.city11);}
else if (NotCityId==1262951){txt.setText(R.string.city12);}else if (NotCityId==1260107){
txt.setText(R.string.city13);}else if (NotCityId==1257402){txt.setText(R.string.city14);}
else if (NotCityId==1262097){ txt.setText(R.string.city15);}else if (NotCityId==1261598){
txt.setText(R.string.city16)} else if (NotCityId==1269937){txt.setText(R.string.city17);}
else if (NotCityId==1257951){txt.setText(R.string.city18);}else if (NotCityId==6992326){
txt.setText(R.string.city19);}else if (NotCityId==1256087){txt.setText(R.string.city20);}
else if (NotCityId==2165798){ txt.setText(R.string.city21);}else if
(NotCityId==4163971){txt.setText(R.string.city22);}else
{txt.setText(jsonObject.getString("name"));}
textView.setText("ਤਾਪਮਾਨ"+" "+String.format("%.2f", coord.getDouble("temp"))+ " ℃" +"\n" +
"ਨਮੀ"+" " + coord.getInt("humidity") + "%"); switch (z) {case 200:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.thunderstorm_light_rain)+","+getString(R.string.negative));
break;case 201:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.thunderstorm_rain)+","+getString(R.string.negative));
break;case 202:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.thunderstorm_heavy_rain)+","+getString(R.string.negative)
)
break;case 210:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.thunderstorm)+","+getString(R.string.negative));
break;case 211:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.thunderstorm)+","+getString(R.string.negative));break;
case 212:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.thunderstorm)+","+getString(R.string.negative));
break;case 221:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.thunderstorm)+","+getString(R.string.negative));
break;case 230:

xxiv
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.thunderstorm_light_rain)+","+getString(R.string.negative));
break;case 231:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.thunderstorm)+","+getString(R.string.negative));
break;case 232:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.thunderstorm_heavy_rain)+","+getString(R.string.negative)
);break; case 300:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.light_rain)+","+getString(R.string.negative));
break;case 301;
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.moderate_rain)+","+getString(R.string.rain));
break;case 302:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.heavy_rain)+","+getString(R.string.rain));
break;case 312:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.heavy_rain)+","+getString(R.string.rain));
break;case 310:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.light_rain)+","+getString(R.string.rain));
break; case 311:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.light_rain)+","+getString(R.string.rain));
break; case 313:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.light_rain)+","+getString(R.string.rain));break;
case 321:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.light_rain)+","+getString(R.string.rain));break;
case 314:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.heavy_rain)+","+getString(R.string.rain));break;
case 500:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.light_rain)+","+getString(R.string.negative)); break;
case 501:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.moderate_rain)+","+getString(R.string.rain));break;
case 502:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.heavy_rain)+","+getString(R.string.rain));break;
case 503:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.heavy_rain)+","+getString(R.string.rain));break;
case 504:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.heavy_rain)+","+getString(R.string.rain));break;
case 511:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.light_rain)+","+getString(R.string.rain));break;
case 520:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.light_rain)+","+getString(R.string.rain));break;
case 521:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.light_rain)+","+getString(R.string.rain));break;
case 522:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.heavy_rain)+","+getString(R.string.rain));break;
case 531:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.heavy_rain)+","+getString(R.string.rain)); break;

xxv
case 800:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.clear_sky)+","+getString(R.string.positive));break;
case 801:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.scattered_clouds)+","+getString(R.string.positive));break;
case 803:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.broken_clouds)+","+getString(R.string.positive));break;
default:
txt2.setText("ਵੁਝਾਅ:"+getString(R.string.clear_sky)+","+getString(R.string.positive)); break;}
setWeatherIcon(z,jsonObject.getJSONObject("sys").getLong("sunrise") * 1000,
jsonObject.getJSONObject("sys").getLong("sunset") * 1000); } catch (JSONException e) {
e.printStackTrace();Toast.makeText(AfterNotification.this, "Exception: " + e,
Toast.LENGTH_SHORT).show();pd.dismiss();}}},new Response.ErrorListener() {
@Override public void onErrorResponse(VolleyError volleyError) { pd.dismiss();
Toast.makeText(AfterNotification.this, "Volley Exception: " + volleyError,
Toast.LENGTH_SHORT).show();}});}
void initViews(){txt=(TextView)findViewById(R.id.Notcity_field);
textView = (TextView) findViewById(R.id.textAfterNot);
txt1 = (TextView) findViewById(R.id.textAfterNot2);
txt2 = (TextView) findViewById(R.id.textAfterNot3);
weatherIcon = (TextView)findViewById(R.id.weather_icon);
weatherIcon.setTypeface(weatherFont);
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
check = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
pd = new ProgressDialog(this);pd.setMessage("Fetching Location...");
pd.setCancelable(false); }
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_after_notification);
weatherFont = Typeface.createFromAsset(getAssets(), "font/weather.ttf");
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar); getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.logo);initViews();
requestQueue = Volley.newRequestQueue(this);
params = new HashMap<String, String>(); not = getIntent().getStringExtra("key");
txt1.setText("ਵੂਚਨਾ" + ":" + not); if (check) { if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
&& ActivityCompat.checkSelfPermission(this,Manifest.permission.ACCESS_COARSE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) { return;}
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1, 5,
AfterNotification.this);pd = new ProgressDialog(AfterNotification.this);
pd.setMessage("ਗਕਰਪਾ ਕਰਕ੃,ਮ੆ਵਮ ਱ਈ ਰੁਕ.੅ .");pd.show(); } else {showAlertDialog();}}
private void setWeatherIcon(int actualId, long sunrise, long sunset){ int id = actualId / 100;
String icon = "";if (actualId == 800){long currentTime = new Date().getTime();
if (currentTime>=sunrise && currentTime<sunset) { icon =getString(R.string.weather_sunny);
} else {icon =getString(R.string.weather_clear_night);}
} else {switch(id) {case 2 : icon = getString(R.string.weather_thunder); break;
case 3 : icon = getString(R.string.weather_drizzle);break;
case 7 : icon =getString(R.string.weather_foggy); break;
case 8 : icon =getString(R.string.weather_cloudy); break;
case 6 : icon = getString(R.string.weather_snowy);break;
case 5 : icon =getString(R.string.weather_rainy);break;} weatherIcon.setText(icon); }

xxvi
@Override public void onLocationChanged(Location location) {double lati = location.getLatitude();
double longi = location.getLongitude();Geocoder geo = new Geocoder(this);
StringBuffer buffer = new StringBuffer();
try {List<Address> addressList = geo.getFromLocation(lati, longi, 1);
if (addressList != null && addressList.size() > 0) {Address adrs = addressList.get(0);
int maxAdrsLines = adrs.getMaxAddressLineIndex();for (int i = 0; i < maxAdrsLines; i++) {
buffer.append(adrs.getAddressLine(i) + "\n");city = adrs.getLocality();
Toast.makeText(AfterNotification.this, "city:" + city + "lat" + lati, Toast.LENGTH_SHORT).show();
buffer.append(adrs.getLocality() + "\n"); // City
buffer.append(adrs.getAdminArea() + "\n"); // State }} catch (IOException e) {e.printStackTrace() }
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) !=
PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_COARSE_LOCATION) !=
PackageManager.PERMISSION_GRANTED) { return; }
locationManager.removeUpdates(AfterNotification.this);createJsonRequest();
requestQueue.add(request);}

content_schedule_wheat.xml

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.ndhillon.farmerhelper.ScheduleWheat"
tools:showIn="@layout/activity_schedule_wheat">
<ListView android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/listViewWheat"
android:background="#CCFFCC"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"/></RelativeLayout>

ScheduleWheat.java

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.util.ArrayList;
public class ScheduleWheat extends AppCompatActivity {
ListView lv;ArrayList<String> list;ArrayAdapter<String> adapter;
AdapterView.OnItemClickListener clickListener = new AdapterView.OnItemClickListener() {
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String str = list.get(position); switch (position){case 0:

xxvii
Intent intent = new Intent(ScheduleWheat.this,schWheat1.class);startActivity(intent);break;
case 1: Intent i = new Intent(ScheduleWheat.this,wheat_Nov.class);startActivity(i); break;
case 2: Intent j = new Intent(ScheduleWheat.this,wheatDec.class);startActivity(j);break;
case 3: Intent k = new Intent(ScheduleWheat.this,wheatJan.class);startActivity(k);break;
case 4:Intent l = new Intent(ScheduleWheat.this,wheatFeb.class);startActivity(l);break;
case 5:Intent m = new Intent(ScheduleWheat.this,wheatMarch.class);startActivity(m);break;
case 6:Intent n = new Intent(ScheduleWheat.this,wheatApril.class);startActivity(n);break;}}};
void initList(){ list= new ArrayList<String>();list.add("ਅਕਤੂਬਰ"); list.add("ਨਲ਼ੰ ਬਰ ");
list.add("ਦਵੰ ਬਰ ");list.add("ਜਨਲ਼ਰੀ");list.add("ਿਰਲ਼ਰੀ");list.add("ਮਾਰਚ");list.add("ਅਪਰ੄਱");
adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,list);
lv.setAdapter(adapter);lv.setOnItemClickListener(clickListener);}
@Override protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);setContentView(R.layout.activity_schedule_wheat);
lv=(ListView)findViewById(R.id.listViewWheat);initList();
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.logo);}}

schWheat1.xml

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp">
<ScrollView android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp">
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="@dimen/activity_margin_top">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/oct1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="25sp"
android:text="ਵੇਂਜੂ ਸ਼ਾ਱ਤਾਂ"
android:layout_centerHorizontal="true"

xxviii
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
<TextView android:id="@+id/oct2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
<TextView android:id="@+id/oct3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
<TextView android:id="@+id/oct4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout> </android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="30dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/oct5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="25sp"
android:text="ਬਰਾਨੀ ਸ਼ਾ਱ਤਾਂ"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
<TextView android:id="@+id/oct6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"

xxix
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
<TextView android:id="@+id/oct7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout></android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="30dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/oct8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
<TextView android:id="@+id/oct9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout></android.support.v7.widget.CardView>
</LinearLayout></ScrollView></RelativeLayout>

schWheat1.java

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;
import java.util.ArrayList;
public class schWheat1 extends AppCompatActivity {

xxx
TextView oct1,oct2,oct3,oct4,oct5,oct6,oct7,oct8,oct9;
@Override protected void onCreate(Bundle savedInstanceState)
{super.onCreate(savedInstanceState); setContentView(R.layout.activity_sch_wheat1);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.logo); initViews();
oct2.setText(R.string.wheat_Oct1);oct3.setText(R.string.wheat_Oct2);
oct4.setText(R.string.wheat_Oct3);oct6.setText(R.string.wheat_Oct4);
oct7.setText(R.string.wheat_Oct5);oct8.setText(R.string.wheat_Oct6);
oct9.setText(R.string.wheat_Oct7);}void initViews(){
oct1=(TextView)findViewById(R.id.oct1);oct2=(TextView)findViewById(R.id.oct2);
oct3=(TextView)findViewById(R.id.oct3);oct4=(TextView)findViewById(R.id.oct4);
oct5=(TextView)findViewById(R.id.oct5);oct6=(TextView)findViewById(R.id.oct6);
oct7=(TextView)findViewById(R.id.oct7);oct8=(TextView)findViewById(R.id.oct8);
oct9=(TextView)findViewById(R.id.oct9);}}

wheatseed.xml

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_margin_top">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp">
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="40dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seed1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:text="ਵੇਂਜੂ ਸ਼ਾ਱ਤਾਂ ਗਲ਼ੱ ਚ ਠੀਕ ਵਮੇਂ ਤ੃ ਗਬਜਾਈ ਱ਈ"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ਦਬਾਓ"

xxxi
android:id="@+id/btn1"
android:layout_marginTop="20dp"
android:layout_below="@+id/seed1"
android:layout_gravity="center_horizontal" />
</LinearLayout></android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="30dp">
<LinearLayout> android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seed2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:text="ਵੇਂਜੂ ਸ਼ਾ਱ਤਾਂ ਗਲ਼ੱ ਚ ਪਛ੃ਤੀ ਗਬਜਾਈ ਱ਈ "
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ਦਬਾਓ"
android:id="@+id/btn2"
android:layout_marginTop="20dp"
android:layout_below="@+id/seed2"
android:layout_gravity="center_horizontal" /> </LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="30dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seed3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"

xxxii
android:text="ਬਰਾਨੀ ਸ਼ਾ਱ਤਾਂ ਗਲ਼ੱ ਚ ਗਬਜਾਈ ਱ਈ"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ਦਬਾਓ"
android:id="@+id/btn3"
android:layout_marginTop="20dp"
android:layout_below="@+id/seed3"
android:layout_gravity="center_horizontal"
android:layout_centerHorizontal="true"/>
</LinearLayout></android.support.v7.widget.CardView>
</LinearLayout></RelativeLayout>

wheatseed.java

import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class wheatseed extends AppCompatActivity {
TextView t1,t2,t3; Button b1,b2,b3;
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wheatseed);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar); initViews();
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.logo);}
View.OnClickListener clickListener = new View.OnClickListener() {
@Override public void onClick(View v) {int id = v.getId(); if (id == R.id.btn1) {
Intent intent = new Intent(wheatseed.this,whtseed1.class);startActivity(intent);}if (id == R.id.btn2) {
Intent intent2 = new Intent(wheatseed.this,wheatseed2.class);startActivity(intent2); }
if (id == R.id.btn3) { Intent intent3 = new Intent(wheatseed.this,Wheatseed3.class);
startActivity(intent3);} }}};
void initView() {
t1 = (TextView)findViewById(R.id.seed1);t2 = (TextView)findViewById(R.id.seed2);
t3 = (TextView)findViewById(R.id.seed3);b1 = (Button)findViewById(R.id.btn1);
b2 = (Button)findViewById(R.id.btn2);b3 = (Button)findViewById(R.id.btn3);
b1.setOnClickListener(clickListener);b2.setOnClickListener(clickListener);
b3.setOnClickListener(clickListener);}}

content_whtseed1.xml

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"

xxxiii
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_margin_top">
<ScrollView android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp">
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="30dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seedtype1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout> </android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="25dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seedtype2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout> </android.support.v7.widget.CardView>
<android.support.v7.widget.CardView

xxxiv
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="25dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seedtype3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout> </android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="25dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seedtype4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout> </android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="25dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"

xxxv
android:background="#CCFFCC">
<TextView android:id="@+id/seedtype5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout> </android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="25dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seedtype6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout></android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="25dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seedtype7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout></android.support.v7.widget.CardView>
<android.support.v7.widget.CardView

xxxvi
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="25dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seedtype8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout></android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="25dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seedtype9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout> </android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="25dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"

xxxvii
android:background="#CCFFCC">
<TextView android:id="@+id/seedtype10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout></android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="25dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seedtype11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout> </android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="25dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/seedtype12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout></android.support.v7.widget.CardView>
</LinearLayout></ScrollView></RelativeLayout>

xxxviii
whtseed1.java
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;
public class whtseed1 extends AppCompatActivity {
TextView txt1,txt2,txt3,txt4,txt5,txt6,txt7,txt8,txt9,txt10,txt11,txt12;
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_whtseed1);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.logo);initViews();
txt1.setText(R.string.wheat_seed_type1);txt2.setText(R.string.wheat_seed_type2);
txt3.setText(R.string.wheat_seed_type3);txt4.setText(R.string.wheat_seed_type4);
txt5.setText(R.string.wheat_seed5); txt6.setText(R.string.wheat_seed6);
txt7.setText(R.string.wheat_seed7);txt8.setText(R.string.wheat_seed8);
txt9.setText(R.string.wheat_seed9);txt10.setText(R.string.wheat_seed10);
txt11.setText(R.string.wheat_seed11); txt12.setText(R.string.wheat_seed12)}
void initViews(){
txt1 = (TextView)findViewById(R.id.seedtype1);txt2 = (TextView)findViewById(R.id.seedtype2);
txt3 = (TextView)findViewById(R.id.seedtype3);txt4 = (TextView)findViewById(R.id.seedtype4);
txt5 = (TextView)findViewById(R.id.seedtype5);txt6 = (TextView)findViewById(R.id.seedtype6);
txt7 = (TextView)findViewById(R.id.seedtype7);txt8 = (TextView)findViewById(R.id.seedtype8);
txt9 = (TextView)findViewById(R.id.seedtype9);txt10 = (TextView)findViewById(R.id.seedtype10);
txt11= (TextView)findViewById(R.id.seedtype11);
txt12= (TextView)findViewById(R.id.seedtype12);}}

content_wheatseed2.xml

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_margin_top">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp">
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="@dimen/activity_margin_top">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"

xxxix
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/ws1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout></android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="30dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/ws2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout> </android.support.v7.widget.CardView>
</LinearLayout> </RelativeLayout>

wheatseed2.java

package com.example.ndhillon.farmerhelper;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;
public class wheatseed2 extends AppCompatActivity {
TextView ws1,ws2;
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wheatseed2);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.logo); initViews();

xl
ws1.setText(R.string.wheat_seed13);ws2.setText(R.string.wheat_seed14);}
void initViews(){ws1 =(TextView)findViewById(R.id.ws1);
ws2 = (TextView)findViewById(R.id.ws2);}

content_wheatseed.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_margin_top">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp">
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="@dimen/activity_margin_top">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/w3seed1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout></android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="30dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/w3seed2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

xli
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout></android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:cardView="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
cardView:cardElevation="10dp"
cardView:cardCornerRadius="25dp"
android:layout_marginTop="30dp">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dip"
android:background="#CCFFCC">
<TextView android:id="@+id/w3seed3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_centerHorizontal="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal"/>
</LinearLayout> </android.support.v7.widget.CardView>
</LinearLayout></RelativeLayout>

wheatseed3.java

package com.example.ndhillon.farmerhelper;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;
public class Wheatseed3 extends AppCompatActivity {
TextView s1,s2,s3;
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wheatseed3);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.logo);
initViews();
s1.setText(R.string.wheat_seed15); s2.setText(R.string.wheat_seed16);
s3.setText(R.string.wheat_seed17); void initViews(){
s1=(TextView)findViewById(R.id.w3seed1); s2=(TextView)findViewById(R.id.w3seed2);
s3=(TextView)findViewById(R.id.w3seed3);}}

xlii
HandleXmlWheat.java
package com.example.ndhillon.farmerhelper;
import android.util.Log;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
public class HandleXmlWheat {
private String not = ""; private String title = "";
private String time = ""; private String urlString = null;
private XmlPullParserFactory xmlFactoryObject;
public volatile boolean parsingComplete = true;
ArrayList<WheatBeanNot> wheatlist;
public HandleXmlWheat(String url){ this.urlString = url;
wheatlist= new ArrayList<>();}
public ArrayList<WheatBeanNot> getWheatlist() { return wheatlist; }
public String getNot() { return not;}
public String getTitle() {return title;}
public String getTime() { return time;}
public void parseXMLAndStoreIt(XmlPullParser myParser) {
int event;String text=null;
try {event = myParser.getEventType();
while (event != XmlPullParser.END_DOCUMENT) {
String name=myParser.getName();Log.i("Name", "name:" + name);
switch (event){case XmlPullParser.START_TAG:
if (name.equals("not")){not = myParser.getAttributeValue(null,"value"); }
if(name.equals("title")){ title = myParser.getAttributeValue(null,"value‖);}
Log.i("title","value:"+getTitle());}
if(name.equals("time")){
time= myParser.getAttributeValue(null,"value");
Log.i("time","value:"+getTime());}
if(!not.isEmpty() && !time.isEmpty() && !title.isEmpty()) {
wheatlist.add(new WheatBeanNot(not, title, time));not=time=title="";}break;
case XmlPullParser.TEXT: text = myParser.getText();break;
case XmlPullParser.END_TAG: }
event = myParser.next();}
parsingComplete = false;}catch (Exception e) { e.printStackTrace(); }
public void fetchXML(){
Thread thread = new Thread(new Runnable(){ @Override
public void run() { try { URL url = new URL(urlString);
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setReadTimeout(100000);conn.setConnectTimeout(150000 /* milliseconds */);
conn.setRequestMethod("GET");conn.setDoInput(true);conn.connect();
InputStream stream = conn.getInputStream();
xmlFactoryObject = XmlPullParserFactory.newInstance();
XmlPullParser myparser = xmlFactoryObject.newPullParser();
myparser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
myparser.setInput(stream, null);parseXMLAndStoreIt(myparser); stream.close();}
catch (Exception e) {e.printStackTrace();Log.i("CHECK","Exception: "+e.getMessage());}} });
thread.start();}}

xliii
SplashActivity.java

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Message;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.os.Handler;
import java.util.logging.LogRecord;
public class SplashActivity extends Activity {
SharedPreferences prefs;
boolean check;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
handler.sendEmptyMessageDelayed(Utils.Msg,3000);
prefs = getSharedPreferences(Utils.pref_name,MODE_PRIVATE);
check = prefs.getBoolean(Utils.pref_key,false); }
Handler handler = new Handler() {
@Override public void handleMessage(Message msg) {
if (msg.what == Utils.Msg) {
if (check) { Intent i = new Intent(SplashActivity.this, MainActivity.class);
startActivity(i); } else {
Intent i = new Intent(SplashActivity.this, LoginActivity.class);
startActivity(i);}finish();}} };}

Utils.java

public class Utils {


public static final String pref_name="login";
public static final String pref_key="loginkey";
public static final String pref_not="not";
public static final String pref_notkey="notkey";
public static final String pref_rnot="rnot";
public static final String pref_rnotkey="rnotkey";
public static int Msg = 301;
String strTitle="";}

xliv
VITA

Name of the student : Navjot Kaur

Father’s name Mr. Bikkar Singh

Mother’s name : Mrs. Simarjit Kaur

Nationality Indian

Date of birth : November 16, 1990

Permanent home address : Navjot Kaur H.No. 9, St No. 1,

Guru Teg Bahadur Nagar,

KK Bypass, Muktsar-152026,
Punjab.

EDUCATIONAL QUALIFICATION

Bachelor’s degree : B.E. (Computer Science)

University and year of award Sant Longowal Institute of Engineering &


Technology, Longowal (2014)

% Marks : 87.24%

Master’s degree : M.Tech.(Computer Science and Engineering)

University and year of award : Punjab Agricultural University, Ludhiana


(2016)

OCPA : 8.25/10.00

Title of Master’s Thesis Development of mobile based agriculture


scheduling system for farmers in regional
language (Punjabi) using weather
conditions.

Вам также может понравиться