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

问题描述 投票:0回答:1

我的布局中有一个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服务器。

编辑:

我找到了答案:

android parse-platform android-camera
1个回答
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/

现在将其上传到服务器上。

注意:

  • 这会泄漏你的记忆
  • 你完成后需要关闭相机。否则你的内置摄像头会告诉用户没有找到相机。
© www.soinside.com 2019 - 2024. All rights reserved.