资源简介

扫描二维码登录的实现机制

 * Android客户端要给网页端发送信息,说登录的是我

 * 网页登录界面要不断的查询是否已经被扫描登录

总体分三步:

① PC端保存randnumber(随机数)

② Android客户端携带username 保存在randnumber那条记录上

③ PC端去服务器轮询,如果randnumber记录的username不为空,则实行登录即可

资源截图

代码片段和文件信息

package com.jikexueyuan.qrlogin;

import com.zxing.activity.CaptureActivity;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Paint.Cap;
import android.os.Bundle;
import android.view.View;
import android.view.View.onclickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends Activity implements onclickListener {

private Button btnScan;
private EditText etUsername;

private static final String WEB_URL = “http://172.31.19.202/QRLogin/“;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

btnScan = (Button) findViewById(R.id.btnScan);
btnScan.setOnCl

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-08-14 20:22  BarCodeLibrary\
     文件         528  2015-08-14 20:22  BarCodeLibrary\.classpath
     文件         814  2012-08-05 11:11  BarCodeLibrary\.project
     目录           0  2015-08-14 20:22  BarCodeLibrary\.settings\
     文件         173  2014-07-11 11:52  BarCodeLibrary\.settings\org.eclipse.jdt.core.prefs
     文件        1338  2012-08-05 11:29  BarCodeLibrary\AndroidManifest.xml
     目录           0  2012-08-05 11:11  BarCodeLibrary\assets\
     目录           0  2015-08-14 20:22  BarCodeLibrary\bin\
     文件        1338  2015-08-14 20:22  BarCodeLibrary\bin\AndroidManifest.xml
     文件      194560  2012-08-05 12:28  BarCodeLibrary\bin\BarCodeTest.apk
     文件       41497  2015-08-14 20:50  BarCodeLibrary\bin\barcodetest.jar
     目录           0  2015-08-14 20:22  BarCodeLibrary\bin\classes\
     文件      348412  2012-08-05 12:28  BarCodeLibrary\bin\classes.dex
     目录           0  2015-08-14 20:22  BarCodeLibrary\bin\classes\com\
     目录           0  2015-08-14 20:22  BarCodeLibrary\bin\classes\com\ericssonlabs\
     文件        1080  2015-08-14 20:22  BarCodeLibrary\bin\classes\com\ericssonlabs\BarCodeTestActivity$1.class
     文件        1941  2015-08-14 20:22  BarCodeLibrary\bin\classes\com\ericssonlabs\BarCodeTestActivity$2.class
     文件        2536  2015-08-14 20:22  BarCodeLibrary\bin\classes\com\ericssonlabs\BarCodeTestActivity.class
     文件         341  2015-08-14 20:22  BarCodeLibrary\bin\classes\com\ericssonlabs\BuildConfig.class
     文件         334  2015-08-14 20:50  BarCodeLibrary\bin\classes\com\ericssonlabs\R$attr.class
     文件        1696  2015-08-14 20:50  BarCodeLibrary\bin\classes\com\ericssonlabs\R$color.class
     文件         491  2015-08-14 20:50  BarCodeLibrary\bin\classes\com\ericssonlabs\R$drawable.class
     文件        1383  2015-08-14 20:50  BarCodeLibrary\bin\classes\com\ericssonlabs\R$id.class
     文件         478  2015-08-14 20:50  BarCodeLibrary\bin\classes\com\ericssonlabs\R$layout.class
     文件         479  2015-08-14 20:50  BarCodeLibrary\bin\classes\com\ericssonlabs\R$raw.class
     文件         481  2015-08-14 20:50  BarCodeLibrary\bin\classes\com\ericssonlabs\R$string.class
     文件         605  2015-08-14 20:50  BarCodeLibrary\bin\classes\com\ericssonlabs\R.class
     目录           0  2015-08-14 20:22  BarCodeLibrary\bin\classes\com\zxing\
     目录           0  2015-08-14 20:22  BarCodeLibrary\bin\classes\com\zxing\activity\
     文件         838  2015-08-14 20:22  BarCodeLibrary\bin\classes\com\zxing\activity\CaptureActivity$1.class
     文件         792  2015-08-14 20:22  BarCodeLibrary\bin\classes\com\zxing\activity\CaptureActivity$2.class
............此处省略200个文件信息

评论

共有 条评论