I have an older, Android only app that I am updating a couple of features on.
I have two services that are primarily used for SMB (a secondary update is replacing smb1 with smb2 / ncifs-ng).
This is a dedicated tablet app. I am not really concerned about any other app or a phone or music player interrupting it.
The service only runs in the foreground (as I understand it). The user waits for the data to load.
From what I have read I added.
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
To each of the services.
I added
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
To the manifest.
When I try to compile I get the following error:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Here is the full manifest in case I have this in the wrong place:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Thanks for any help.
Similar code seems to run just fine in an activity. I did the services because there were a lot of common routines that I did not want to repeat in every activity that used them.
It would be huge time sink right now to move this to B4X Pages. All I really need at this point is to update a couple of SQL queries. I just thought I would go ahead and get the SMB update out of the way at the same time.
But I digress.
I should also mention that I am disabling strict mode so that I can run smb on the main thread. It has never been an issue.
Can someone tell me how to make google happy so I can update my customers?
Thanks.
			
			I have two services that are primarily used for SMB (a secondary update is replacing smb1 with smb2 / ncifs-ng).
This is a dedicated tablet app. I am not really concerned about any other app or a phone or music player interrupting it.
The service only runs in the foreground (as I understand it). The user waits for the data to load.
From what I have read I added.
			
				B4X:
			
		
		
		Private Sub Service_Timeout
    Service.StopAutomaticForeground
End Sub
	I added
			
				B4X:
			
		
		
		SetServiceAttribute(SMBsm, android:foregroundServiceType, shortService)
SetServiceAttribute(SKUtils, android:foregroundServiceType, shortService)
	When I try to compile I get the following error:
			
				B4X:
			
		
		
		Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.23s)
Linking resources    Error
AndroidManifest.xml:73: error: 'shortService' is incompatible with attribute foregroundServiceType (attr) flags [camera=64, connectedDevice=16, dataSync=1, location=8, mediaPlayback=2, mediaProjection=32, microphone=128, phoneCall=4].
AndroidManifest.xml:90: error: 'shortService' is incompatible with attribute foregroundServiceType (attr) flags [camera=64, connectedDevice=16, dataSync=1, location=8, mediaPlayback=2, mediaProjection=32, microphone=128, phoneCall=4].
error: failed processing manifest.
	
			
				B4X:
			
		
		
		'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
'5/13/18 - Changed target API to 26 from 19
'5/13/18 - added READ_EXTERNAL_STORAGE
AddManifestText(
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.PERMISSION_RECORD_AUDIO" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>
<meta-data
    android:name="com.google.android.gms.vision.DEPENDENCIES"
    android:value="barcode" /> 
android:windowSoftInputMode="stateHidden|adjustPan"
    )
SetServiceAttribute(SMBsm, android:foregroundServiceType, shortService)
SetServiceAttribute(SKUtils, android:foregroundServiceType, shortService)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetActivityAttribute(SaveFile, android:windowSoftInputMode, adjustPan|stateHidden)
SetActivityAttribute(Documents, android:windowSoftInputMode, adjustPan|stateHidden)
'End of default text.
AddApplicationText(<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />)
	Thanks for any help.
Similar code seems to run just fine in an activity. I did the services because there were a lot of common routines that I did not want to repeat in every activity that used them.
It would be huge time sink right now to move this to B4X Pages. All I really need at this point is to update a couple of SQL queries. I just thought I would go ahead and get the SMB update out of the way at the same time.
But I digress.
I should also mention that I am disabling strict mode so that I can run smb on the main thread. It has never been an issue.
Can someone tell me how to make google happy so I can update my customers?
Thanks.
			
				Last edited: