选择图片并上传android
问题是...
我正在尝试创建一个应用程序,允许您将图像或录音以及一些信息上传到数据库,上传部分不是问题,我想做的是3个选项,拍照、录音和选择文件。我决定先解决选择文件的问题...是否可以简单地单击一个按钮来选择一个文件,然后将其发布到我的 php 脚本中?以及有关如何启动相机或录音机的指示也将不胜感激,
谢谢
詹姆斯
Here is the problem...
I'm trying to create an app that allows you to upload an image or sound recording to a database along with some information, The upload part isn't a problem, what I would like to do is have 3 options, take a photo, record a sound and select a file. I decided to tackle select a file first... Is it possible to be able to simply click a button which allows you to select a file then post that to my php script? and pointers on how to start the camera or sound recorder would also be appreciated greatly
Thanks
James
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用带有 ListView 的对话框来选择文件。选择文件后,您可以查看本教程以将其上传到您的网络服务:
http://www.anddev.org/upload_files_to_web_server-t443-s30.html
您可以使用意图来启动相机:
您可以在
位置捕获: *更新*
以下 该对话框,您可以查看这些链接以获取有关其创建的更多信息:
是否可以在对话框内创建列表视图?
http ://androidforums.com/application-development/53924-how-add-listview-dialog.html
另外,您可能需要熟悉 ArrayAdapter 来管理 ListView。
http://www.softwarepassion.com/android-series -自定义列表视图项目和适配器/
You could use a Dialog with a ListView for selecting your file. Once you've selected the file, you could check out this tutorial for uploading it to your web service:
http://www.anddev.org/upload_files_to_web_server-t443-s30.html
You can use an intent to start the camera:
Which you can capture in:
* Update *
Regarding the dialog, you could check out these links for more information on it's creation:
is it possible to create listview inside dialog?
http://androidforums.com/application-development/53924-how-add-listview-dialog.html
Also you'll probably need to familiarize yourself with the ArrayAdapter for managing your ListView.
http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/