





{"id":1569,"date":"2010-11-25T01:58:13","date_gmt":"2010-11-25T05:58:13","guid":{"rendered":"http:\/\/www.killtest.hk\/?p=1569"},"modified":"2010-11-25T02:00:34","modified_gmt":"2010-11-25T06:00:34","slug":"android","status":"publish","type":"post","link":"https:\/\/www.killtest.hk\/index.php\/killtest\/android\/","title":{"rendered":"Android\u6578\u64da\u5eab\u4e8b\u52d9\u6dfa\u6790"},"content":{"rendered":"<p>\u5728Android\u61c9\u7528\u7a0b\u5e8f\u958b\u767c\u4e2d\uff0c\u7d93\u5e38\u6703\u9047\u5230\u9700\u8981\u9032\u884c\u6578\u64da\u5eab\u64cd\u4f5c\u7684\u6642\u5019\uff0c\u6709\u95dc\u6578\u64da\u5eab\u4e8b\u52d9\u8655\u7406\u5c0dAndroid\u61c9\u7528\u7a0b\u5e8f\u7684\u7a69\u5b9a\u6027\u548c\u6548\u7387\u63d0\u5347\u975e\u5e38\u91cd\u8981\u3002<br \/>\n\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0 \u9996\u5148Android\u6578\u64da\u5eab\u64cd\u4f5c\uff0c\u7279\u5225\u662f\u9032\u884c\u5beb\u64cd\u4f5c\u7684\u6642\u5019\u975e\u5e38\u6162\uff0c\u5c07\u6240\u6709\u64cd\u4f5c\u6253\u5305\u6210\u58f9\u500b\u4e8b\u52d9\u80fd\u5927\u5927\u63d0\u9ad8\u8655\u7406\u901f\u5ea6\u3002<br \/>\n\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0 \u5176\u6b21\u662f\u4fdd\u8b49\u6578\u64da\u7684\u58f9\u81f4\u6027\uff0c\u8b93\u58f9\u500b\u4e8b\u52d9\u4e2d\u7684\u6240\u6709\u64cd\u4f5c\u90fd\u6210\u529f\u57f7\u884c\uff0c\u6216\u8005\u5931\u6557\uff0c\u6216\u8005\u6240\u6709\u64cd\u4f5c\u56de\u6efe\u3002<br \/>\n\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0 \u5982\u679c\u60a8\u559c\u6b61\u4f7f\u7528\u5176\u4ed6\u5e73\u81fa\uff08\u5982PHP + MySQL\uff09\uff0c\u4ee3\u78bc\u901a\u5e38\u5728\u58f9\u500b\u529f\u80fd\u5f37\u5927\u7684\u670d\u52d9\u5668\u4e0a\u904b\u884c\uff0c\u58f9\u822c\u4e0d\u6703\u88ab\u610f\u5916\u4e2d\u6b62\uff0c\u4f46\u5728Android\u5e73\u81fa\u4e0a\uff0c\u60a8\u5c07\u6703\u56e0\u70ba\u58f9\u6b21\u53c8\u58f9\u6b21\u7684\u610f\u5916\u4e2d\u6b62\u611f\u5230\u9a5a\u5440\u3002Android\u7cfb\u7d71\u6703\u6bba\u6b7bapps\/threads\/activities\u7b49\u4e2d\u65b7\u6578\u64da\u5eab\u7684\u4f7f\u7528\uff0c\u96fb\u6c60\u96fb\u91cf\u6703\u8017\u76e1\u6216\u88ab\u79fb\u9664\u7b49\u3002\u6240\u4ee5\uff0c\u4f7f\u7528\u6578\u64da\u5eab\u4e8b\u7269\u81f3\u95dc\u91cd\u8981\u3002<br \/>\n\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0 \u5be6\u73feAndroid\u6578\u64da\u5eab\u4e8b\u52d9\u975e\u5e38\u7c21\u55ae\uff0c\u53ea\u9700\u8981\u4f7f\u7528SQLiteDatabase\u985e\u7684\u4e09\u500b\u65b9\u6cd5\u5373\u53ef\u3002<br \/>\n\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0 \u25c6beginTransaction\uff08\uff09\uff1b<br \/>\n\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0 \u25c6setTransactionSuccessful\uff08\uff09\uff1b<br \/>\n\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0 \u25c6endTransaction\uff08\uff09\uff1b<br \/>\n\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0 \u7576\u8abf\u7528endTransaction\uff08\uff09\u6642\uff0c\u6240\u6709\u5f9ebeginTransaction\uff08\uff09\u958b\u59cb\u7684\u64cd\u4f5c\u90fd\u6703\u88ab\u63d0\u4ea4\u3002<br \/>\n\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0 \u58f9\u500b\u7c21\u55ae\u7684\u6578\u64da\u5eab\u4e8b\u52d9\u64cd\u4f5c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p>\u00a0<br \/>\n\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0 mDatabase.beginTransaction\uff08\uff09\uff1b\u00a0 try{\u00a0\u00a0\u00a0 \/\/\u5728\u9019\u88cf\u57f7\u884c\u591a\u500b\u6578\u64da\u5eab\u64cd\u4f5c\u00a0\u00a0\u00a0 \/\/\u57f7\u884c\u904e\u7a0b\u4e2d\u53ef\u80fd\u6703\u62cb\u51fa\u7570\u5e38\u00a0\u00a0\u00a0 mDatabase.setTransactionSuccessful\uff08\uff09\uff1b\u00a0\u00a0\u00a0 \/\/\u5728setTransactionSuccessful\u548cendTransaction\u4e4b\u9593\u4e0d\u9032\u884c\u4efb\u4f55\u6578\u64da\u5eab\u64cd\u4f5c\u00a0\u00a0\u00a0 }catch\uff08Exception e\uff09{\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/\u7576\u6578\u64da\u5eab\u64cd\u4f5c\u51fa\u73fe\u932f\u8aa4\u6642\uff0c\u9700\u8981\u6355\u7372\u7570\u5e38\uff0c\u7d50\u675f\u4e8b\u52d9\u00a0\u00a0\u00a0\u00a0\u00a0 mDatabase.endTransaction\uff08\uff09\uff1b\u00a0\u00a0\u00a0\u00a0\u00a0 throw e;\u00a0\u00a0\u00a0 }\u00a0\u00a0\u00a0 \/\/\u7576\u6240\u6709\u64cd\u4f5c\u57f7\u884c\u5b8c\u6210\u5f8c\u7d50\u675f\u58f9\u500b\u4e8b\u52d9\u00a0\u00a0\u00a0 mDatabase.endTransaction\uff08\uff09\uff1b\u00a0 }<br \/>\n\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0 \u4ee5\u4e0a\u662f\u95dc\u65bcAndroid\u6578\u64da\u5eab\u4e8b\u52d9\u64cd\u4f5c\u7684\u58f9\u500b\u7c21\u55ae\u793a\u4f8b\uff0c\u5728\u6211\u5011\u5e73\u6642\u7684Android\u958b\u767c\u4e2d\uff0c\u5c07\u6240\u6709\u64cd\u4f5c\u6253\u5305\u6210\u58f9\u500b\u4e8b\u52d9\u70ba\u58f9\u500b\u4e8b\u52d9\u4e26\u4fdd\u8b49\u4e8b\u52d9\u7684\u58f9\u81f4\u6027\uff0c\u53ef\u4ee5\u5927\u5e45\u63d0\u9ad8Android\u6578\u64da\u5eab\u64cd\u4f5c\u7684\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728Android\u61c9\u7528\u7a0b\u5e8f\u958b\u767c\u4e2d\uff0c\u7d93\u5e38\u6703\u9047\u5230\u9700\u8981\u9032\u884c\u6578\u64da\u5eab\u64cd\u4f5c\u7684\u6642\u5019\uff0c\u6709\u95dc\u6578\u64da\u5eab\u4e8b\u52d9\u8655\u7406\u5c0dAndroid\u61c9\u7528\u7a0b\u5e8f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[625,627,626],"class_list":["post-1569","post","type-post","status-publish","format-standard","hentry","category-killtest","tag-android","tag-627","tag-626"],"_links":{"self":[{"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/posts\/1569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/comments?post=1569"}],"version-history":[{"count":0,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/posts\/1569\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/media?parent=1569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/categories?post=1569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/tags?post=1569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}