Android : Samsung Galaxy Tabs and Android 2.2 Devices Showing GPS date 1 Day Advance from 1st jan 2012

后端 未结 4 2023
南旧
南旧 2020-12-09 03:02

I have the Galaxy tab GT-P1000 7 inch with firmware version 2.3.3 and Phones running Android 2.2. In both versions when ever I am trying to get the time from GPS, its showin

4条回答
  •  醉话见心
    2020-12-09 03:37

    It worked for me and I replaced IsValid(String strNMEA) method with this function:

    private boolean checksum(String strNMEA)
        {
            int checksum = 0;
    
            strNMEA = strNMEA.replace("\r", "");
            strNMEA = strNMEA.replace("\n", "");
    
            String strChecksum = strNMEA.substring(strNMEA.indexOf("*") + 1);
    
            String str = strNMEA.substring(1, strNMEA.indexOf("*"));
    
            for (int i = 0; i < str.length(); i++) {
                checksum = checksum ^ str.charAt(i);
            }
    
            return checksum == Integer.valueOf(strChecksum, 16);
    
        }
    

提交回复
热议问题