<?xml version="1.0"?>
<manifest package="ch.opengis.@APP_PACKAGE_NAME@" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="@APP_VERSION_STR@" android:versionCode="@APK_VERSION_CODE@" android:installLocation="auto">
  <application
    android:hardwareAccelerated="true"
    android:name="org.qtproject.qt5.android.bindings.QtApplication"
    android:label="@string/app_name"
    android:icon="@drawable/qfield_logo"
    android:usesCleartextTraffic="true"
    android:requestLegacyExternalStorage="true" >
    <activity
      android:name="ch.opengis.@APP_PACKAGE_NAME@.QFieldActivity"
      android:icon="@drawable/qfield_logo"
      android:label="@string/app_name"
      android:launchMode="singleTop"
      android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation">
      <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" />
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="file" />
        <data android:scheme="content" />
        <data android:host="*" />
        <data android:mimeType="*/*" />
        <data android:pathPattern=".*\\.qgs" />
        <data android:pathPattern=".*\\..*\\.qgs" />
        <data android:pathPattern=".*\\..*\\..*\\.qgs" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.qgs" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.qgs" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.qgs" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.qgs" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.qgs" />
        <data android:pathPattern=".*\\.qgz" />
        <data android:pathPattern=".*\\..*\\.qgz" />
        <data android:pathPattern=".*\\..*\\..*\\.qgz" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.qgz" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.qgz" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.qgz" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.qgz" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.qgz" />
        <data android:pathPattern=".*\\.gpkg" />
        <data android:pathPattern=".*\\..*\\.gpkg" />
        <data android:pathPattern=".*\\..*\\..*\\.gpkg" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.gpkg" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.gpkg" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.gpkg" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.gpkg" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.gpkg" />
        <data android:pathPattern=".*\\.shp" />
        <data android:pathPattern=".*\\..*\\.shp" />
        <data android:pathPattern=".*\\..*\\..*\\.shp" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.shp" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.shp" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.shp" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.shp" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.shp" />
        <data android:pathPattern=".*\\.kml" />
        <data android:pathPattern=".*\\..*\\.kml" />
        <data android:pathPattern=".*\\..*\\..*\\.kml" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.kml" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.kml" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.kml" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.kml" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.kml" />
        <data android:pathPattern=".*\\.kmz" />
        <data android:pathPattern=".*\\..*\\.kmz" />
        <data android:pathPattern=".*\\..*\\..*\\.kmz" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.kmz" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.kmz" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.kmz" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.kmz" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.kmz" />
        <data android:pathPattern=".*\\.geojson" />
        <data android:pathPattern=".*\\..*\\.geojson" />
        <data android:pathPattern=".*\\..*\\..*\\.geojson" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.geojson" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.geojson" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.geojson" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.geojson" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.geojson" />
        <data android:pathPattern=".*\\.json" />
        <data android:pathPattern=".*\\..*\\.json" />
        <data android:pathPattern=".*\\..*\\..*\\.json" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.json" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.json" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.json" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.json" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.json" />
        <data android:pathPattern=".*\\.pdf" />
        <data android:pathPattern=".*\\..*\\.pdf" />
        <data android:pathPattern=".*\\..*\\..*\\.pdf" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.pdf" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.pdf" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.pdf" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.pdf" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.pdf" />
        <data android:pathPattern=".*\\.tif" />
        <data android:pathPattern=".*\\..*\\.tif" />
        <data android:pathPattern=".*\\..*\\..*\\.tif" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.tif" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.tif" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.tif" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.tif" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.tif" />
        <data android:pathPattern=".*\\.jp2" />
        <data android:pathPattern=".*\\..*\\.jp2" />
        <data android:pathPattern=".*\\..*\\..*\\.jp2" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.jp2" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.jp2" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.jp2" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.jp2" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.jp2" />
        <data android:pathPattern=".*\\.gpx" />
        <data android:pathPattern=".*\\..*\\.gpx" />
        <data android:pathPattern=".*\\..*\\..*\\.gpx" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.gpx" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.gpx" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.gpx" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.gpx" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.gpx" />
        <data android:pathPattern=".*\\.zip" />
        <data android:pathPattern=".*\\..*\\.zip" />
        <data android:pathPattern=".*\\..*\\..*\\.zip" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\.zip" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.zip" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.zip" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.zip" />
        <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\..*\\.zip" />
      </intent-filter>

      <!-- Git Revision -->
      <meta-data android:name="android.app.git_rev" android:value="@string/git_rev"/>
      <!-- Git Revision -->

      <meta-data android:name="android.app.lib_name" android:value="@string/lib_name"/>
      <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
      <meta-data android:name="android.app.repository" android:value="default"/>
      <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
      <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
      <!-- Deploy Qt libs as part of package -->
      <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
      <!-- Run with local libs -->
      <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
      <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
      <meta-data android:name="android.app.load_local_libs_resource_id" android:resource="@array/load_local_libs"/>
      <meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
      <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
      <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
      <!--  Messages maps -->
      <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
      <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
      <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
      <!--  Messages maps -->

      <!-- Splash screen -->
      <meta-data android:name="android.app.splash_screen" android:resource="@layout/splash"/>
      <!-- Splash screen -->

      <!-- Background running -->
      <!-- Warning: changing this value to true may cause unexpected crashes if the
                    application still try to draw after
                    "applicationStateChanged(Qt::ApplicationSuspended)"
                    signal is sent! -->
      <meta-data android:name="android.app.background_running" android:value="false"/>
      <!-- Background running -->
    </activity>

    <!-- Activity to choose a .qgs file to open -->
    <activity android:name="ch.opengis.@APP_PACKAGE_NAME@.QFieldProjectActivity" />

    <!-- Activity "Rate this app" -->
    <activity android:name="ch.opengis.@APP_PACKAGE_NAME@.QFieldAppRaterActivity" />

    <!-- Activity to get picture with the native camera -->
    <activity android:name="ch.opengis.@APP_PACKAGE_NAME@.QFieldCameraPictureActivity" android:configChanges="orientation|screenSize|screenLayout|keyboardHidden" />

    <!-- Activity to get picture from the gallery -->
    <activity android:name="ch.opengis.@APP_PACKAGE_NAME@.QFieldGalleryPictureActivity" android:configChanges="orientation|screenSize|screenLayout|keyboardHidden" />

    <!-- Activity to open file externally -->
    <activity android:name="ch.opengis.@APP_PACKAGE_NAME@.QFieldOpenExternallyActivity" />

    <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="ch.opengis.@APP_PACKAGE_NAME@.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/file_paths">
        </meta-data>
    </provider>

  </application>
  <uses-sdk android:minSdkVersion="@ANDROID_PLATFORM@" android:targetSdkVersion="@ANDROID_TARGET_PLATFORM@" />
  <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>

  <!-- The permissions are specified manually. This way we do not request the microphone permissions which would be pulled in
       as dependent permissions because of qt multimedia. -->
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  <uses-permission android:name="android.permission.CAMERA" />
  <uses-permission android:name="android.permission.WAKE_LOCK" />
  <uses-permission android:name="android.permission.BLUETOOTH" />
  <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

  <uses-feature android:required="false" android:name="android.hardware.camera" />
  <uses-feature android:required="false" android:name="android.hardware.camera.autofocus" />
  <uses-feature android:required="false" android:name="android.hardware.location.gps" />
  <uses-feature android:required="false" android:name="android.hardware.microphone" />
  <uses-feature android:required="false" android:name="android.hardware.bluetooth" />
</manifest>
