zoukankan      html  css  js  c++  java
  • 团队冲刺第二阶段09

    做好了拍照的功能,增加了上传录制摄的功能。

    部分代码:

    private void takePhoto () {
        // Checks for camera app available
        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        if (!IntentChecker.isAvailable(mainActivity, intent, new String[]{PackageManager.FEATURE_CAMERA})) {
          mainActivity.showMessage(R.string.feature_not_available_on_this_device, ONStyle.ALERT);
    
          return;
        }
        // Checks for created file validity
        File f = StorageHelper.createNewAttachmentFile(mainActivity, MIME_TYPE_IMAGE_EXT);
        if (f == null) {
          mainActivity.showMessage(R.string.error, ONStyle.ALERT);
          return;
        }
        attachmentUri = FileProviderHelper.getFileProvider(f);
        intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, attachmentUri);
        startActivityForResult(intent, TAKE_PHOTO);
      }
    private void takeVideo () {
    Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
    if (!IntentChecker.isAvailable(mainActivity, takeVideoIntent, new String[]{PackageManager.FEATURE_CAMERA})) {
    mainActivity.showMessage(R.string.feature_not_available_on_this_device, ONStyle.ALERT);

    return;
    }
     
  • 相关阅读:
    Select查询执行顺序
    javascript异步处理
    ASP.NET MVC WebAPI请求
    函数声明和函数表达式
    var声明的成员变量和函数内声明的变量区别
    网页大小自适应方案
    MVC Html.AntiForgeryToken() 防止CSRF攻击
    Jquery跨域请求
    螺旋模型
    快速原型模型
  • 原文地址:https://www.cnblogs.com/xjmm/p/13085456.html
Copyright © 2011-2022 走看看