当前位置: 首页>>代码示例>>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;未经允许,请勿转载。