如何在android中检索外部USB设备中存储的数据?
我正在android中做一个用于文本到语音转换的项目。我如何检索存储在外部存储设备中的语音文件?
我第一次尝试在图像上,这是我的代码...并且它不起作用..没有显示错误..但没有显示任何内容。这是我的代码
package com.org.sd;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ImageView;
public class SdcardActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView myImageView = (ImageView)findViewById(R.id.imageview);
Bitmap bitmap = BitmapFactory.decodeFile("/F/cameraman.bmp");
myImageView.setImageBitmap(bitmap);
}
}
I am doing a project in android for text to speech conversion.How can i retrieve speech files stored in an external storage device??
I first tried on an image and this is my code...And its not working..No error is shown..but nothing is displayed.This is my code
package com.org.sd;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ImageView;
public class SdcardActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView myImageView = (ImageView)findViewById(R.id.imageview);
Bitmap bitmap = BitmapFactory.decodeFile("/F/cameraman.bmp");
myImageView.setImageBitmap(bitmap);
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在以下链接中找到一些解决方案:
它具有通用格式,您仍然可以了解它...
链接是 这里
You can find some solution in following link:
It has general format still you can get some idea about it...
Link is here