APISonar


android.provider.CallLog.Calls.DATE

> android > provider > CallLog > Calls > DATE
android APIs provider APIs CallLog APIs Calls APIs DATE APIs

Example 1
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    adapter=
        new SimpleCursorAdapter(this, R.layout.row, null, new String[] {
            CallLog.Calls.NUMBER, CallLog.Calls.DATE }, new int[] {
            R.id.number, R.id.date });

    adapter.setViewBinder(this);
    setListAdapter(adapter);
    getLoaderManager().initLoader(0, null, this);
  }
Example 2
private Map<String,String> message(int DURATION, int TYPE, String NUMBER, Date callTime) {
        Map<String, String> map = new HashMap<String, String>();
        map.put(CallLog.Calls.DURATION, String.valueOf(DURATION));
        map.put(CallLog.Calls.TYPE, String.valueOf(TYPE));
        map.put(CallLog.Calls.NUMBER,   NUMBER);
        map.put(CallLog.Calls.DATE, String.valueOf(callTime.getTime()));
        return map;
    }
Example 3
public Loader<Cursor> onCreateLoader(int loaderId, Bundle args) {
    return(new CursorLoader(this, CallLog.Calls.CONTENT_URI,
                            PROJECTION, null, null, CallLog.Calls.DATE
                                + " DESC"));
  }
Example 4
private void setCallLogHeaders(Message message, Map<String,String> msgMap) throws MessagingException {
        message.setHeader(Headers.ID, msgMap.get(CallLog.Calls._ID));
        message.setHeader(Headers.TYPE, msgMap.get(CallLog.Calls.TYPE));
        message.setHeader(Headers.DATE, msgMap.get(CallLog.Calls.DATE));
        message.setHeader(Headers.DURATION, msgMap.get(CallLog.Calls.DURATION));
    }
Example 5
public boolean test() throws Throwable {
        try {
            ContentValues content = new ContentValues();
            content.put(CallLog.Calls.TYPE, CallLog.Calls.INCOMING_TYPE);
            content.put(CallLog.Calls.NUMBER, "1");
            content.put(CallLog.Calls.DATE, 20080808);
            content.put(CallLog.Calls.NEW, "0");
            Uri resourceUri = mResolver.insert(CallLog.Calls.CONTENT_URI, content);
            return ContentUris.parseId(resourceUri) > 0;
        } finally {
            mResolver.delete(CallLog.Calls.CONTENT_URI, CallLog.Calls.NUMBER + "=?", new String[] {"1"});
        }
    }
Example 6
public void addCallLog(CallLogEntry log) {
        String permission = Manifest.permission.WRITE_CALL_LOG;
        if (instrumentation.getTargetContext().checkCallingOrSelfPermission(permission) == PackageManager.PERMISSION_GRANTED) {
            ContentValues values = new ContentValues();
            values.put(CallLog.Calls.CACHED_NUMBER_TYPE, 0);
            values.put(CallLog.Calls.TYPE, log.getDirection());
            values.put(CallLog.Calls.DATE, log.getDate().getTime());
            values.put(CallLog.Calls.DURATION, log.getDuration());
            values.put(CallLog.Calls.NUMBER, log.getNumber());
            instrumentation.getTargetContext().getContentResolver().insert(CallLog.Calls.CONTENT_URI, values);
        } else {
            throw new PermissionDeniedException("Application Under Test does not have the required WRITE_CALL_LOGS permission for this feature..");
        }
    }