亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Android Password Manager

系統 2325 0

Android Password Manager

Android Password Manager

This is an adaptation of PasswordSafe by Steven Osborn (released under the Apache License) which is basic password manager for the Android platform. The source code have been adapted to use db4o instead of SQLite which makes the handling of persistence much more intuitive while still being fast.

Details

The application basically?stores login information for websites such as url, username and password in a secure way using 128 Bit AES Encryption. The user must provide the correct password in order to access the application and this password is then used to encrypt/decrypt the data.

This is a sample video of the db4o powered application running on the Android Emulator:

http://www.youtube.com/watch?v=UFSD44AcBwM

If you check the source code (see the end of this page) you'll see that the the DBHelper class (SQLite persistence) has been replaced by the Db4oHelper class (db4o persistence). Let me now show you some of the differences between handling?persistence with db4o and SQLite.

?

SQL Initialization overhead

This is the SQL code that you need to initialize the password manager for SQLite (table names, table creation commands, etc):

And this is the equivalent db4o code:

As you might notice, you don't have to preinitialize your schema with db4o! (with db4o your object model is your schema and refactoring is handled gracefully ?or even automatically for simple cases )

?

Database opening and creation mechanism

With SQLite you?need two different method calls, one for the creation of the database and another one for opening it:

while with db4o you just call openFile() and it will create or open depending on whether the DB exists:

Might not sound like a big deal but less code is cleaner code!

?

Updating and inserting data

As with any relational database with SQLite you need to pass insert or update commands according to the situation (not to mention that you must also construct the SQL string reflecting all fields?with no errors?for the commands to work properly):

And this is the equivalent db4o code:

Do you see any difference? db4o is indeed a one-line-of-code storage database. db4o detects automatically whether the object is new or preexisting and updates or inserts accordingly (we just call this a store operation ). Note that here we provide the next id for the object manually but db4o can also be configured to autoincrement a field .?

?

Fetching all entries

Note the manual object relational mapping that we have to do with SQLite:

and forget about it with db4o:

Note?that in this simple query we're asking for all PassEntry objects and sorting the result by the field "id" (while there's no sorting in the SQLite example). In this case the query is performed via SODA .

It couldn't be simpler!!!

?

Fetching an entry by a field

Here the code for fetching entries by Id when using the SQLite version:

and here's the db4o version using one of the? three query systems of db4o (in this case we use Query by Example aka QBE instead of SODA ):

Much shorter an cleaner!

?

Conclusion

I hope you've realized about the benefits of db4o with this short demonstration (and this is just the basic stuff that you can do with db4o). Do you want to take persistence to the next level in your app too? Download db4o for Java or .NET now . It's FREE!!!

Other resources:

?

TODO

  • Replace the custom encryption algorithm with XTEA ?(which will provide database level and io encryption instead of field encryption)
  • Provide search capabilities (in order to filter the entries by name)

Steve's Password Safe project?is under active development on Google Code (more TODOs here):

http://code.google.com/p/android-passwordsafe/issues/

?

Bugs

  • There's an error when trying to edit a url in the website field of the password entry editor

?

Downloads

?

Password-Safe-Db4o.Zip ( Details )
Download (1.1MB)

?

Original "Password Safe" by Steve Osborn (without db4o) can be downloaded here

Android Password Manager


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦?。?!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 欧美日本成人 | 久草在线视频免费播放 | 性欧洲精品videos' | 99久久久久国产 | 一本一本久久a久久精品综合麻豆 | 香蕉视频在线免费 | 一区二区三区四区国产精品 | 国产精品欧美日韩精品 | 手机看片福利 | 黄色视屏在线免费观看 | 999精品免费视频观看 | www.香蕉视频 | 久久免费高清视频 | 亚洲午夜一级毛片 | 国产成人免费手机在线观看视频 | 免费国产阿v视频在线观看 免费国产不卡午夜福在线 免费国产不卡午夜福在线观看 | 免费福利在线 | 精品欧美成人bd高清在线观看 | 久久久这里只有精品加勒比 | 欧美一级在线 | 在线精品国精品国产不卡 | 国产伦精品一区三区视频 | 伊人久久青草青青综合 | 99热久久这里只精品国产9 | 亚洲一区二区三区播放在线 | 日本aaaa级毛片在线看 | 久久成年人 | 毛片视屏 | 免费观看羞羞视频网站 | 成人aa在线观看视频 | 成人毛片免费看 | 尹人视频在线观看 | 92国产福利久久青青草原 | 久久ri精品高清一区二区三区 | 久久精品中文字幕不卡一二区 | 久久中文字幕2021精品 | 亚洲欧美日韩精品久久久 | 亚洲国产视频在线观看 | 亚洲偷图色综合色就色 | 天天夜天干天天爽 | 欧美 亚洲 一区 |