Tag Archives: it-agriculture

SMS and Web Based Agriculture Information Delivery System For Pakistan

25 Jan

I will be sharing here the implementation details of agriculture information system which I have developed. Objective to share this information is to help others and give them a hint about the system. Although there is room for improvements.

This article covers the detailed implementation of components of system. All the technologies used in the project will also be explained in detail.




The features mentioned in the above sections are implemented.  Web portal is implemented using Java Enterprise Edition (J2EE). Implementation technology is Java Server Faces version 2.0 (JSF2.0) and PrimeFaces is used as component library. Some of pages are developed in Java Server Pages (JSP). Database used is MySQL which is an open source database and used widely for web applications. Integrated Development Environment (IDE) used for the development is NetBeans 7.2.0.

Why J2EE (JSF) is used?

First of all Java Enterprise Edition is used for huge scale applications. It is also portable and can be used for cross platform. The system which we have developed has a huge potential for subscription and the subscribers can be in millions. Therefore Java Enterprise Edition helps as it is used in situations where users are large in numbers. JSF2.0 follows MVC architecture which separates the business logic and view. MVC architecture is very helpful in creating large scale applications. One of the important factors is also the motivation for a mobile edition of the web portal in future, that could be easily developed in PrimeFaces.

Web Portal Users

There are four types of users of this web portal

  1. Seed Sellers
  2. Agricultural Advisories
  3. Farmers
  4. Administrator

1-    Seed Sellers

1.      Seed Seller Registration Module

Web portal contains a registration module where seed sellers/agricultural product sellers can register themselves by entering some specific information. Information will be saved in the database.


2.      Seed Seller Login Module

Seed seller can log on to the system by entering the credentials asked at the registration time. Credentials are username and password.


3.      Seed Seller Information Feeding Module

Main theme to bring seed sellers to web portal is information acquiring. Seed sellers can add the information about their seeds. Information entered by the sellers is stored in the database.  Initially seller can add information of only three crops; cotton, corn and rice but in future it will be extended to maximum crops.  Seed information is further categorized. PrimeFaces’ component “Accordion Pane” is used for the graphical user interface.


2-    Agricultural Advisories

Agricultural advisories in Pakistan carry out research pertaining seeds and production technologies. Agricultural advisories in Pakistan do not have a mechanism to share their research with farmers. Advisories module in the web portal is same as the seed seller’s module. So advisories can also share information on the web portal which is saved in the database.

1.      Seed Seller Registration Module

2.      Seed Seller Login Module

3.      Seed Seller Information Feeding Module

3-    Farmer

Farmers are the core users and the focal point of the system. The whole system is being developed for the information sharing to the farmers. Only registered farmers will be able to get agricultural updates. Farmers can subscribe to our system using two ways:

1.      Registration through SMS

Farmers in villages do not have access to computers; moreover most of them are computer illiterate. To facilitate the farmers and make system useful for the farmers, registration through SMS is introduced in the system. Farmers who want to subscribe to our system can type in SMS

  1. ‘Sub’ or ‘s’and sends it to 03348648921 (Not Operational. Will Make it Operation Soon).
  2. Farmer will get reply with instruction and sample SMS to register with system.
  3. By correctly replying to the information requested, farmer subscription request will be received at the web portal which later administrator will moderate (Accept/Reject).

2.      Registration at web portal

Farmers are also facilitated in registration by the web portal. Someone questions why registration through web portal is there? Answer is that there is chance that we can collect data from large number of farmers themselves and register them manually instead of using SMS registration method. Farmer is asked some specific information at the time of registration which is helpful for sending the updates to farmers later.


4-    Administrator

Administrator is also a very important user of the system specifically for the management of system. Administrator is the super user of the web portal. The entire user interface in the admin panel is developed in the PrimeFaces. The component of PrimeFaces used is “Tabview”. Administrator has the following functionalities at the web portal.


1.      SMS sending Module

Administrator can send SMS to farmers based on the Region, District and Crop.  E.g. administrator can select where region is Rawalpindi, District is Attock; also admin want to send SMS only to cotton farmers. SMS is automatically generated when administrator select the options. Administrator has the options to send SMS in English or Urdu.


2.      Automated broadcasting

Administrator can set up the time for the periodic broadcast of a SMS. And location for sending the SMS selected from the list of options. SMS can be sent to all the districts or a specific district. To implement this feature PrimeFaces Poll component is used which provides the functionality to call an event again and again after specified interval.


3.      Automated web crawling

Administrator has the option to run the web crawler for the three crops initially Corn, Cotton and Rice. Only Corn crawling is working. Information is crawled from the Pioneer Seeds website. Information is fetched through an open source web crawler ‘Crawler4j’. Information is parsed after fetching and then stored in the database. Parser used for parsing the HTML page is the “JSoup “parser, which is an open source parser.


4.      User Management

User management is an important feature of admin module in the web portal. This feature covers the user management. Administrator can view the sellers, advisories and farmers registered in our system. Administrator can delete a specific seller, advisory or farmer.


5.      User statistics

Administrator can also check the statistics of farmers registered for a specific crop in graphical form. For graphs java script library “High Charts” is used. Administrator can also download and print the graphs.


6.      Subscription requests moderation

As described in chapter 3, farmer will be able to get registered directly through website but registration request from mobile phone will be moderated. The purpose to moderate is to avoid invalid and fake registration. At web portal it is ensured through validations. Validations are implemented through JSF built in validations support.  Administrator can approve/reject the request. On approval of removal of request farmer will be notified with SMS.


7.      Translation Module

We are developing this system for the farmers of Pakistan. Majority of farmers cannot understand English. So in order to make system effective and create value for the farmer translation module is included in the system. Translation module uses the Google translation API 2.0 which is used commercially. You have to purchase the key before you can use the translation API to translate in Urdu.

When administrator will click the Urdu tab, the text in the textbox will be translated to Urdu.


8.      SMS history

History of sent and received SMS from portal is maintained. Administrator can view the history in the sent and received messages tab.


9.      News updates

Administrator can share the recent news as well. Administrator will add the news in the news panel module and news will be shown in the new section at the home page of the web portal.


SMS Gateway

We will be using Kannel as an SMS gateway server. Kannel is installed on the Linux Ubuntu 12.04. Installation, configuration, sending and receiving SMS detail is already described in my previous posts.

Automated SMS query response system

Automated query response is implemented in Java Server Pages JSP. First of all farmer can subscribe to the service by registration through SMS. After registration farmer can query seed information for a specific crop. When system receives the request, first of all system checks the crop for which farmer is requesting the seed information for. After the evaluation of request, system checks the database and retrieves specific seed information about the crops.  SMS is generated from the retrieved information and reply is sent to the farmer.


Agriculture is the backbone of Pakistan. Half of the population’s direct source of income is agriculture. Agriculture is facing a lot of problems nowadays, which is resulting in increase in poverty ratio every year. We have first investigated the complete lifecycle of farming and have tried to find solutions to the problem faced by the farmer throughout the life cycle. The communication gap between farmers and agricultural information providers is the actual problem identified in our research. We have developed a platform where farmers and agricultural information providers can communicate with much more ease as compared to typical communication methods. System is using the medium of mobile phone communication. Information provider can share the information on this platform where it will be stored. The stored information will be delivered to farmers through SMS. System has the functionality of automated query response feature which is very useful for the farmers. The system developed is first of its type in Pakistan. These systems are working effectively in other countries like Kenya, South Africa, Thailand and India. Information systems are contributing in the agricultural productivity across the globe. The developed system is unique in the sense that it has unique features like:

  • Automated web crawling
  • Farmer categorization on location and crop
  • Translation of the information in Urdu

System is cost effective as it uses SMS as a medium of communication. SMS communication is  very cost effective and is available all across Pakistan.

In Pakistan, we can overcome the communication gap between the agricultural information providers and farmers with the use of this system. By using this system farmer would be able to get the latest and valuable agricultural information on their mobile phones. It will increase the efficiency and productivity in the agriculture sector of Pakistan. Our platform provides all the necessary features to bridge the communication gap.


System we developed so far is only providing information related to seeds. System can also be extended to provide all the information necessary for farming. Information related to crop selection, land preparation, use of fertilizer and pesticides, weather forecast and market is most needed by the farmers. The system we have developed is so well designed that it can be extended to implement the various features which will provide all the other required information using SMS. Proposed extensions are

  1. Weather forecast
  2. Pest attack warnings
  3. Market rates update
  4. Schedule of water availability in the canals
  5. Personalization of information for the individual farmers
  6. Addition of agricultural experts in the system
  7. Mobile application for simple Nokia Symbian’s mobile phones
  8. Query response through voice mail
  9. Collaboration with Pakistan government

The system with proposed extension can be a mile stone in changing the life style of farmers and may lead to increased agricultural productivity in Pakistan. Real value of the system is that a large number of farmers facing similar problems can acquire the latest and pertinent information regarding the problem they are facing and its solution. This system can also help the agriculture product sellers to change their marketing strategies. Agriculture product sellers spend millions in printing the literature for advertisement of the products. With use of this system they can market their product efficiently and cost effectively. Use of Information Technology (IT) in agricultural information flow is completely a new field in Pakistan and it can play a significant role in achieving excellence in agriculture productivity.

Need your suggestions and feedback.

It is soley my own work. Please get permission before copying.

Copy Rights @Mahtab


Problems of Agriculture Pakistan and Solution

8 Nov

Pakistan’s high potential for producing food is an internationally established fact.  However, agriculture sector in Pakistan is facing significant challenges.  Some of these challenges are:

  1. Communication gap between farmers and agriculture information providers including agricultural advisories and product sellers
  2.  Shortage of water, power and capital

Fortunately, progress in mobile communication and information technology has the potential to provide significant support to farmers in surmounting these challenges.  Some of the technologies that can be leveraged include: Mobile communication and smart consumer devices like phones, PDA’s etc.

Integrated use of these technologies can lead to optimization of individual farmer’s operations as well as accurate estimation of total farm production at district and farm level. A number of efforts have been made to leverage mobile communication to assist farmers. These efforts have had mixed results. One of the key short comings in these efforts has been a lack of analysis and understanding of farmers’ end-to-end information flow requirements.

Mobile phone is the most common means of communication that is available to every farmer across the country. Most farmers have access to mobile phones (price range from Rs.2500-3500) and mobile network coverage is quite widespread in the country (up to 70% penetration). So the information delivery to the farmers through mobile phones is most likely to resolve the communication gap among farmers and agricultural advisories.

Information about weather, seeds, trusted pesticide and fertilizer suppliers, pesticide sprays, crop diseases and their solutions, comparative pricing of crops and inputs, balanced fertilizers and marketing techniques is the information most needed by the farmers.

Copy Rights @Mahtab Rasheed. Please do not copy without permission.  Contact:mahtabrasheed195@gmail.com

Improvement in Agriculture Pakistan using Mobile Phone Networks

3 Nov

Pakistan is an agrarian economy and 70% of the economy is dependent upon agriculture. Pakistan loses 30-40% of its crops annually due to lack of awareness amongst the farmers and use of out-dated techniques. Information regarding seeds, weather, trusted pesticides, fertilizers, crop diseases and their solutions, comparative pricing of crops and marketing techniques are most needed by the farmers. Government agricultural staff and agents of seed/pesticide companies are unable to reach all the farmers to guide them about benefits of using quality seeds, expected diseases and their remedies. Therefore one of the major problems faced by Pakistani agriculture industry is the lack of information amongst the farmers due to the communication gap between the information provider and the farmer.

Today, mobile phones have penetrated throughout the rural areas and are available to most of the farmer across the country. Other mechanisms such as TV and radio programs do not match the schedule of farmers and newspapers are also not available in rural area. Hence, the information delivery in Urdu through mobile phones is most suitable for the farmers.

This problem can be solved by developing a system through which farmers can get the required information (especially about seeds) using mobile phones communicating directly with our system. System will be composed of mobile phones and a web portal. System will deliver information using two ways, first periodic broadcasts of seed information from web-portal through SMS on mobile phones of farmers depending upon the season. Second, farmer can query the system by sending names of the crops in SMS and our system will automatically reply with the available seed information of the crop. All information will be delivered in Urdu as well as English language which is comfortable for farmers.  Therefore, farmers will be able to get information on their mobile phones at a reasonable cost as compared to expenses incurred in travelling to agricultural offices. Moreover, wastage in time is also an issue that will be solved through this system.