Code example for AssetManager: Using file assets

Methods: open

0
 
	public void testDetection() throws IOException, InvalidDBException { 
		Context ctx = getContext();
		 
		AssetManager am = ctx.getAssets();
		InputStream is = am.open("test.kdbx", AssetManager.ACCESS_STREAMING);
		 
		Importer importer = ImporterFactory.createImporter(is);
		 
		assertTrue(importer instanceof ImporterV4);
		is.close();
		 
	} 
	 
	public void testParsing() throws IOException, InvalidDBException { 
		Context ctx = getContext();
		 
		AssetManager am = ctx.getAssets();
		InputStream is = am.open("test.kdbx", AssetManager.ACCESS_STREAMING);
		 
		ImporterV4 importer = new ImporterV4();