Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to implement android.intent.action.VIEW completion action handler?
Forum Updated to NodeBB v4.3 + New Features

How to implement android.intent.action.VIEW completion action handler?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
android
3 Posts 4 Posters 4.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    EdOfTheMountain
    wrote on 8 Aug 2014, 18:49 last edited by A Former User
    #1

    How do I pass the file path to my application to handle viewing of the file?

    What I Have Done:

    I added an intent-filter to my Qt app and it seems to work.

    Selecting a *.TSL data file in the app File Manager HD now displays my application so that when I select Open As, Text it displays my app as an option to "Complete action using"

    My app is succesfully launched when I choose it to "Complete action using" and select "Just Once".

    Under desktop targets such as Linux, OSX, Windows, this works by passing the file to open as a command line argument. What is the Qt Android way?

    Can an android.intent.action.VIEW work with an already open application?

    File: AndroidManifest.xml
    @
    <?xml version="1.0"?>
    <manifest package="com.ditchwitch.tsr" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
    <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="@string/app_name" android:icon="@drawable/icon">
    <activity android:allowTaskReparenting="true" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="@string/app_name" android:screenOrientation="sensor" android:launchMode="singleTop">
    <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.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="http" />
                <data android:host="*" />
                <data android:pathPattern=".*\\\\.TSL" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="http" />
                <data android:host="*" />
                <data android:mimeType="application/TSL" />
            </intent-filter>
    
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="file" />
                <data android:host="*" />
                <data android:pathPattern=".*\\\\.TSL" android:mimeType="*/*" />
            </intent-filter>
    

    @

    Thanks in advance,

    -Ed

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Amir Afendin
      wrote on 17 Jun 2017, 12:57 last edited by
      #2

      2.2k views and not even one answer, wondering about the same thing right now

      1 Reply Last reply
      0
      • E Offline
        E Offline
        ekkescorner
        Qt Champions 2016
        wrote on 17 Jun 2017, 13:09 last edited by
        #3

        perhaps this blog helps ?
        http://blog.qt.io/blog/2016/06/30/intents-with-qt-for-android-part-1/

        and here's my wish list ;-)
        @eskil-abrahamsen-blomfeldt - waiting for part-2 ...

        @Jake-Petroules would be cool to get examples HowTo deal with iOS extensions
        http://blog.qt.io/blog/2016/06/30/intents-with-qt-for-android-part-1/#comment-1198052

        ekke ... Qt Champion 2016 | 2024 ... mobile business apps
        5.15 --> 6.8 https://t1p.de/ekkeChecklist
        QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved