Thursday, 10 October 2013

PNR STATUS Mobile Application for PHONEGAP

PNR STATUS Android Application for PHONEGAP 
        In this tutorial you will learn about accessing the pnr status for ticket booking. this is the sample application where completed with the  dummy pnr number.
Android irctc application sample source code to check pnr status,Mobile application to retrieve the pnr info

Get PNR Status for a Ticket - JSON
Service Endpoint:<PNR_NUMBER>
This api is the private api through which we can access the indian railway pnr status check service
Sample JSON Response Skeleton:
 "ok": "1", 
"tnum": "12805", 
"tname": "JANMABHOOMI EXP", 
"tdate": "25-2-2013", 
"from": "GNT", "to": "SC",
 "class": "CC",
 "charted": true, 
"numofpax": 2,
 "pax": [ { "coach": "D2",
 "berth": "23", 
"quota": "GN", 
"status": "CNF" },
 { "coach": "S2",
 "berth": "43",
 "quota": "GN", 
"status": "CNF" } ] } 
To Work with Phone gap 
Prerequisites :
1.install phonegap icenium 
2.create a project and paste the following code in the index.html page and run the project
<!DOCTYPE html>
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
     KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <link rel="stylesheet" type="text/css" href="css/index.css" />
         <!-- JQUERY CSS -->
        <script src=""></script>
        <link rel="stylesheet" href="" />

        <!-- CORDOVA - PHONE GAP -->
        <script type="text/javascript" src="cordova.js"></script>
        <title>Hello World</title>
            #container {
    margin: 10px;    
table, th, td {
    border: 1px solid black;
    padding: 5px;
        <script type="text/javascript">
        jQuery(document).ready(function() {
    var host = "";
    console.log("Setting host to "+host);
    var sample_pnr = "6712133131";
    console.log("Setting Sample PNR to "+sample_pnr);
    var url_construct = host + sample_pnr;
    console.log("Full URL Construct is "+url_construct);
    var dataType = "json";
    console.log("Setting response DataType to "+dataType);
    console.log("Now making an AJAX GET request...");
        type: 'GET',
        url: url_construct,
        success: function(data) {
            console.log("Received JSON response: "+JSON.stringify(data));
        dataType: dataType,
        cache: false
    function followthru(rcvd_response) {
        if(rcvd_response.ok == "1") {
            console.log("Everything good...Proceed to process");
        } else {
            console.log("Invalid PNR/Service Unavailable. Stop here!");
            alert("Invalid PNR/Service Unavailable");
    function process(info) {
        console.log("Started parsing JSON response");
        var traintr = jQuery("table tr#tr2:last");
        var paxpr = jQuery("table#paxinfo tr:last");
        var paxhtml = '';
        for(i=0;i<info.numofpax;i++) {
            paxhtml += '<tr>';
            paxhtml += '<td>';
            paxhtml += info.pax[i].coach;
            paxhtml += '</td>';
            paxhtml += '<td>';
            paxhtml += info.pax[i].berth;
            paxhtml += '</td>';
            paxhtml += '<td>';
            paxhtml += info.pax[i].quota;
            paxhtml += '</td>';
            paxhtml += '<td>';
            paxhtml += info.pax[i].status;
            paxhtml += '</td>';
            paxhtml += '</tr>';
        console.log("Response parsing done");
        <div data-role="page" id="container">
           <input type="text" id="pnrnumber" size="20" name="pnrnumber" value="" placeholder="pnr number" />
<table id="traininfo"><tr id="tr1">
    <th>Train #</th>
    <th>Train Name</th>
    <th>Train Date</th>
    <th>Chart Prepared</th>
    <tr id="tr2"></tr>
<br />
<br />
<table id="paxinfo">
    <tr id="pr1">
The pnr number is hard coded you can retrieve it from text box and have some function.
you can add css to design the table view in what model you want.
Key points:
Android, ios , bada, windows mobile application to check pnr status 

Disclaimer: This website is not affiliated with The Ministry of Railways, Government of India and does not store in its database any content of Indian Railways websites. For the official website, please visit Indian Railways 


  1. getting PNR STATUS Mobile Application is really nice

    Indian railway pnr status

  2. this site is very help ful for all over indians.lot of stuff is here in this website am already bookmarked for revisiting…………………

    PNR STATUSverification made easy through our website via mobile calling & sms & website also. Login……………RAILHUB.IN

    PNR STATUSchecking only Indian railways journey’s in india when berth is confermed or not.

  3. Check PNR status in a single click
    check pnr status:pnr status

  4. This comment has been removed by the author.

  5. Have you ever wondered what does a PNR Status Inquiry means? We bring you some quick facts which would clear all your doubts about what PNR is and the usual pain points which often confuses a lot of travellers. PNR, if simply described, is the travel record of a passenger or a group of passengers who are travelling together which is saved in the computer database of the reservation system. It is a 10-digit alpha-numeric which is printed on the ticket itself and is required for making any travel related query. Check out pnr status of your ticket with a single click.