TinyGPS.h get Latitude and Longitude data when no fix is available.

Hi,

I am new to Arduino and i am using TinyGPS.h to retrieve GPS data in following format:

LAT,LON =19.103648,72.880005 SAT=8

i am using following code:

#include <SoftwareSerial.h>
#include <TinyGPS.h>

TinyGPS gps;
SoftwareSerial ss(2, 3);

void setup()
{
  Serial.begin(9600);
  ss.begin(9600);
}

void loop()
{
  while (ss.available())
  {
    char c = ss.read();
    if (gps.encode(c)) // Did a new valid sentence come in?
    {
      float flat, flon;
      unsigned long age;
      gps.f_get_position(&flat, &flon, &age);
      Serial.print("LAT,LON =");
      Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
      Serial.print(",");
      Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
      Serial.print(" SAT=");
      Serial.println(gps.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : gps.satellites());
      delay(1000);
    }
  }
}

the above code is working fine.
but when valid sentence is not available the TinyGPS library is not giving any output data.
now the question is, if there is a way to retrieve Latitude and Longitude data in above format even if GPS fix is not available.

now the question is, if there is a way to retrieve Latitude and Longitude data in above format even if GPS fix is not available.

Think about this. If the GPS doesn't know where you are (no fix is available), how do you expect it to tell you where you are?

Thanks PaulS Sir,
i am a big fan of yours, your answers to posts are very helpful.

i think i have wrongly presented my question.
actually i am building a GPS vehicle tracker the GSM and GPS code is working fine.
i can track the vehicle by sending an SMS to Tracker and getting GPS coordinates in reply, when a valid GPS fix is available.

now if some one has stolen my vehicle and hide it inside a building where GPS fix is not available but GSM network is available,
how can i get last coordinates when GPS fix was available.

how can i get last coordinates when GPS fix was available.

OK, that's a different question, and a reasonable one.

Each time that you get position data from the GPS, when there is a fix, store that data somewhere. It is that data, not the current GPS data, that you should be sending in response to a "Hey, where are (were) you?" request.