• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CacheWordHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中info.guardianproject.cacheword.CacheWordHandler的典型用法代码示例。如果您正苦于以下问题:Java CacheWordHandler类的具体用法?Java CacheWordHandler怎么用?Java CacheWordHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CacheWordHandler类属于info.guardianproject.cacheword包,在下文中一共展示了CacheWordHandler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	// We have to ensure mStorage is mounted before super.onCreate
	// But also on each onResume as we should be eventually unmounting on onPause
	mStorage = ((MainApplication) getApplication()).getMountedSecureStorage();
       mCacheWordActivityHandler = new CacheWordHandler(this);
       mProgressDialogHandler = new ProgressDialogHandler(this);
       super.onCreate(savedInstanceState);
       // Enable "Up" Navigation
       if (getActionBar() != null) {
           getActionBar().setDisplayShowHomeEnabled(true);
           getActionBar().setDisplayHomeAsUpEnabled(false);

       }
       // Note that calling setContentView after super.onCreate
       // invalidates any View references made there. Any persisted views
       // must be re-connected
       setContentView(org.benetech.secureapp.R.layout.main_form_entry);
       mQuestionHolder = (android.widget.LinearLayout) findViewById(org.benetech.secureapp.R.id.questionholder);

       mNextButton = (ImageButton) findViewById(R.id.form_forward_button);
       mBackButton = getBackButton();
   }
 
开发者ID:benetech,项目名称:Secure-App-Generator,代码行数:24,代码来源:MainFormEntryActivity.java


示例2: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

    cacheWordActivityHandler = new CacheWordHandler(this);
    mProgressDialogHandler = new ProgressDialogHandler(this);

    extractFormFromAssetFolderToSecureStorage();
    initialiseExistingFormList();

    enableOdkSwipeAndButtonNavigations();
    setTitle(getString(R.string.app_name));
    ((MainApplication)getApplication()).registerLogoutHandler(this);
    isActivityPaused = false;
}
 
开发者ID:benetech,项目名称:Secure-App-Generator,代码行数:18,代码来源:MainActivity.java


示例3: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_view_log);
	
       // Check whether the user has set a database encryption passphrase
	SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
	if (prefs.getBoolean(KEY_DATABASE_PASSPHRASE_SAVED, false))
	{
		// Connect to the CacheWordService
		mCacheWordHandler = new CacheWordHandler(this);
		mCacheWordHandler.connectToService();
	}
	
	// Get Bitseal's current process ID
	mProcessID = android.os.Process.myPid();
	
	// Populate a ListView with Bitseal's log output
       mLogListView = (ListView)findViewById(android.R.id.list);
       updateListView();
}
 
开发者ID:JonathanCoe,项目名称:bitseal,代码行数:23,代码来源:ViewLogActivity.java


示例4: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) 
{
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_export_addresses);
	
       // Check whether the user has set a database encryption passphrase
	SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
	if (prefs.getBoolean(KEY_DATABASE_PASSPHRASE_SAVED, false))
	{
		// Connect to the CacheWordService
		mCacheWordHandler = new CacheWordHandler(this);
		mCacheWordHandler.connectToService();
	}
	
	// Get all Addresses from the application's database
	AddressProvider addProv = AddressProvider.get(getApplicationContext());
	addProv = AddressProvider.get(getApplicationContext());
	mAddresses = addProv.getAllAddresses();
	
	// Set up the ListView with data from the AddressAdapter
	AddressAdapter adapter = new AddressAdapter(mAddresses);
	mAddressListView = new ListView(this);
	mAddressListView = (ListView)findViewById(android.R.id.list);          
       setListAdapter(adapter);
}
 
开发者ID:JonathanCoe,项目名称:bitseal,代码行数:27,代码来源:ExportAddressesActivity.java


示例5: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) 
{
	super.onCreate(savedInstanceState);
	
       // Check whether the user has set a database encryption passphrase
	SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
	if (prefs.getBoolean(KEY_DATABASE_PASSPHRASE_SAVED, false))
	{
		// Connect to the CacheWordService
		mCacheWordHandler = new CacheWordHandler(this);
		mCacheWordHandler.connectToService();
	}
	
	setLayout();
	createDialogs();
	
	useExtras(getIntent()); // Use any extras bundled with the Intent that started this activity
	autoSetFromAddress(); // If we have only one address, auto-set mFromAddress
	setColours();
	
	populateEditTexts();
}
 
开发者ID:JonathanCoe,项目名称:bitseal,代码行数:24,代码来源:ComposeActivity.java


示例6: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_lock_screen);
   
    mViewCreatePassphrase = findViewById(R.id.llCreatePassphrase);
    mViewEnterPassphrase = findViewById(R.id.llEnterPassphrase);

    mEnterPassphrase = (EditText) findViewById(R.id.editEnterPassphrase);
    mNewPassphrase = (EditText) findViewById(R.id.editNewPassphrase);
    mConfirmNewPassphrase = (EditText) findViewById(R.id.editConfirmNewPassphrase);
    ViewFlipper vf = (ViewFlipper) findViewById(R.id.viewFlipper1);
    LinearLayout flipView1 = (LinearLayout) findViewById(R.id.flipView1);
    LinearLayout flipView2 = (LinearLayout) findViewById(R.id.flipView2);

    mSlider = new TwoViewSlider(vf, flipView1, flipView2, mNewPassphrase, mConfirmNewPassphrase);
    
    mCacheWord = new CacheWordHandler(this, this);
    mCacheWord.connectToService(); 
}
 
开发者ID:guardianproject,项目名称:CameraV,代码行数:21,代码来源:LockScreenActivity.java


示例7: SecureFileStorageManager

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
/**
 * Create a new secure virtual file system hosted within the provided file.
 */
public SecureFileStorageManager(CacheWordHandler cacheWordActivityHandler, String virtualFilesystemPath) {
       if (cacheWordActivityHandler == null)
           throw new IllegalArgumentException(MainApplication.getInstance().getString(R.string.error_message_cacheWord_activity_handler_is_null));

	mVirtualFilesystemPath = virtualFilesystemPath;
}
 
开发者ID:benetech,项目名称:Secure-App-Generator,代码行数:10,代码来源:SecureFileStorageManager.java


示例8: mountSecureStorage

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
public void mountSecureStorage(CacheWordHandler cacheWordActivityHandler) {
	if (sSecureStorage == null) {
		if (sSecureStoragePath == null) {
			throw new IllegalStateException(getString(R.string.error_message_cannot_mount_secure_storage));
		}
		sSecureStorage = new SecureFileStorageManager(cacheWordActivityHandler, sSecureStoragePath);
	}
	if (!sSecureStorage.isFilesystemMounted()) {
		sSecureStorage.mountFilesystem(this, cacheWordActivityHandler.getEncryptionKey());
	}
	sNumSecureStorageHolds++;
}
 
开发者ID:benetech,项目名称:Secure-App-Generator,代码行数:13,代码来源:MainApplication.java


示例9: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    cacheWordActivityHandler = new CacheWordHandler(this);
    mProgressDialogHandler = new ProgressDialogHandler(this);
    mSettings = PreferenceManager.getDefaultSharedPreferences(this);
}
 
开发者ID:benetech,项目名称:Secure-App-Generator,代码行数:9,代码来源:AbstractLoginActivity.java


示例10: uploadCurrentInstanceForm

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
/**
 * Use the {@link org.odk.collect.android.logic.FormController} to
 * retrieve the currently active Form Instance, and upload it to Martus
 */
public void uploadCurrentInstanceForm(CacheWordHandler cacheWordActivityHandler) {
    mCacheWordActivityHandler = cacheWordActivityHandler;
    // TODO: Move Util or extract method
    Cursor instanceForm = Util.getFormCursorForCurrentInstance(mHostActivity);
    uploadInstanceFormFromCursor(instanceForm, mCacheWordActivityHandler);
}
 
开发者ID:benetech,项目名称:Secure-App-Generator,代码行数:11,代码来源:MartusUploadManager.java


示例11: SQLCipherOpenHelper

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
public SQLCipherOpenHelper(CacheWordHandler cacheWord, Context context, String name,
        CursorFactory factory, int version) {
    super(context, name, factory, version, new SQLCipherV3MigrationHook(context));
    if (cacheWord == null)
        throw new IllegalArgumentException("CacheWordHandler is null");
    mHandler = cacheWord;
}
 
开发者ID:zom,项目名称:Zom-Android,代码行数:8,代码来源:SQLCipherOpenHelper.java


示例12: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@Override
public boolean onCreate() {

    mCacheword = new CacheWordHandler(getContext(),this);
    mCacheword.connectToService();

    return true;
}
 
开发者ID:zom,项目名称:Zom-Android,代码行数:9,代码来源:ImpsProvider.java


示例13: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_view_errors);
	
	try
	{
		// Check whether the user has set a database encryption passphrase
		SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
		if (prefs.getBoolean(KEY_DATABASE_PASSPHRASE_SAVED, false))
		{
			// Connect to the CacheWordService
			mCacheWordHandler = new CacheWordHandler(this);
			mCacheWordHandler.connectToService();
		}
		
		// Get Bitseal's current process ID
		mProcessID = android.os.Process.myPid();
		
		// Populate a ListView with Bitseal's recent errors
        mErrorListView = (ListView) findViewById(android.R.id.list);
        updateListView();
	}
	catch (Exception e)
	{
		Log.e(TAG, "Exception ocurred in ViewErrorsActivity.onCreate(). The exception message was:\n"
				+ e.getMessage());
    }
}
 
开发者ID:JonathanCoe,项目名称:bitseal,代码行数:31,代码来源:ViewErrorsActivity.java


示例14: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) 
{
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_identities);
	
       // Check whether the user has set a database encryption passphrase
	SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
	if (prefs.getBoolean(KEY_DATABASE_PASSPHRASE_SAVED, false))
	{
		// Connect to the CacheWordService
		mCacheWordHandler = new CacheWordHandler(this);
		mCacheWordHandler.connectToService();
	}
	
	// Get all Addresses from the application's database
	AddressProvider addProv = AddressProvider.get(getApplicationContext());
	addProv = AddressProvider.get(getApplicationContext());
	mAddresses = addProv.getAllAddresses();
	
	// Set up the ListView with data from the AddressAdapter
	AddressAdapter adapter = new AddressAdapter(mAddresses);
	mAddressListView = new ListView(this);
	mAddressListView = (ListView)findViewById(android.R.id.list);          
       setListAdapter(adapter);
	
       // Check whether this is the first time the identities activity has been opened - if so then let's create a new address for them
	if (prefs.getBoolean(IDENTITIES_FIRST_OPEN, true))
	{
		runFirstOpenRoutine();
	}
}
 
开发者ID:JonathanCoe,项目名称:bitseal,代码行数:33,代码来源:IdentitiesActivity.java


示例15: openBitseal

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
/**
    * Checks whether the correct conditions to open the app have been met and, if so, 
    * opens the app. 
    */
   @SuppressLint("InlinedApi")
private void openBitseal()
   {
	// Check whether onCacheWordOpened() has been called
   	if (mOnCacheWordOpenedCalled)
	{
		// Reset this flag
		mOnCacheWordOpenedCalled = false;
		
		// Cancel the 'handle hung unlock attempts' timer task
		mUnlockAttemptTimerTask.cancel();
		
		// Clear any 'unlock' notifications
		NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
		notificationManager.cancel(NotificationsService.getUnlockNotificationId());
		
		// Open the Inbox Activity
		Intent intent = new Intent(getBaseContext(), InboxActivity.class);
		intent.putExtra(EXTRA_DATABASE_UNLOCKED, true);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) // FLAG_ACTIVITY_CLEAR_TASK only exists in API 11 and later 
        {
        	intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);// Clear the stack of activities
        }
        else
        {
        	intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }
        startActivity(intent);
	}
	else
	{
		Log.e(TAG, "LockScreenActivity.openBitseal() was called, but onCacheWordOpened() has not yet been called!");
		// Attempt to handle this failure
		mCacheWordHandler = new CacheWordHandler(mActivityContext);
		mCacheWordHandler.connectToService();
		new AttemptUnlockTask().execute(new String[]{enterPassphraseEditText.getText().toString()});
	}
   }
 
开发者ID:JonathanCoe,项目名称:bitseal,代码行数:43,代码来源:LockScreenActivity.java


示例16: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_splash_screen);
	
	mCacheWordHandler = new CacheWordHandler(this);
	mCacheWordHandler.connectToService();
	
	new InitializeDatabaseTask().execute();
}
 
开发者ID:JonathanCoe,项目名称:bitseal,代码行数:12,代码来源:SplashScreenActivity.java


示例17: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) 
{
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_sent);
	
       // Check whether the user has set a database encryption passphrase
	SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
	if (prefs.getBoolean(KEY_DATABASE_PASSPHRASE_SAVED, false))
	{
		// Connect to the CacheWordService
		mCacheWordHandler = new CacheWordHandler(this);
		mCacheWordHandler.connectToService();
	}
	
	// Get all 'sent' Messages from the database
	MessageProvider msgProv = MessageProvider.get(getApplicationContext());
	mMessages =msgProv.searchMessages(MessagesTable.COLUMN_BELONGS_TO_ME, String.valueOf(1)); // 1 stands for "true" in the database
	
       // Sort the messages so that the most recent are displayed first
       Collections.sort(mMessages);
	
       MessageAdapter adapter = new MessageAdapter(mMessages);
       mSentListView = new ListView(this);
       mSentListView = (ListView)findViewById(android.R.id.list);   
       setListAdapter(adapter);
}
 
开发者ID:JonathanCoe,项目名称:bitseal,代码行数:29,代码来源:SentActivity.java


示例18: SQLCipherOpenHelper

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
public SQLCipherOpenHelper(CacheWordHandler cacheWordHandler, Context context, String name, CursorFactory factory, int version) 
  {
      super(context, name, factory, version, new SQLCipherV3MigrationHook(context));
      
      if (cacheWordHandler == null)
      {
      	throw new IllegalArgumentException("CacheWordHandler is null");
      }
      
mCacheWordHandler = cacheWordHandler;
  }
 
开发者ID:JonathanCoe,项目名称:bitseal,代码行数:12,代码来源:SQLCipherOpenHelper.java


示例19: onCreate

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
@SuppressLint("InlinedApi")
@Override
   public boolean onCreate() 
   {    	
   	Log.i(TAG, "Database content provider onCreate() called");
   	
   	sContext = getContext();
   	
   	sCacheWordHandler = new CacheWordHandler(sContext, this);
   	sCacheWordHandler.connectToService();
   	
   	sDatabaseHelper = new DatabaseHelper(sContext, sCacheWordHandler);
	
	return false;
   }
 
开发者ID:JonathanCoe,项目名称:bitseal,代码行数:16,代码来源:DatabaseContentProvider.java


示例20: runLockRoutine

import info.guardianproject.cacheword.CacheWordHandler; //导入依赖的package包/类
/**
 * Does all the work necessary to securely lock the application.
 * 
 * @param cacheWordHandler - An instance of CacheWordHandler to be
 * provided by the caller of this method
 */
public static void runLockRoutine(CacheWordHandler cacheWordHandler)
{
	// Destroy the cached database encryption key
   	cacheWordHandler.lock();
   	    	
   	// Close the database
   	DatabaseContentProvider.closeDatabase();
   	
   	// Open the splash screen activity. Doing this makes the process of restarting the app appear much smoother to the user. 
   	Context appContext = App.getContext();
       Intent intent0 = new Intent(appContext, SplashScreenActivity.class);
       if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) // FLAG_ACTIVITY_CLEAR_TASK only exists in API 11 and later 
       {
       	intent0.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK);// Clear the stack of activities
       }
       else
       {
       	intent0.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
       }
       appContext.startActivity(intent0);
   	
   	// Exit the app, releasing all resources
   	System.exit(0);
   	
   	// Restart the app, opening the lock screen activity
       Intent intent1 = new Intent(appContext, LockScreenActivity.class);
       if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) // FLAG_ACTIVITY_CLEAR_TASK only exists in API 11 and later 
       {
       	intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK);// Clear the stack of activities
       }
       else
       {
       	intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
       }
       appContext.startActivity(intent1);
}
 
开发者ID:JonathanCoe,项目名称:bitseal,代码行数:43,代码来源:AppLockHandler.java



注:本文中的info.guardianproject.cacheword.CacheWordHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DefaultSubMenu类代码示例发布时间:2022-05-22
下一篇:
Java OnSwipeMenuItemClickListener类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap