`
pixy
  • 浏览: 36080 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

PhoneGap0.9.5 for Android源码

阅读更多

 

下午想做一个拍照上传的android小程序,翻遍PhoneGap的文档也没找到怎样设置拍摄照片的文件名,保存目录.

 

看了一下phonegap的源码,发现了phonegap保存照片的路径,文件名是固定的........

 

public void takePicture(int quality, int returnType) {
		this.mQuality = quality;
		
		// Display camera
        Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
        
        // Specify file so that large image is captured and returned
        // TODO: What if there isn't any external storage?
        File photo = new File(Environment.getExternalStorageDirectory(),  "Pic.jpg");
        intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
        this.imageUri = Uri.fromFile(photo);

        this.ctx.startActivityForResult((Plugin) this, intent, (CAMERA+1)*16 + returnType+1);
	}

 

 

还有另一个问题,官方文档的例子有一句navigator.fileMgr.getRootPaths();获取文件路径,完全Copy文档的例子也一直报 undefined

 

 看来需要修改一下才能符合自己的需求.

这个要周末好好的把这份源码读一遍了

 

 

附上Phonegap源码

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics