Social by lending books .1


控制不住的我会买很多书,有时候朋友会提到想看我的书单。所以决定做个简单的小程序满足这需求。
核心功能:扫描图书的ISBN码,上传到网络中构成数字的个人图书馆,可以很简单的分享到不同社交平台。

ISBN码扫描 Zxing
数据存储 Parse
ISBN查询 douban
用户登录 weibo / douban
Server dotcloud

ISBN码扫描

安装Zxing apk
创建一个新的android项目
在MainActivity中加个button,添加上onClick事件
final Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
IntentIntegrator integrator = new IntentIntegrator((Activity) mContext);
integrator.initiateScan();
}
});

再添加一个响应函数
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null) {
Log.d("Books", "GOTIT," + scanResult.getContents());
// handle scan result
} else {
Log.d("Books", "SAD," + scanResult.getContents());
}
// else continue with any other code you need in the method
}

这样就完成了获取ISBN部分的代码。装上找本书试试。

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google+ photo

You are commenting using your Google+ account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s

在WordPress.com的博客.

向上 ↑

%d 博主赞过: