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

16 Responses to “SMS and Web Based Agriculture Information Delivery System For Pakistan”

  1. alan February 6, 2013 at 1:56 PM #

    All extremely interesting.
    How could l implement in Australia?
    regards alan

  2. drbausman February 8, 2013 at 9:38 PM #

    Reblogged this on drbausman's Blog.

  3. K RAJESH November 12, 2013 at 11:06 AM #

    It is very interesting. I want to implement the same for farmers in India. My aim is just to register farmers mobile numbers and send the important information through this portal. I am working in agricultural institute in India and I have lack of computer knowledge. Please help me or suggest me how to use this.

    • mahtabrasheed195 November 12, 2013 at 11:18 AM #


      Thank you for your interest.Yes sure I can help you but first you have to make arrangements to implement this. We can have discussion regarding this system.
      You can contact me at

      I will try to help you.


  4. hajar November 20, 2013 at 12:37 PM #

    some good system, i would like to ask you in your architecture diagram, the picture refer to website, and website for one again are what function ?.Sorry this question , a bit low standard because i’m still new in this area.Thank you

    • mahtabrasheed195 November 20, 2013 at 2:20 PM #

      Yes it is. My system was picking data from there. I wrote a web crawler which was picking the seeds information from there and then storing into my system. After getting data from there information was being translated into URDU and then sent to farmers through SMS.

      Mahtab Rasheed

  5. Krishna January 24, 2014 at 10:56 AM #

    Very Nice & excellent project.I want this project entire code.Actually I’m a student from india i’m very interested to learn java technologies.Right now I’m in job searching.If you send this project to me it’s very helpful.I’m requesting you please help me.

  6. Kirthika.K March 13, 2014 at 4:10 PM #

    Sir it is really a good project.Please give me some more new ideas in this to do this as my final year project. i.e I want to know some new ideas to innovate from the existing system.

  7. Ali Haider April 20, 2014 at 1:07 PM #

    Assalm O Alikum
    sir i want to ask you that your using kannel for sms gatway so your not using any kind of gsm module?? if your are using so please mention that module name thank you.

  8. Rodel June 30, 2014 at 7:57 AM #

    Hi I am a researcher from the Philippines and I congratulate you for having developed a system like this.. Maybe we can collaborate or exchange ideas. I am planning also to develop a system similar to this but for the sms gateway i am planning to use gsm modem instead of kannel. Any thoughts? Thank you

    • name December 1, 2014 at 12:54 PM #


      Hope this email will find u fine…….
      Let me try to ask some few advice though am not sure if you will answer, as i can see the above comment have no reply yet, since Nov 2013.

      Glad to read this innovative idea, am a student in one of the asia country and i was thinking of writing thesis on e-agriculture, your paper is very interesting, can i include weather information without link the site to the meteorological agency? please have your email so i can ask more about it please if possible.


  9. Nasir July 11, 2015 at 8:53 PM #

    پتہ نہیں اس ویب سے مجھے کوئی انفارمیشن ملے گی یا نہیں، میرے انگور کے خوشیں بڑے ہو کے پھرسسیکھنا اور دانے پٹنا شروع ہو کے وقت سے پہلے سوکھ کے ختم ہو جاتے ہیں، جبکہ بیل ٹھیک ٹھاک ہوتا ہے اس پہ کوئی اثر نہیں لگتا براے مہربانی مدد کرے پچھلے سال بھی ایسا ہوا تھا اب اس سال پھر شروع ہوا ہے

    • Mahtab Rasheed July 14, 2016 at 7:33 AM #

      Janab ap facebook par aik group ha “Pakistan Agricultural Discussion Forum” wahan par yeh qury put kar sakty hain.

  10. Kingthirdy Remorta III July 11, 2016 at 10:46 PM #

    Hi Sir, Can i use this for my
    RRl/RRS of my thesis

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: