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. Qt Quick Android : How to integrate an Accessibility Service
Forum Updated to NodeBB v4.3 + New Features

Qt Quick Android : How to integrate an Accessibility Service

Scheduled Pinned Locked Moved Solved Mobile and Embedded
qtquickandroid
2 Posts 1 Posters 1.2k Views
  • 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.
  • J Offline
    J Offline
    Julien Chevet
    wrote on 29 Mar 2016, 07:36 last edited by Julien Chevet
    #1

    I'm working on an Android application which runs an accessibility service. I have developed the service java class and configuration xml files in Android Studio to test it as native app. When I run it, the accessibility service appears in the Android Accessibility Settings as expected and I can enable it.

    However I would like to integrate this service in a Qt Quick Android application. When I do this by adding the same java class, Manifest and configuration xml files, the project compiles and runs well but the service doesn't appear in Android Settings.

    Here are my configuration files:

    Manifest.xml:

    <activity>
    ...
    </activity>
    <service android:name="com.myCompany.app.MyService"
             android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
            <intent-filter>
                <action android:name="android.accessibilityservice.AccessibilityService"/>
            </intent-filter>
            <meta-data android:name="android.accessibilityservice"/>
            <meta-data android:resource="@xml/accessibilityservice"/>
    </service>
    

    accessiblityservice.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <accessibility-service
    xmlns:tools="http://schemas.android.com/tools"
    android:accessibilityEventTypes="typeWindowStateChanged"
    android:accessibilityFeedbackType="feedbackGeneric"
    android:accessibilityFlags="flagIncludeNotImportantViews"
    xmlns:android="http://schemas.android.com/apk/res/android"
    tools:ignore="UnusedAttribute"/>
    

    Can some one tell me where I'm wrong ?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Julien Chevet
      wrote on 29 Mar 2016, 09:48 last edited by
      #2

      I found the mistake by myself. In the manifest.xml the meta-data tag should be on a single line, like below:

      <activity>
      ...
      </activity>
      <service android:name="com.myCompany.app.MyService"
               android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
              <intent-filter>
                  <action android:name="android.accessibilityservice.AccessibilityService"/>
              </intent-filter>
              <meta-data android:name="android.accessibilityservice"
                         android:resource="@xml/accessibilityservice"/>
      </service>
      
      1 Reply Last reply
      0

      1/2

      29 Mar 2016, 07:36

      • Login

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