Texts/images of MMS data are well read on Samsung phones (Galaxy S3/S5), but video/address books do not have access (canRead)

Asked 2 years ago, Updated 2 years ago, 29 views

Text/image among MMS data is well read on Samsung phone (Galaxy S3/S5), but video/address book is a problem that says there is no canRead.

I have a question because there was a problem while coding to get MMS data.

Text/images are read well in the obtained path, but the video/address book does not have a canRead and eventually comes out as FileNoutound.

LG Phone (G2) reads videos/address books well.

Code

Uri uriPart = Uri.parse("content://mms/part");
Cursor cursorPart = contentResolver.query(uriPart, null, selectionPart, null, null);
                    if ("video/mp4".equals(type)) {
                        String videoPath = cursorPart.getString(cursorPart.getColumnIndex("_data"));
                    else if ("text/x-vCard".equals(type)) {
                        String vcfPath = cursorPart.getString(cursorPart.getColumnIndex("_data"));

Returned videoPath (for example): /data/data/com.android.providers.telephony/app_parts/PART_1491180844718_FILE000.mp4

I read the part table as above to get the path of the video/address book file.

But if you cross that path and play the video and read the contents of the address book, it works well on LG Phone (G2).

Samsung phone (Galaxy S3/S5) shows that there is no access to the file.

Googling, question - I've done it to the point of exhaustion.

I even made it appear in the <Basic Applications/Messages> list as shown in the picture below because I wanted to give you access to the file if you made it a default messaging app.

DefaultSMS Project, Default Message App (1)/[Android] http://blog.daum.net/andro_java/1135

Of course, I even chose the default app, but it still says I don't have access.

If you look at other messaging apps, you read them well even if you don't specify them as the default apps... It's frustrating.

Please help me if there is any way to solve this problem.

android

2022-09-22 16:52

1 Answers

I haven't done anything to get media from MMS, so I don't know if it will be helpful directly, but I think we should play the video using Content Uri, not the absolute path of the file. For example, it is true that it is impossible to play the contents of the app using the internal storage of the image/video of the app A.

Since all data provided through ContentProvider can be accessed through ContentUri, I think we should use this information only. Therefore, instead of obtaining the absolute path of the file from the code you uploaded, test it by using getContentResolver().openInputStream(uri).

Please refer to the following link for more detailed code.

Additionally, designating it as the default messaging app is to set which browser to run as the default browser, for example, if Chrome and Safari are installed on my desktop. Therefore, you are not granted additional privileges.


2022-09-22 16:52

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.