Using Android SDK in the background


#1

Hello ,

This is manikandan working in affectiva android SDK to capture the emotions of a human for a period of time. I have successfully implemented the SDK and its working fine.

Now my next goal is to run the SDK in background using background SERVICE or may be using ASYNC task. I do not know how to implement this situation.

My app should work like, It should run in the background and capture my emotions and i want to display the result on the display (layout), once it capture my emotions.

Please suggest.

Thanks ,
Manikandan Venkatesan.


#2

Hi, take a look at the ServiceFrameDetectorDemo in the Android SDK samples repo on Github, that should give you some ideas.


#3

Thanks a lot.
I also need to run this ServiceFrameDetectorDemo in such a way that, when i switch to other applications it should still capture my faces.
I s there anything you could help us in this


#4

Can I get emoji as response in ServiceFrameDetectorDemo?


#5

Sure. The demo app stops the service when the number of started Activities in the running app drops to 0, but your app doesn’t have to do that.


#6

Please see the SDK documentation at https://knowledge.affectiva.com/docs/analyze-a-video-frame-stream-2.

To get emoji results from the SDK, first enable emojis by calling frameDetector.setDetectAllEmojis(true); (prior to calling frameDetector.start()), and then process the returned emoji data in your onImageResults callback.


#7