如何将avd中sd卡中的图像存储到android中的数据库中?
我是安卓新手。我刚刚在 Android 2.1 中创建了一个带有 256 MB android-SDcard 的 AVD。我已经在其中插入了两张图像。我使用 DDMS 视角完成了此操作。图像现在存储在SD卡的DCIM文件夹中的文件夹100ANDRO中。现在我想创建一个应用程序,允许用户通过浏览文件夹来选择图像,并需要将相应的图像保存到数据库android-sqlite中。
有人可以帮我找到合适的方法吗?提前致谢。
I am new to Android. I have just created an AVD with 256 MB android-SDcard in it in Android 2.1. And I have inserted two images into it. I have done this using the DDMS perspective. And the images are now stored into a folder 100ANDRO in the DCIM folder of SDcard. Now I want to create an application that allows the user to select the images through browsing the folders and need to save the corresponding image to the database android-sqlite.
Can someone help me to find an appropriate method for this? Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了一种方法。
我创建了一个上传按钮,并在单击操作上设置了这样的按钮。
我已经重写了这个方法以及下面相同的类。
这里image_value代表xml文件中的隐藏文本视图。
我已将图像位置和字节的值作为文本视图的值和标记传递。
后来我将这些字节保存到数据库中以供以后显示。它工作正常。
感谢大家。
I have found one method for this.
I have created a button for UPLOAD and on the click action I have set like this.
And I have overrided this method along with the same class as below.
Here image_value represents a hidden text view in the xml file.
I have passed the value of the image location and bytes as text view's value and tag.
And later on I have saved this bytes into the database for later display. Its working fine.
Thanks to all.