Open source an Android candid app "Silent shoot" pea pod, FlyMe store has been online

Source: Internet
Author: User

First spend 3 seconds, preview the next app is about what to do, to solve what pain point:)

Demand points:

1: Volume keys to take pictures

2: No shutter sound, flash

3: Can take pictures under lock screen, or in other program interface

Ideas:

1: Create a Content Watcher (Contentobserver) to listen for volume changes

2: Use native camera for taking pictures

3: Same 1

Technical Summary:

The volume content of 1:android is divided into many kinds, the system, the ringtone, the music (audiomanager.stream_music), we only listen to the music is good

So the question is, how do you make sure that the volume key operation of the object in any case is music?

My solution is to play a silent audio in the background through the service, so that when the volume keys are blocked, the music volume changes:) How to record silent audio, use the audio recorder that comes with Windows, and then remember to convert to OGG format, so much smaller ~

2: Use native camera object, must have preview of object, this is Android in order to prevent you in the background without the user's knowledge to start camera shooting him. Workaround: Set the Preview object width height to 1dp (probably sesame Large) ... Don't ask me why not set to 0DP, so the camera can't lose out, the shot is a black dot.

3: Camera focus problem, the original method is the camera focus trigger is completed, the callback output image, but the camera focus speed to keep the environment, the impact of the performance of the machine is very large, it will cause me to press 3 times the volume key, the first 2 times in the focus, can not shoot the photo, the third time after the successful, the output of , the user experience is poor.

The idea is that the camera keeps focusing, and when taking pictures, I just output the image, whether it's coke or not. Code: The camera's focus mode is set to (Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE) when shooting, this is a newer API, previously used video, the difference is that the new focus mode is more intense, Frequent points, also make sure that we do not shoot the paste off.

4: Since is a candid app, then the picture is of course not appear in the album, the program, is placed in the package on the SD card location (android4.4, external SD card, in addition to the public and the program's own package, other locations can not be written. ) Getexternalfilesdir (null). GetAbsolutePath () + "/imgs/"

5: Since the picture does not belong to the album tube, it can only be managed by itself. Android comes with the picture control has been deprecated, so can only use the GridView declaration of each line 3, each picture width = (GridView width-picture between padding*3)/3; (except that three may cause the addition of countless, more than one or two DP, So our GridView MarginLeft to set 1DP, complete)

At first I loaded the captured photos directly from the storage, and the memory exhaustion program crashed (now the main cell phone pixels are 800w 1800w); Using the open source framework Picasso solves the memory problem.

6: Picture has mode, view mode: Click to zoom View details; Edit mode: Click to select

Picture list, we use Arrayadapter, the entity inside has a Boolean IsSelected, whether the selected property

Picture mode: View/Edit, we will mark Isimageedit in the public variable, each time GetView, according to isimageedit display whether each picture appears in the upper right corner of the tick box, according to IsSelected to determine whether the check box is selected

7: The bottom of the Cool tab card is the user's code, the simulation degree of 100%, their own implementation of the drawing code, through the Viewpager offset value, to set the brush alpha value, to achieve the effect of fading, very praise, it is worth a look, I am not understand anyway ...

8: Use Asynctask to separate IO operations from the main thread and never worry about Kaka!

Specific code implementation I also do not say, the source of the app is also hosted in the Oschina (GitHub instability OH), welcome Friends star, Fork, have the ability to push the wolf to the PR better ~

Oschina Address: Https://git.oschina.net/yso/JingPai

The last few words: The app is very good, but I did not Zeidan; Baidu Audit is very serious, unexpectedly said this app has a strong misleading effect and rejected my submission application, I can only say, the friend you are very discerning!

Final last: the Diffusion app. Benefit more friends ....

Open source an Android candid app "Silent shoot" pea pod, FlyMe store has been online

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.