| View previous topic :: View next topic |
| Author |
Message |
franc Senior Member

Joined: 27 Oct 2005 Posts: 202
|
Posted: Fri Mar 23, 2012 2:45 am Post subject: |
|
|
Ja, auch hier wurde dann wohl mal wieder das host Attribut vergessen:
| Code: | <intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="content" />
<data android:scheme="file" />
<data android:host="*" />
<data android:pathPattern=".*\\.txt" />
<data android:pathPattern=".*\\.log" />
<data android:pathPattern=".*\\.ppt" />
<data android:pathPattern=".*\\.pot" />
<data android:pathPattern=".*\\.pps" />
<data android:pathPattern=".*\\.dps" />
<data android:pathPattern=".*\\.dpt" />
<data android:pathPattern=".*\\.pptx" />
<data android:pathPattern=".*\\.potx" />
<data android:pathPattern=".*\\.ppsx" />
<data android:pathPattern=".*\\.doc" />
<data android:pathPattern=".*\\.dot" />
<data android:pathPattern=".*\\.wps" />
<data android:pathPattern=".*\\.wpt" />
<data android:pathPattern=".*\\.docx" />
<data android:pathPattern=".*\\.dotx" />
<data android:pathPattern=".*\\.xls" />
<data android:pathPattern=".*\\.xlt" />
<data android:pathPattern=".*\\.et" />
<data android:pathPattern=".*\\.ett" />
<data android:pathPattern=".*\\.xlsx" />
<data android:pathPattern=".*\\.xltx" />
<data android:pathPattern=".*\\.csv" />
<data android:pathPattern=".*\\.pdf" />
</intent-filter> |
|
|
| Back to top |
|
 |
franc Senior Member

Joined: 27 Oct 2005 Posts: 202
|
Posted: Fri Mar 23, 2012 3:28 am Post subject: |
|
|
@ghisler:
Und es ist doch nicht eindeutig. Die App "Locus Pro", die keine Dateiverknüpfungen unbekannter Dateien vornimmt, hat folgenden <intent-filter>:
| Code: | <intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="application/gpx" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:pathPattern=".*\\.gpx" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="text/xml" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:pathPattern=".*\\.gpx" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="text/plain" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:pathPattern=".*\\.gpx" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="application/kml" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:pathPattern=".*\\.kml" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="application/vnd.google-earth.kml+xml" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:pathPattern=".*\\.kml" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="text/xml" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:pathPattern=".*\\.kml" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="text/plain" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:pathPattern=".*\\.kml" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="application/kmz" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:pathPattern=".*\\.kmz" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="application/vnd.google-earth.kmz" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:pathPattern=".*\\.kmz" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="application/zip" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:pathPattern=".*\\.zip" />
</intent-filter> |
Wenn man den so anschaut, dürfte das nach ihrer Erklärung dazu führen, dass alle Dateien mit der App verknüpft werden, weil in den data-elementen bei jeder Verwendung von pathPattern kein host dabei steht.
Tun sie aber nicht.
Und auch der Adobe Reader, der in Version 10.1.1 nicht mehr alle Dateien öffnen will, hat gar kein host-Attribut:
| Code: | <intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" android:pathPattern=".*\\.pdf" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/pdf" />
</intent-filter> |
Ich frage daher nochmal:
Wo genau fehlt denn nun in den genannten intent-filter / data Elementen das sagenhafte host-Attribut und warum brauchen es Locus Pro und Adobe Reader nicht und funktionieren dennoch?
Dass das fehlende host-Attribut im data-Element zur Verknüpfung mit allen Dateitypen führt ist ja eine Interpretation und steht so nicht dort. |
|
| Back to top |
|
 |
ghisler(Author) Site Admin


Joined: 04 Feb 2003 Posts: 24702 Location: Switzerland
|
Posted: Fri Mar 23, 2012 5:32 am Post subject: |
|
|
Doch, ist es - die obigen Filter würden auch auf alle Dateiendungen zutreffen, aber sie enthalten zusätzlich das Feld android:mimeType. Dieses schränkt die Verknüpfung auf den MIME-Typ ein, deshalb gibt es kein Problem. _________________ Author of Total Commander
http://www.ghisler.com |
|
| Back to top |
|
 |
franc Senior Member

Joined: 27 Oct 2005 Posts: 202
|
Posted: Sun Mar 25, 2012 12:38 am Post subject: |
|
|
@ghisler: Nun hat der gutmütige Entwickler von Moon+ Reader tatsächlich die von mir vorgeschlagene (und von ihnen abgesegnete) Änderung des intent-filter übernommen (Post am Do März 22, 2012 8:59 am) und damit eine Testversion kompiliert, die er mir geschickt hat und der "Verknüpfungsfehler" besteht nach wie vor.
So ist jetzt in der AndroidManifest.xml zu lesen:
| Code: | <intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
<data android:mimeType="image/*" />
<data android:mimeType="application/epub+zip" />
<data android:mimeType="application/octet-stream" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="*" />
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.epub" />
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.fb2" />
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.txt" />
</intent-filter> |
Nun ist in jedem Data Element mit path Attribut ein Host Attribut, aber immer noch will jede Datei mit dem moon Reader geöffnet werden.
Was also nun?
Gibt es denn keine Vorlagen wie man das nun tatsächlich richtig macht?
Es kann doch nicht sein dass diese Frage von allen Entwicklern durch Stochern im Trüben "gelöst" wird aber keiner die GENAUE Lösung kennt.
@ghisler: was ist denn ihres Erachtens nun hier noch GENAU falsch?
Wie musste es denn ihrer Meinung nach RICHTIG heißen? |
|
| Back to top |
|
 |
ghisler(Author) Site Admin


Joined: 04 Feb 2003 Posts: 24702 Location: Switzerland
|
Posted: Mon Mar 26, 2012 6:29 am Post subject: |
|
|
Doch, genau so müsste es aussehen - sind das wirklich alle Intent-Filter?
Allerdings spielt das überhaupt keine Rolle mehr, weil ich in der aktuellen Version RC5 die Verknüpfung nach Dateiendungen komplett abgeschaltet habe - es wird nun nur noch nach MIME-Typen (android:mimeType) gesucht, wie das die meisten anderen Dateimanager machen. Bitte mal die RC5 probieren! _________________ Author of Total Commander
http://www.ghisler.com |
|
| Back to top |
|
 |
franc Senior Member

Joined: 27 Oct 2005 Posts: 202
|
Posted: Mon Mar 26, 2012 8:29 am Post subject: |
|
|
| ghisler(Author) wrote: | | Doch, genau so müsste es aussehen - sind das wirklich alle Intent-Filter?... |
Aber ich habe doch die komplette AndroidManifest.xml wie sie im Einsatz ist, in meinem Post vom Montag 19. März 2012 um 9:17 bereits gezeigt!
Aber da es ja nun wohl seitens des Total Commanders mit der rc5 geändert wurde ist es nun müßig herauszufinden, ob letztlich der MoonReader oder der Total Commander den Bug hatte.
Ich installiere also jetzt die rc5 und vergesse das Thema...
...bis ich selbst mal eine App baue
... Tatsächlich, mit rc5 keine sonderbaren Verknüpfungen mehr zum Moonreader usw. |
|
| Back to top |
|
 |
ghisler(Author) Site Admin


Joined: 04 Feb 2003 Posts: 24702 Location: Switzerland
|
Posted: Wed Mar 28, 2012 4:39 am Post subject: |
|
|
| Quote: | | Aber ich habe doch die komplette AndroidManifest.xml wie sie im Einsatz ist, in meinem Post vom Montag 19. März 2012 um 9:17 bereits gezeigt! |
Ja, aber nicht die korrigierte... _________________ Author of Total Commander
http://www.ghisler.com |
|
| Back to top |
|
 |
franc Senior Member

Joined: 27 Oct 2005 Posts: 202
|
Posted: Wed Mar 28, 2012 4:59 am Post subject: |
|
|
| ghisler(Author) wrote: | | Ja, aber nicht die korrigierte... |
Moment.
Sie fragen: "sind das wirklich alle Intent-Filter?" ich antworte, dass ich die übrigen Intent-Filter in meinem Post vom 22.03.2012 in der zitierten AndroidManifest.xml schon gepostet hatte.
Reden wir aneinander vorbei?
Natürlich habe ich damals nicht die "korrigierte" Version gepostet, sondern diejenige, die der Entwickler im Einsatz hatte.
Diejenigen Intent-Filter, die die AndroidManifest.xml zusätzlich noch enthält, kann man ja leicht ablesen.
Dennoch hier nochmal alle intent-filter zur Ansicht, mit diesen ist das Problem noch präsent (in tc-rc4):
| Code: | ...
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
<data android:mimeType="image/*" />
<data android:mimeType="application/epub+zip" />
<data android:mimeType="application/octet-stream" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="*" />
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.epub" />
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.fb2" />
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.txt" />
</intent-filter>
...
<intent-filter>
<action android:name="com.flyersoft.moonreaderp.open_broadcast" />
</intent-filter>
...
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
...
<intent-filter>
<data android:scheme="db-x652cgcle79aei8" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
... |
PS.: übrigens habe ich mal die alte Adobe Reader AndroidManifest.xml ausgegraben, bei der ich damals dieses Problem zuerst entdeckt hatte (Ausgangsthread). In der aktuellen AR Version (mit tc rc4) ist es ja nicht mehr.
Verblüffend: die beiden Dateien sind fast identisch, und völlig gleich, was die Intent-Filter anbetrifft.
Es hat wohl mindestens hier nichts damit zu tun gehabt und wohl eher mit rc3->rc4 |
|
| Back to top |
|
 |
|