What I have changed to the app is
- Tried to save some precious battery for not connecting the network if the GPS is turned on, but seems did not work out.
The appropriate way is first check the status of GPS (on/off) and check if GPS signal is available. Will apply that in later stage.
Currently, connect to the network regardless the GPS is on or not. The GPS is turned on, but the GPS signal could be unavailable. The location acquired, therefore, is out-dated.
- {
- if(appSettings.getBoolean(AppSettings.Key_SMS_MobileData, false))
- {
- enableMobileData();
- }
- if(appSettings.getBoolean(AppSettings.Key_SMS_Wifi, false))
- {
- enableWifi();
- }
- isWaitingForResponse = true;
- }
2. Validate contact for code #10 or #STATUS only, proceed other information without validation
- if((code.indexOf("#10")!=-1||code.indexOf("#STATUS")!=-1)
- &&
- appSettings.getBoolean(AppSettings.Key_SMS_AllowSMSRequest, false)
- &&contactsManager.IsTrusted(userId))
- {
- connectNetworkBySMS();
- queuelRequest(userId);
- }
- if(code.indexOf("#BEGIN")!=-1 && code.indexOf("#END")!=-1)
- {
- Position p = updatePositionDB(senderNum, code);
- }
Okay, that's all for today, good night!
No comments:
Post a Comment