Android Question Receive JSON from www server in service - in the foreground

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear friends,

I am succesfully receiving JSON from web.
I have service for this functionality.

I am trying to do that task in the foreground.

I am trying to set for service this atributes:

B4X:
Sub Service_Create
  Service.AutomaticForegroundModeService.AUTOMATIC_FOREGROUND_NEVER
  lock.ReleasePartialLock
End sub

Sub Service_Start (StartingIntent As Intent)
  Service.StartForeground(nid, CreateNotification("...")) '
End Sub

- Its right way how to do my JSON task in the foreground?
- What I must put to manifest, please?
SetServiceAttribute(mywwwservice, android:foregroundServiceType, "dataSync")
I think here is not choice for my function (for manifest)... : [camera=64, connectedDevice=16, dataSync=1, location=8, mediaPlayback=2, mediaProjection=32, microphone=128, phoneCall=4].

EDIT: I found that it was not smart question. The task I described is standard function. Now I know it. Thank you and sorry for my question.

Best regards,
p4ppc
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…