简体   繁体   English

在android中以编程方式检查文件是否损坏的最佳方法是什么?

[英]What is the best way to check programatically if a file is corrupted or not in android?

What is the best way to check programmatically if a file is corrupted or not in android, in particular when dealing with an image video or audio file ?在android中以编程方式检查文件是否损坏的最佳方法是什么,特别是在处理图像视频或音频文件时?

I would like to be able to spot those corrupted file that on some devices (Samsung) keep the media service busy as it is probably trying indexing them, and as a consequence drain the battery我希望能够在某些设备(三星)上发现那些损坏的文件,这些文件使媒体服务忙碌,因为它可能正在尝试对它们进行索引,从而耗尽电池

TIA TIA

Android Supported Media Formats read the document Android Supported Media Formats阅读文档

For crashing problem please put your code in a try...catch block like below,对于崩溃问题,请将您的代码放在try...catch block中,如下所示,

try
{
      // Code to play the media file.
}
catch ( Exception e )
{
      // Display a Toast message, "File format doesn't support"
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 检查Android应用程序是否位于前台的最佳方法是什么? - What the best way to check if an Android application is in foreground? 在Android中以编程方式创建位图动画的最佳方法 - Best way to animate programatically created bitmaps in android 以任何方式以编程方式检查android平台的版本 - Any way programatically to check the version of android platform 在android中连续检查互联网连接的最佳方法是什么 - what is the best way to check Internet connection continuously in android Xamarin Forms (Android) 中检查 mobile inte.net 是否打开的最佳方法是什么? - What is the best way in Xamarin Forms (Android) to check if mobile internet is turned on? 检查 String 是否包含 Java/Android 中的 URL 的最佳方法是什么? - What's the best way to check if a String contains a URL in Java/Android? 在Android中获取音频文件持续时间的最佳方法是什么? - What is the best way to get an audio file duration in Android? 在Android应用程序中存储文件的最佳方法是什么? - What is the best way to store a file within an Android app? 如何在sdcard中检查视频文件是否已损坏或在android中没有? - How Can i check the video file in sdcard is corrupted or not in android? 检查 Android 应用程序是否在 Windows11 的 android 的 windows 子系统上运行的最佳方法是什么? - What is the best way to check that an Android app is running on windows subsystem for android of windows11?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM