将图像从摄像头上传到Parse服务器

时间:2016-01-02 11:24:41

标签: android parse-platform android-camera

我的布局中有 FloatingActionButton

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:onClick="capture"/>

我想在用户点击此按钮时将图像从相机上传到 Parse.com 服务器。

编辑

我找到了答案:

1 个答案:

答案 0 :(得分:2)

对于此解决方法,您需要一台在后台运行的摄像头。在相机上你的所有视图都会调整。当您单击FAB时,您从相机调用捕获,然后您将进行预览。

有许多自定义相机和捕捉图像的例子。

相机示例

  1. http://www.c-sharpcorner.com/UploadFile/9e8439/how-to-make-a-custom-camera-ion-android/
  2. http://capycoding.blogspot.in/2012/06/custom-camera-application.html
  3. http://www.coderzheaven.com/2011/12/28/how-to-create-a-custom-layout-for-your-camera-in-android/
  4. 现在将其上传到服务器上。

    注意:

    • 这可能会泄露你的记忆
    • 完成后需要关闭相机。否则你的内置摄像头会告诉用户没有找到相机。