xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 4KB
    文件類型: .java
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-11
  • 語言: Java
  • 標簽: Android??后臺錄像??

資源簡介

Android 后臺Service 實現錄像,無頁面

資源截圖

代碼片段和文件信息

package?com.uiot.smarthome.server;/**


import?android.app.Notification;
import?android.app.Service;
import?android.content.Context;
import?android.content.Intent;
import?android.graphics.PixelFormat;
import?android.hardware.Camera;
import?android.media.CamcorderProfile;
import?android.media.MediaRecorder;
import?android.os.Environment;
import?android.os.IBinder;
import?android.support.annotation.Nullable;
import?android.text.format.DateFormat;
import?android.view.Gravity;
import?android.view.SurfaceHolder;
import?android.view.SurfaceView;
import?android.view.WindowManager;

import?java.util.Date;

/**
?*?@描述?(測試程序可實現后臺錄像)

?*?@date?2016/8/15?0015?8:28?
?*/
public?class?BackgroundVideoRecorder?extends?Service?implements?SurfaceHolder.Callback?{

????private?WindowManager?windowManager;
????private?SurfaceView?surfaceView;
????private?Camera?camera?=?null;
????private?MediaRecorder?mediaRecorder?=?null;

????@Override
????public?void?onCreate()?{

????????//?Start?foreground?service?to?avoid?unexpected?kill
????????Notification?notification?=?new?Notification.Builder(this)
????????????????.setContenttitle(“Background?Video?Recorder“)
????????????????.setContentText(““)
????????????????.setSmallIcon(R.drawable.button_selector)
????????????????.build();
????????startForeground(1234?notification);

????????//?Create?new?SurfaceView?set?its?size?to?1x1?move?it?to?the?top?left?corner?and?set?this?service?as?a?callback
????????windowManager?=?(WindowManager)?this.getSystemService(Context.WINDOW_SERVICE);
????????surfaceView?=?new?SurfaceView(this);
????????WindowManager.LayoutParams?layoutParams?=?new?WindowManager.LayoutParams(
????????????????1?1
????????????????WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY
????????????????WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
????????????????PixelFormat.TRANSLUCENT
????????);

//全屏顯示在最上圖層上
//????????final?WindowManager.LayoutParams?layoutParams?=?new?WindowManager.LayoutParams(
//????????????????WindowManager.LayoutParams.WRAP_CONTENT
//????????????????WindowManager.LayoutParams.W

評論

共有 條評論