Android Safety system. Advanced FTP WebCam Rescue Photo - Android Phone Web Cam with FTP support

Rescue Photo Software

Android Camera2 API


      Android Source Code
      
      Java program for surveillance using an Android smartphone. Webcam with FTP access to the photo storage.
      
      
  Android Safety SYSTEM >>  
      
      Let's see how to work with a camera - how to choose a camera, open, close, take a picture, choose a file size and format.
      
      // == Camera2 API ===============================================
      private void createCameraPreviewSession() {
      mImageReader = ImageReader.newInstance(1920,1080, ImageFormat.JPEG,1); // The ImageReader class provides direct
      // application access to the image data displayed in the surface
      // If you set the image format to JPG, it will have a low FPS
      // mImageReaderYUV = ImageReader.newInstance(1920,1080,ImageFormat.YUV_420_888,1);
      mImageReader.setOnImageAvailableListener(mOnImageAvailableListener, null); // Callback interface to be notified when a new image is available
        SurfaceTexture texture = mImageView.getSurfaceTexture();
        texture.setDefaultBufferSize(1920,1080); // 1920,1080
        Surface surface = new Surface(texture); //Создаем Surface
      
        Log.i(LOG_TAG, "==| Create Surface |== in createCameraPreviewSession()");
        try {
          final CaptureRequest.Builder builder =
            mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);
        
          builder.addTarget(surface);
      // In order to be able to view or take pictures, you need to create a session to work with the camera. Call the createCaptureSession () method for the selected camera.
      
        mCameraDevice.createCaptureSession(Arrays.asList(surface,mImageReader.getSurface()),
        new CameraCaptureSession.StateCallback() {
        
        @Override
        public void onConfigured(CameraCaptureSession session) { // Take a picture here
          mCaptureSession = session;
          try {
            mCaptureSession.setRepeatingRequest(builder.build(),null,mBackgroundHandler);
            Log.i(LOG_TAG, "==| private void onConfigured |== Camera Capture Session Success ");
          } catch (CameraAccessException e) {
            Log.i(LOG_TAG, "==| private void onConfigured |== Camera Capture Session Error ");
            e.printStackTrace();
          }
        }
        
        @Override
        public void onConfigureFailed(CameraCaptureSession session) { }}, mBackgroundHandler);
        } catch (CameraAccessException e) {
      Log.i(LOG_TAG, "== | private void createCameraPreviewSession | == onConfigureFailed ");
      e.printStackTrace();
        }
      }
      
      CreateCameraPreviewSession
      
      Here we are trying to output an image (data stream) to the mImageView texture, which is already defined in the layout activity_main.xml. You can even determine with what resolution in pixels.
      
      Here we set the parameters of the picture - the JPG format, and the number of pixels.
      
      mImageReader = ImageReader.newInstance(1920,1080, ImageFormat.JPEG,1); // The ImageReader class provides direct
      
      mImageView.getSurfaceTexture() - getSurfaceTexture This method returns the SurfaceTexture used by this view
      
      mImageView.getBitmap(int width, int height) - getBitmap(int width, int height) This method returns Returns a Bitmap representation of the content of the associated surface texture.
      
      In order to use TextureView, all you need to do is get its SurfaceTexture.The SurfaceTexture can then be used to render content. In order to do this, you just need to do instantiate an object of this class and implement SurfaceTextureListener interface.
      
      private TextureView myTexture;
      public class MainActivity extends Activity implements SurfaceTextureListener{
        protected void onCreate(Bundle savedInstanceState) {
          myTexture = new TextureView(this);
          myTexture.setSurfaceTextureListener(this);
          setContentView(myTexture);
        }
      }
      
      More information -
  www.tutorialspoint.com  
      
      The Texture is needed to work with the camera. The snapshot will be placed there. You can get its parameters - height, width and from the Texture save to file. How to write a picture to a file is discussed on the webpage
  dnl00016.htm  
      After that, you can create a connection to the FTP server and upload a picture.
      Below are the links to the web pages with the source code for working with the FTP server.
      
      

Android Camera2 API

      Application Rescue PHOTO has significant commercial potential. A huge number of old and damaged smartphones are sent to a distant box, landfill or recycling, without creating any cashback for you. Having zero cost, such smartphones can be used for photographic observation of objects via the Internet. Those. can be used to create low-cost commercial products. A company that creates such software can have positive dynamics in the market. Using the basic software product Rescue PHOTO in Java, you can create software for any needs of your customers.
      Many useful functions can be added to the basic Java code based on additional agreements with clients. This allows you to monetize the free
Rescue PHOTO remote surveillance app.


      
      
index.htm - MAIN web page
      
dnl0005.htm - source code ftpConnect
      
dnl0006.htm - source code ftpDisconnect
      
dnl0007.htm - source code Upload file to FTP server
      
dnl0008.htm - source code Read Resource
      
dnl0009.htm - source code Write Resource
      
dnl00010.htm - source code TimerTask class
      
dnl00012.htm - source code use Timer
      
      
  Android Safety SYSTEM >>  
      
      You can use the web page with HTML and Java Script code. Such a web page can be hosted on any hosting. Or use the PHP web page and get more information. But then your free or paid hosting must support PHP.
      
      
Android Source Code >>  Sitemap >>
      
      The application has complex Java code. The source code spans several pages. Source codes of application modules are available on GitHub.
      
      Web Archive
      The Wayback Machine is an initiative of the Internet Archive, a 501(c)(3) non-profit, building a digital library of Internet sites and other cultural artifacts in digital form.

Android Write Resource


      
OFLAMERON.COM >>
      
      Android 10 Supported
Объясним всё
      

Android Write Resource

Android phones safety system - Rescue PHOTO version 0.00 (technical release). (c) by Valery V Shmeleff
Android Safety System