Summer dog sophomore computer android learning (two-dimensional code)

2015/7/15 late 21:45

After heavy rain sultry bedroom, only here the way until only the head of the fan chilly, eye pain, but it does not matter.

The beginning of the summer vacation two days, I was the happiest year period of time, I can finally quietly programming, and ecstasy.

Shaw is in accordance with the effect described, write a android code. Substantially requirements are as follows:

1. The two-dimensional code scanning, display the animation;

2. The background is a camera preview, requires real-time camera display screen as the animation plays;

3. The two-dimensional code is generated by me.

The first day of preparation, download ZXing, and use them captureActivity class to write a piece of code scanning and generate two-dimensional code.

The next day, learning camera preview, download a photograph of the demo (thank yanzi1225627 , attach article links http://blog.csdn.net/yanzi1225627/article/details/33028041), simplifying its camera function, leaving only the camera preview function, and through a number of video data, understand the core knowledge points surfaceView (creat, change, destroy) .

On the third day, which is today, ready to redraw the view in viewFinderView, the animation is added. So far my train of thought is: First layout surfaceView, the camera preview, then the layout viewFinderView, two-dimensional code scanning, but ZXing has written these two together, so that I now only do is:

1. Scan the QR code on your phone calls animation;

2. The animated show on viewFinderView.

But the question is:

1. I do not know how the two-dimensional code is scanned, only know captureActivity in;

2. Do not know when to call scanned resources;

3. Do not know how to call the resource, and what resources are stored in the form of two-dimensional code;

4. I do not know how to call the animation is displayed on the viewFinderView.

Mind confused! ! ! !

————————————————————————————————————————————————————————————

2015/7/16

Laoganma roommate still did not cover air cover ...... still sweet.

As always, a lot of learning-by-doing on the road detours. Two days before the feeding Mao kept watching the camera and preview and view related articles, and later wrote a camera preview demo demo and view the layout after the discovery zxing which have been integrated well ......, but still would like to thank Guolin , attach links to articles http://blog.csdn.net/guolin_blog/article/details/17357967.

Problems have been resolved, but other problems have emerged:

1. Can not call DecodeHandler in rawResult in viewFinderView in.

Try method:

1. rawResult set a global variable, the new class inherits class ...... application method Baidu itself. failure!

2. Create an object DecodeHandler in viewFinderView, the direct call rawResult. failure!

The next step plan:

1. Study android messaging communication component;

2. Learn finish if not, then try to continue to Method 1.

It seems not to learn it again android system does not work!

————————————————————————————————————————————————————————————

2015/7/17

 His girlfriend complained about not care about her! After such a thing will not happen very often ......

Today, learning a bit handler, message, looper had wanted to see if you can use the message coming out of the decoding result, it failed because the message can only spread the message pool. But the unexpected discovery methods may return startActivityForResult update the UI parsed data, mainly rewrite onActivityResult (int requestCode, int resultCode, Intent data) method, and after which the Intent data is to parse the data! Tomorrow learn about both methods.

PS: his girlfriend is sick, not much could write time ......

————————————————————————————————————————————————————————————

2015/7/18

Almost to accompany his girlfriend one day

Afternoon harvest little, in order to allow two-dimensional code scanning after the animation is displayed on the viewFinderView, tried two methods:

1. Custom event listeners;

2. callback.

I thought tonight sitting on the playground, two questions:

1. The data problems, that is, the parsed data go?

2.view problem, call the animation in which the view is displayed, viewFinderView or new view?

And only solve the result, in order to continue downward.

Tomorrow tasks:

1. content analysis result;

2. Analysis result whereabouts and how to invoke.

————————————————————————————————————————————————————————————

2015/7/19 cold

Decoding results handleDecode, but it is still unclear whereabouts of the results.

Trying to redraw viewFinderView, did not understand how to write ...... Finally, the soil method: first add a control in the xml file, and then setText.

Tomorrow tasks: scanning the two-dimensional code display pictures, call the problem of resources.

Guess you like

Origin blog.csdn.net/qq_24598059/article/details/46899135