android


Android SIP Service Persistence


I have a messaging and SIP app that needs to listen for received messages, incoming calls, etc. in the background, and then display or output them in various activities (depending on message type). My question is: what is the best way to accomplish the SIP part of this? AsyncTask, Service, IntentService, etc.?
So, when my app starts, I initially start a startup activity which shows a loading indicator, shows loading status to the user, takes care of some initial things (like checking in with our server application, setting sound level, etc.).
At that point, I'd like to then register as a SIP client with my SIP server, and sit there listening for incoming calls in the background, while other activities may run in the foreground (like a clock or WebView with a web page, etc.). If a SIP call comes in, I need the background SIP client to answer it and take over the screen from whatever activity may have been there.
Originally, I began with an AsyncTask for my SipListener class; but have two concerns: 1) I don't want to risk memory leaks, and 2) I couldn't get the SIP client to persist after successful registration with the SIP server (so, no incoming calls were being listened for, much less answered).
Next, I tried porting my SipListener class into a Service. But the problem was that I couldn't even register because SIP is a network service and I was getting Network-on-Main-Thread exceptions.
Now, I'm seeing this IntentService option, and wondering if that's the way to go?
I'm learning Android, so I know just enough to be dangerous, as they say! Can someone point me in the right direction?
You can implement Sip in service, not only listener, and start an activity or push a notification on incoming call (messages).
if you want to challenge yourself check out Linphone for android.
Try to build it, it will be great practice for you, use it and customize.
Also they have a Service, that can help you.
Good luck.

Related Links

Instagram API, login with two-factor authentication enabled
Android SurfaceView never becomes valid
Android studio, set checkbox value from checked to unchecked, in the other activity
How do i fix “Unable to obtain result of 'adb version' ”?
Create JS animation flashes when scrolling viewport on Android
Android SQLite database leaked error
Listen for Google Calendar resource changes without server
WebView crashing loading videos for Android 7.0
Espresso test not asserting when launching activity twice
How to store retrieved data in a Hashmap?
Cordova. How to reproduce killing application in background mode?
How pivotY and pivotX are calculated in android <rotate>
Can't save or select the values to/from SQLITE
Retrofit2 issue with posting array
Is there a way to only extract resources with apktool?
How to prevent color fiter change of one ImageView, when changing other?

Categories

HOME
uml
facebook-oauth
dns
twig
character-encoding
numbers
spring-data-redis
grafana
seo
static-site
permissions
limit
android-json
banner
frontend
crystal-lang
title
sendgrid-api-v3
plist
opengl-es-3.0
flatpak
symbol
esoteric-languages
gmm
topology
breadth-first-search
kendo-mobile
react-toolbox
mongoid6
aggregation
xcode-ui-testing
entity-relationship-model
underscore.js
handler
user-defined-functions
sqlpackage
wurfl
diacritics
xv6
claims
outputcache
tcc
placeholder
facebook-social-plugins
automapper-5
boxing
yii2-user
git-flow
ngmaterial
cup
shinobi
rsa-archer-grc
testrail
chromium-os
slackware
node-request
reporting-services-2012
flex4.6
i386
gcloud-ruby
thread-sleep
mobiledoc-kit
amiga
avahi
cwrsync
fail2ban
j-security-check
shopizer
xmltype
browserify-shim
universal-image-loader
personalization
functional-java
git-repo
getopt
syndicationfeed
eclipse-kepler
mbunit
cocoalibspotify-2.0
abstract-data-type
diem
windows-98
web-notifications
xcode3.2
cakephp-1.2
listitem
paginator
saxparseexception
matlab-load
non-clustered-index
linfu-dynamicproxy
contentpresenter
leader

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile