You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My App Engine app retrieves SMS messages from Google Voice using this
API. It worked before, but started crashed from today. I am not sure
if I made any changes. The crash caused when my app tries to call
"voice.getSMStreads()". It triggers the following exception:
Caused by: java.lang.NullPointerException
at
com.techventus.server.voice.util.SMSParser.parseContact(SMSParser.java:
125)
at
com.techventus.server.voice.util.SMSParser.getSMSThreads(SMSParser.java:
106)
at com.techventus.server.voice.Voice.getSMSThreads(Voice.java:688)
Could anyone please provide any insight about how to solve this
problem? Thank you very much!
Original issue reported on code.google.com by malone.j...@gmail.com on 19 Mar 2012 at 8:48
The text was updated successfully, but these errors were encountered:
The voice.getSMSTreads() still produces the same error as I mentioned in the
Google Group. Instead, I read SMS directly from the JSON response. And it works
now, but I can read only the latest SMS in each tread. Here is the code I wrote:
//After Voice setup
String unReadSMSXML = voice.getUnreadSMS();
jsonString = parseXML(unReadSMSXML);
JSONObject json = new JSONObject(jsonString);
JSONObject smsObjects = json.getJSONObject("messages");
if(smsObjects.length() != 0){
Date now = ServerTimeManipulator.getCurrentTime();
ArrayList<String> keys = getKeys(jsonString); //the code I wrote that gets only key for each SMS
readMessages = keys.size();
for(int i=0; i< keys.size(); i++){
String currentKey = keys.get(i);
JSONObject oneMessageJsonObject = (JSONObject) smsObjects.get(currentKey);
boolean read = (Boolean) oneMessageJsonObject.get("isRead");
if(!read){
String phoneNumber = (String) oneMessageJsonObject.get("phoneNumber");
String messageText = (String) oneMessageJsonObject.get("messageText");
//Process message
}
}
}
Original comment by malone.j...@gmail.com on 20 Mar 2012 at 3:23
Original issue reported on code.google.com by
malone.j...@gmail.com
on 19 Mar 2012 at 8:48The text was updated successfully, but these errors were encountered: