Android Question Cleaning up my manifest file

MarcRB

Member
Licensed User
The manifest editor is a piece that I have never fully understood. (Sorry for that :) )
Actually, I just enter what is advised here in the forum in different situations.

How do I find out what I really need in the manifest editor?
Are there old of deprecated manifest lines?
Can there be conflicts between manifest lines?
And can it be cleaned in any way?

My app is a field engineer tabletapp in landscape mode.
I'm using technics for photo camera, sFTP, barcode/qr recognation, SPP serial bluetooth and PDF.

This is the manifest now:

B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="26" />
<supports-screens android:smallScreens="false"
                  android:normalScreens="false"
                  android:largeScreens="true"
                  android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" />
)
SetManifestAttribute("android:installLocation", "auto")
AddManifestText(<uses-feature android:name="android.hardware.telephony" android:required="false"/>)
AddManifestText(<uses-feature android:name="android.hardware.camera" android:required="false"/>)
AddManifestText(<uses-feature android:name="android.hardware.camera.front" android:required="false"/>)
AddPermission(android.permission.BLUETOOTH_ADMIN)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@android:style/Theme")
SetApplicationAttribute(android:largeHeap, "true")
SetActivityAttribute(actSpeedCheck, android:windowSoftInputMode, adjustPan|stateHidden)
AddApplicationText(<activity android:name="ice.zxing.CaptureActivity"
            android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:windowSoftInputMode="stateAlwaysHidden">
        </activity>)
AddApplicationText(
<provider android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <files-path name="name" path="shared" />
)
 

Erel

Administrator
Staff member
Licensed User
This line should be removed because you are adding the permission to all versions: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" />

This looks like a mistake: SetApplicationAttribute(android:theme, "@android:style/Theme")

In most cases you should use one of the following themes:
B4X:
CreateResourceFromFile(Macro, Themes.DarkTheme)
'or
CreateResourceFromFile(Macro, Themes.LightTheme)
 
Top