當前位置: 首頁>>代碼示例>>Java>>正文


Java DBProvider類代碼示例

本文整理匯總了Java中com.csipsimple.db.DBProvider的典型用法代碼示例。如果您正苦於以下問題:Java DBProvider類的具體用法?Java DBProvider怎麽用?Java DBProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DBProvider類屬於com.csipsimple.db包,在下文中一共展示了DBProvider類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addAllAccounts

import com.csipsimple.db.DBProvider; //導入依賴的package包/類
/**
 * Add accounts from database
 */
private void addAllAccounts() throws SameThreadException {
	Log.d(THIS_FILE, "We are adding all accounts right now....");

	boolean hasSomeSuccess = false;
	Cursor c = getContentResolver().query(SipProfile.ACCOUNT_URI, DBProvider.ACCOUNT_FULL_PROJECTION, 
			SipProfile.FIELD_ACTIVE + "=?", new String[] {"1"}, null);
	if (c != null) {
		try {
			int index = 0;
			if(c.getCount() > 0) {
   				c.moveToFirst();
   				do {
   					SipProfile account = new SipProfile(c);
   					if (pjService != null && pjService.addAccount(account) ) {
   						hasSomeSuccess = true;
   					}
   					index ++;
   				} while (c.moveToNext() && index < 10);
			}
		} catch (Exception e) {
			Log.e(THIS_FILE, "Error on looping over sip profiles", e);
		} finally {
			c.close();
		}
	}
	
	hasSomeActiveAccount = hasSomeSuccess;

	if (hasSomeSuccess) {
		acquireResources();
		
	} else {
		releaseResources();
		if (notificationManager != null) {
			notificationManager.cancelRegisters();
		}
	}
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:42,代碼來源:SipService.java

示例2: unregisterAllAccounts

import com.csipsimple.db.DBProvider; //導入依賴的package包/類
/**
 * Remove accounts from database
 */
private void unregisterAllAccounts(boolean cancelNotification) throws SameThreadException {

	releaseResources();
	
	Log.d(THIS_FILE, "Remove all accounts");
	
	Cursor c = getContentResolver().query(SipProfile.ACCOUNT_URI, DBProvider.ACCOUNT_FULL_PROJECTION, null, null, null);
	if (c != null) {
		try {
			c.moveToFirst();
			do {
				SipProfile account = new SipProfile(c);
				setAccountRegistration(account, 0, false);
			} while (c.moveToNext() );
		} catch (Exception e) {
			Log.e(THIS_FILE, "Error on looping over sip profiles", e);
		} finally {
			c.close();
		}
	}


	if (notificationManager != null && cancelNotification) {
		notificationManager.cancelRegisters();
	}
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:30,代碼來源:SipService.java

示例3: getSipProfileColumns

import com.csipsimple.db.DBProvider; //導入依賴的package包/類
private static Columns getSipProfileColumns(boolean only_secure) {
    Columns cols = new Columns(DBProvider.ACCOUNT_FULL_PROJECTION,
            DBProvider.ACCOUNT_FULL_PROJECTION_TYPES);
    if(only_secure) {
        // Never backup password
        cols.removeColumn(SipProfile.FIELD_DATA);
    }
    return cols;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:10,代碼來源:SipProfileJson.java

示例4: getAccount

import com.csipsimple.db.DBProvider; //導入依賴的package包/類
public SipProfile getAccount(long accountId) {
	// TODO : create cache at this point to not requery each time as far as it's a service query
	return SipProfile.getProfileFromDbId(this, accountId, DBProvider.ACCOUNT_FULL_PROJECTION);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:5,代碼來源:SipService.java


注:本文中的com.csipsimple.db.DBProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。