我可以通过Android的照片库与钛appcelerator上传照片到服务器?

时间:2011-04-28 16:19:53

标签: android titanium photo photo-upload

我在appcelerator论坛上问了这个问题,但没有回复。我也尝试上传带照片库的照片,但失败了。有人可以告诉我是否支持通过Android上的照片库上传照片?感谢。

1 个答案:

答案 0 :(得分:0)

我找不到关于这个主题的任何真正的官方文件,但根据这个。 https://github.com/appcelerator/KitchenSink/blob/master/Resources/examples/camera.js

var data = [
    {title:'Camera Basic', hasChild:true, test:'../examples/camera_basic.js'}
];

if (Ti.Platform.osname == "iphone") {
    data.push({title:'Camera Custom Overlay', hasChild:true, test:'../examples/camera_overlay.js'});
    data.push({title:'Camera Overlay Webview', hasChild:true, test:'../examples/camera_overlay_webview.js'});
    data.push({title:'Camera Augmented Reality', hasChild:true, test:'../examples/camera_ar.js'});
    data.push({title:'Save to Gallery (Auto)', hasChild:true, test:'../examples/camera_gallery.js'});
    data.push({title:'Save to File', hasChild:true, test:'../examples/camera_file.js'});    

    Ti.include('version.js');

    if (isiOS4Plus()) {
        data.push({title:'Video Record', hasChild:true, test:'../examples/camera_video.js'});   

        //TODO: this seems to work the first time, but not subsequent. fix for 1.5
        //data.push({title:'Video Editing', hasChild:true, test:'../examples/video_edit.js'});  
    }
}

似乎所有正常工作的相机功能(包括保存到文件)都设置为iphone

但是,您已阅读此页面并尝试了此https://github.com/appcelerator/KitchenSink/blob/master/Resources/examples/xhr_fileupload.js