This commit is contained in:
2020-12-01 23:32:28 +08:00
parent 98f0941160
commit e786fd266d
15 changed files with 294 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
package com.coolape.tianrun;
import android.util.Log;
import org.json.JSONException;
import org.json.JSONObject;
public class CallLogInfo {
public String number;
public String date;
public int type;
public CallLogInfo(String number, String date, int type) {
super();
this.number = number;
this.date = date;
this.type = type;
}
public JSONObject toJson(){
try {
JSONObject jsonObject = new JSONObject();
jsonObject.put("number", number);
jsonObject.put("date", date);
/* Call log type for incoming calls.
public static final int INCOMING_TYPE = 1;
Call log type for outgoing calls.
public static final int OUTGOING_TYPE = 2;
Call log type for missed calls.
public static final int MISSED_TYPE = 3;
*/
jsonObject.put("type", type);
return jsonObject;
} catch (JSONException e) {
Log.i("", e.getMessage());
return null;
}
}
}