Click here to Skip to main content
15,898,035 members
Home / Discussions / Android
   

Android

 
GeneralRe: How can we display the pop up message in android Pin
pankaj78818-Feb-15 7:33
pankaj78818-Feb-15 7:33 
GeneralRe: How can we display the pop up message in android Pin
Richard MacCutchan18-Feb-15 7:42
mveRichard MacCutchan18-Feb-15 7:42 
QuestionRe: How can we display the pop up message in android Pin
David Crow19-Feb-15 5:07
David Crow19-Feb-15 5:07 
QuestionAndroid sharedPreferences not working on spinner Pin
pankaj78817-Feb-15 4:24
pankaj78817-Feb-15 4:24 
AnswerRe: Android sharedPreferences not working on spinner Pin
David Crow17-Feb-15 6:02
David Crow17-Feb-15 6:02 
QuestionRe: Android sharedPreferences not working on spinner Pin
pankaj78818-Feb-15 6:01
pankaj78818-Feb-15 6:01 
QuestionRe: Android sharedPreferences not working on spinner Pin
David Crow18-Feb-15 8:04
David Crow18-Feb-15 8:04 
QuestionAndroid Activity Service communication: which one is the best approach? Pin
angelo.mastropietro13-Feb-15 4:50
angelo.mastropietro13-Feb-15 4:50 

I have seen multiple solutions to let a Service / Activity communicate each other. However I can't understand in which context we should use them and why.
From what I've read around (android documentation and stackoverflow), these are the main approaches:




  1. Bind to the service using bindService()
  2. Use a messenger (it should be for IPC, but somebody uses it for same process communication)
  3. Static instance (singleton) of the Service. This method could bring errors, what happens if the service dies? Null reference of that service. Shouldn't be better the first approach then this one?
  4. Use LocalBroadcastManager and register the Activity for receiving. Basically, the Activity listen to the broadcasts sent by the Service. Viceversa, the Service in its onStartCommand dispatch intent actions sent from the Activity (explicit intent with custom action). For dispatching actions in the service, another solution could be intent filters on the service and implicit intents (android documentation says NO in the notes, even if I declare custom actions). How many chances are that someone else uses the same custom actions as mine?
  5. Otto API


Now I'm really confused. Could somebody explain (if possible with examples) why and in which context we should use those approaches?
Are there other solutions other than the ones in this list?
Thank you.



modified 13-Feb-15 10:51am.

QuestionSending email via Intent Pin
Member 822518012-Feb-15 10:25
Member 822518012-Feb-15 10:25 
AnswerRe: Sending email via Intent Pin
Richard MacCutchan12-Feb-15 22:53
mveRichard MacCutchan12-Feb-15 22:53 
QuestionRe: Sending email via Intent Pin
David Crow13-Feb-15 5:41
David Crow13-Feb-15 5:41 
AnswerRe: Sending email via Intent Pin
Member 822518013-Feb-15 7:12
Member 822518013-Feb-15 7:12 
SuggestionRe: Sending email via Intent Pin
David Crow13-Feb-15 8:07
David Crow13-Feb-15 8:07 
GeneralRe: Sending email via Intent Pin
Member 822518013-Feb-15 10:26
Member 822518013-Feb-15 10:26 
QuestionChinese Gifts for provide solution of challenge QR-code scanning requirement Pin
Member 114409179-Feb-15 21:51
Member 114409179-Feb-15 21:51 
QuestionHelp with app Pin
jjamesx27-Feb-15 12:11
jjamesx27-Feb-15 12:11 
QuestionRe: Help with app Pin
David Crow12-Feb-15 7:41
David Crow12-Feb-15 7:41 
Questionprobleme l'hors d'installation des packages android SDK manager Pin
Member 114299235-Feb-15 7:20
Member 114299235-Feb-15 7:20 
SuggestionRe: probleme l'hors d'installation des packages android SDK manager Pin
Richard MacCutchan5-Feb-15 22:05
mveRichard MacCutchan5-Feb-15 22:05 
Questiondisplay image from remote sqlserver db in Android Pin
Member 5933975-Feb-15 0:58
Member 5933975-Feb-15 0:58 
AnswerRe: display image from remote sqlserver db in Android Pin
Richard MacCutchan5-Feb-15 2:46
mveRichard MacCutchan5-Feb-15 2:46 
SuggestionRe: display image from remote sqlserver db in Android Pin
David Crow5-Feb-15 4:04
David Crow5-Feb-15 4:04 
Questionmobile commerce android Pin
Member 114251573-Feb-15 16:39
Member 114251573-Feb-15 16:39 
AnswerRe: mobile commerce android Pin
Richard MacCutchan3-Feb-15 23:02
mveRichard MacCutchan3-Feb-15 23:02 
QuestionSmall App Help Pin
Asimmmm24-Jan-15 5:10
Asimmmm24-Jan-15 5:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.