+ /**
+ * Process the given MRC sentence and return the date
+ * @param inLine line to process
+ * @return date, if any
+ */
+ private static String getDateFromRMC(String inLine)
+ {
+ // Only consider lines which are long enough and begin with the RMC sentence
+ if (inLine == null || inLine.length() < 20 || !inLine.startsWith("$GPRMC")) {
+ return null;
+ }
+ // Assume comma delimiter, split into array
+ String[] splitLine = inLine.split(",");
+ if (splitLine != null && splitLine.length >= 10)
+ {
+ return splitLine[9]; // date in position 9
+ }
+ // Couldn't parse it, return null
+ return null;
+ }
+