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

Draw multiple rectangles on button click on the same canvas in android
I'm struggling to find helpful, clear resources for OpenCV
android app invoking google map with car,public,walking controls
Clues about reason for dropping into Debug mode seem convoluted
Changing the color of over scroll in scrollview in android
Android: TabActivity deprecated using Fragment instead
how to customize audio recording quality in android?
MultiPoint Bluetooth Connection
easier way of doing both portrait and landscape in one xml file? in android
lock canvas fail when using MediaPlayer with Surfaceview
“Unfortunately (my app) has Stopped” error when trying to run my application
Convert String to Double excluding part of the string
populate a list in callback method of fragment
Azimuth in android
How to add elements to multidimensional arrayList
android bluetooth application unresponsive during phone call

Categories

HOME
cygwin
paraview
polymer
github-for-windows
angular-formly
mips
parameters
bookmarks
banner
flume
modal-dialog
rcloud
datastage
comsol
internationalization
intershop
chargify
boost-icl
solrcloud
database-connection
selinux
sar
jquery-ias
easeljs
resourcebundle
dynamically-generated
ckfinder
data.stackexchange.com
siri
opentk
fat
gp
nsurl
processwire
xajax
p4merge
doc
microsoft-metro
double-click
httrack
spring-integration-sftp
user-defined-fields
pair-programming
android-testing
pocketsphinx-android
smartfoxserver
ziparchive
lrs
resourcemanager
http-status-code-401
turbo-prolog
halcon
phpgrid
dynamics-nav-2016
doctype
sony-lifelog-api
cwrsync
typeconverter
j-security-check
ejb-2.x
packet-sniffers
viewer
primitive-types
pseudo-class
contrast
gii
dot42
decoupling
light
isqlquery
rolify
beaker-testing
actiondispatch
cascadingdropdown
twisted.web
booksleeve
pdfviewer
extreme-programming
vfs
extconf.rb
josql
failing-tests
isa-swizzling
cgimage
procedures
event-receiver
commerceserver2007
resharper-6.0
application-planning
wspbuilder

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App