| | |
| | | import android.net.wifi.WifiManager; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.os.SystemClock; |
| | | import android.text.format.Formatter; |
| | | import android.view.SurfaceHolder; |
| | | import android.view.SurfaceView; |
| | |
| | | } else { |
| | | useNative = true; |
| | | } |
| | | useNative = false; |
| | | if (useNative) { |
| | | System.loadLibrary("cvface_api"); |
| | | System.loadLibrary("opencv_java3"); |
| | |
| | | } |
| | | |
| | | public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {} |
| | | public void surfaceDestroyed(SurfaceHolder holder) {} |
| | | public void surfaceDestroyed(SurfaceHolder holder) { |
| | | System.out.println("surfaceDestroyed"); |
| | | } |
| | | }); |
| | | fragment_supervisory_exit_camera.getHolder().addCallback(new SurfaceHolder.Callback() { |
| | | public void surfaceCreated(SurfaceHolder holder) { |
| | |
| | | } |
| | | |
| | | public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {} |
| | | public void surfaceDestroyed(SurfaceHolder holder) {} |
| | | public void surfaceDestroyed(SurfaceHolder holder) { |
| | | System.out.println("surfaceDestroyed"); |
| | | } |
| | | }); |
| | | // new Thread(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | | // try { |
| | | // if (useNative) { |
| | | // MainActivity.getInstance().runOnUiThread(new Runnable() { |
| | | // public void run() { |
| | | // try { |
| | | //// File file2 = MainActivity.getInstance().getExternalFilesDir(null); |
| | | //// File[] files = file2.listFiles(); |
| | | //// for (File file : files) { |
| | | //// System.out.println(file.getAbsolutePath()); |
| | | //// } |
| | | //// String s1 = getStringFromFile("/sdcard/license.lic"); |
| | | //// String str = convertStreamToString(MainActivity.getInstance().getAssets().open("license.lic")); |
| | | //// RtspFaceNative.dbgSetStfaceLicense(str); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // |
| | | // } |
| | | // public String convertStreamToString(InputStream is) throws Exception { |
| | | // BufferedReader reader = new BufferedReader(new InputStreamReader(is)); |
| | | // StringBuilder sb = new StringBuilder(); |
| | | // String line = null; |
| | | // while ((line = reader.readLine()) != null) { |
| | | // sb.append(line).append("\n"); |
| | | // } |
| | | // reader.close(); |
| | | // return sb.toString(); |
| | | // } |
| | | // public String getStringFromFile (String filePath) throws Exception { |
| | | // File fl = new File(filePath); |
| | | // FileInputStream fin = new FileInputStream(fl); |
| | | // String ret = convertStreamToString(fin); |
| | | // //Make sure you close all streams. |
| | | // fin.close(); |
| | | // return ret; |
| | | // } |
| | | // }); |
| | | // |
| | | // } else { |
| | | // } |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // try { |
| | | // final SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss分"); |
| | | //// while (true) { |
| | | //// Thread.sleep(1000); |
| | | //// MainActivity.getInstance().runOnUiThread(new Runnable() { |
| | | //// @Override |
| | | //// public void run() { |
| | | //// fragment_surveillance_enter_timer.setText(sdf.format(new Date())); |
| | | //// fragment_surveillance_exit_timer.setText(sdf.format(new Date())); |
| | | //// } |
| | | //// }); |
| | | //// } |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // }).start(); |
| | | new SurveillanceMng.SurveillanceListThread().start(); |
| | | } |
| | | |