I'm making an app where I want to detect user's face without showing it. I use standart android api which is android.hardware.Camera.faceDetection() When front camera sees the face, the phone vibrate. I've already implemented this part and now I need to make this app work on the background, so it shouldn't be preview shown on screen. Is it possible?
            Asked
            
        
        
            Active
            
        
            Viewed 815 times
        
    0
            
            
        
        Pavlo Kovalov
        
- 91
 - 1
 - 10
 
- 
                    1what are you trying to do ? some spy app ? be aware that google play store will check for it and maybe with the T.O.S you will not be able to launch it in the store – Gastón Saillén Feb 05 '18 at 19:52
 - 
                    1Possible duplicate of [How to record video from background of application : Android](https://stackoverflow.com/questions/10121660/how-to-record-video-from-background-of-application-android) – mattdonders Feb 05 '18 at 19:52
 - 
                    @IDroid No, of course not a spy app, everything is ok – Pavlo Kovalov Feb 06 '18 at 08:09
 - 
                    @PavloKovalov were you able to achieve that . As i have same requirements for my app and looking for a solution . – Sohail Yasin Oct 21 '20 at 08:09
 - 
                    1@SohailYasin no, unfortunately – Pavlo Kovalov Oct 21 '20 at 08:10
 
1 Answers
0
            The code below is for the Background Worker.
You can add your code in doInBackground().
It will execute your all processes in the background.
Hope it will help full to you.
import javax.swing.JOptionPane;
import javax.swing.SwingWorker;
public class Background extends SwingWorker<Void, Void>{
    @Override
    protected void done(){
            //JOptionPane.showMessageDialog(null,"Process Done Successfully...","Successfull",JOptionPane.INFORMATION_MESSAGE);
    }
    @Override
    protected Void doInBackground() throws Exception {
        //Write your code here
        return null;    
    }
}
        Dushyant Tankariya
        
- 1,432
 - 3
 - 11
 - 17
 
- 
                    Thank you so much! I didn’t think that it so easy, I thought I always have to show preview to make face detection work, that’s why I asked, thank you again!!! – Pavlo Kovalov Feb 06 '18 at 08:06
 -