Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nextcloud doesn't know how to open .love files #2073

Closed
nikeinikei opened this issue Jan 30, 2018 · 7 comments · Fixed by #4434
Closed

nextcloud doesn't know how to open .love files #2073

nikeinikei opened this issue Jan 30, 2018 · 7 comments · Fixed by #4434

Comments

@nikeinikei
Copy link

Actual behaviour

nextcloud cannot open .love files

Expected behaviour

nextcloud should open .love files with the love2d engine
https://play.google.com/store/apps/details?id=org.love2d.android

Steps to reproduce

  1. put a .love game into nextcloud
  2. try to open it

Environment data

Android version:
7.1

Device model:
ZTE Axon 7

Nextcloud app version:
newest

@AndyScherzinger
Copy link
Member

AndyScherzinger commented Jan 30, 2018

@mario @tobiasKaminsky any opinions on this?
I checked the app's code: https://bitbucket.org/MartinFelis/love-android-sdl2/src/fd60978b7bb57134e232ea2d8f9c77ff7e6483ae/app/src/main/AndroidManifest.xml?at=master&fileviewer=file-view-default#AndroidManifest.xml-35

an we basically would need to have a mime type detection for .love file extension to map to application/x-love-game

@tobiasKaminsky
Copy link
Member

Isn't it possible to have a more generic way, e.g. if a mime type is not known, try to pass it to android app launcher and see it this can deal with it? If this is not working show something like "No app found to open .extension".
If we add every extension manually, this could get quite intensive, especially if these are rather unknown ones...

@AndyScherzinger
Copy link
Member

I think the mime type is the issue, since we don't know it yet we do pass it to the launcher which doesn't find any app supporting the file since it is mime type based. Thus we would actually have to detect the mime type. In this the love game app could also implement the document provider chooser so it would access the file from within the app itself instead of having to open the Nextcloud client.

@AndyScherzinger
Copy link
Member

I also discussed this with @jancborchardt here #2081 (comment) and I do agree (at least for these two issues) to add the mime type detection for these file extensions. As mentioned in the comments of Jan it should then also be added to the server, so looping in @MorrisJobke (hope I got the right person) 😃

@MorrisJobke
Copy link
Member

Just open a ticket in server ;)

@tobiasKaminsky
Copy link
Member

Instead of using completely our own mimetype list, we can use
https://developer.android.com/reference/android/webkit/MimeTypeMap.html#getMimeTypeFromExtension(java.lang.String)

which uses this database internally:
https://android.googlesource.com/platform/libcore/+/933e699897a15cc61e5641e6365f09f24e22b247/luni/src/main/java/libcore/net/MimeUtils.java

If so, then our "custom" mapping should get a lot smaller.
Downside is that every android release has another set of extensions, so one type can exist on 7, but not on 4...

@tobiasKaminsky
Copy link
Member

I searched a bit and https://developer.android.com/training/secure-file-sharing/share-file.html says that the preferred way is to use:
mResultIntent.setDataAndType(fileUri, getContentResolver().getType(fileUri));

But even with installed Löve app, this results in a default "unkown" mimetype.

I would have expect that if an app is registering itself as listener for any kind of new mimetype, that this then would be also know by content resolver.

@tobiasKaminsky tobiasKaminsky removed this from the Nextcloud App 3.1.0 milestone Mar 14, 2018
AndyScherzinger added a commit that referenced this issue Aug 28, 2019
AndyScherzinger added a commit that referenced this issue Sep 2, 2019
AndyScherzinger added a commit that referenced this issue Sep 2, 2019
AndyScherzinger added a commit that referenced this issue Sep 2, 2019
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.8.0 milestone Sep 3, 2019
backportbot-nextcloud bot pushed a commit that referenced this issue Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants