L LittleBritaly Member Licensed User Longtime User May 10, 2013 #1 I have one activity which starts a service which intercepts text messages. I would like the activity screen bringing to the foreground to display some information, in other words if the "program" is in the background, I would like it bringing into view without user intervention. I could use kiosk mode to override everything else, but would prefer it to sit in the background hidden and only if given the correct command by sms become visible.
I have one activity which starts a service which intercepts text messages. I would like the activity screen bringing to the foreground to display some information, in other words if the "program" is in the background, I would like it bringing into view without user intervention. I could use kiosk mode to override everything else, but would prefer it to sit in the background hidden and only if given the correct command by sms become visible.
Erel B4X founder Staff member Licensed User Longtime User May 10, 2013 #2 Calling StartActivity(..) from your service will show the activity. The more standard approach is to add a notification and let the user decide when to start your activity. Upvote 0
Calling StartActivity(..) from your service will show the activity. The more standard approach is to add a notification and let the user decide when to start your activity.
tdocs2 Well-Known Member Licensed User Longtime User Oct 17, 2014 #3 Erel said: Calling StartActivity(..) from your service will show the activity. The more standard approach is to add a notification and let the user decide when to start your activity. Click to expand... Greetings, all. Thank you in advance for answering my question. I know and have tested that StartActivity(..) from a service module will bring the activity to the foreground. What else could be done -how do I add a "notification" that requires a response from the user? The more standard approach is to add a notification... Click to expand... As usual, I am grateful for any and all help. Best regards. Sandy Upvote 0
Erel said: Calling StartActivity(..) from your service will show the activity. The more standard approach is to add a notification and let the user decide when to start your activity. Click to expand... Greetings, all. Thank you in advance for answering my question. I know and have tested that StartActivity(..) from a service module will bring the activity to the foreground. What else could be done -how do I add a "notification" that requires a response from the user? The more standard approach is to add a notification... Click to expand... As usual, I am grateful for any and all help. Best regards. Sandy
Erel B4X founder Staff member Licensed User Longtime User Oct 17, 2014 #4 You add a notification with the Notification object. The user can then click on the notification and the activity will be started. Upvote 0
You add a notification with the Notification object. The user can then click on the notification and the activity will be started.
tdocs2 Well-Known Member Licensed User Longtime User Oct 17, 2014 #5 Thank you, Erel. I initially searched for Notification Object and found the desolatesoul and bar-x advanced Notification Libraries. I could not find how to issue a B4A "core" or basic Notification... And how do I add a "notification" that requires a response from the user? Best regards. Sandy Last edited: Oct 17, 2014 Upvote 0
Thank you, Erel. I initially searched for Notification Object and found the desolatesoul and bar-x advanced Notification Libraries. I could not find how to issue a B4A "core" or basic Notification... And how do I add a "notification" that requires a response from the user? Best regards. Sandy
M Mahares Expert Licensed User Longtime User Oct 17, 2014 #6 I think you need something like this in the service module although my knowledge of services is shaky: Code: Copy Notification.SetInfo("My App", "Hello Florida", Main) Upvote 0
I think you need something like this in the service module although my knowledge of services is shaky: Code: Copy Notification.SetInfo("My App", "Hello Florida", Main)
tdocs2 Well-Known Member Licensed User Longtime User Oct 17, 2014 #7 Thank you, Mahares. This is the first time I use a Service. How do I declare Notification? Is it part of a library? I initially searched for Notification Object and found the desolatesoul and bar-x advanced Notification Libraries. I could not find how to issue a B4A "core" or basic Notification Click to expand... Best regards. Sandy Upvote 0
Thank you, Mahares. This is the first time I use a Service. How do I declare Notification? Is it part of a library? I initially searched for Notification Object and found the desolatesoul and bar-x advanced Notification Libraries. I could not find how to issue a B4A "core" or basic Notification Click to expand... Best regards. Sandy
M Mahares Expert Licensed User Longtime User Oct 17, 2014 #8 Notification is part of the core library. You do not need any additional libraries. Code: Copy Dim Notification1 As Notification 'In process global of the service Here is a link among many that has the tutorial: http://www.b4x.com/android/forum/threads/service-modules.7542/#content Upvote 0
Notification is part of the core library. You do not need any additional libraries. Code: Copy Dim Notification1 As Notification 'In process global of the service Here is a link among many that has the tutorial: http://www.b4x.com/android/forum/threads/service-modules.7542/#content
tdocs2 Well-Known Member Licensed User Longtime User Oct 18, 2014 #9 Thank you, Mahares. I do not know how I could have missed it. Best regards. Sandy Upvote 0
tdocs2 Well-Known Member Licensed User Longtime User Oct 18, 2014 #10 Hello, Mahares. It works from a Service Module: Code: Copy Dim Notification1 As Notification Notification1.Initialize Notification1.Icon="icon" Notification1.Insistent=True Notification1.SetInfo("Look and Look Again", "How could I miss it?", Main) Notification1.Notify(1) The Notification1.Insistent=True keeps beeping until user acks notification. Thanks again. Sandy Upvote 0
Hello, Mahares. It works from a Service Module: Code: Copy Dim Notification1 As Notification Notification1.Initialize Notification1.Icon="icon" Notification1.Insistent=True Notification1.SetInfo("Look and Look Again", "How could I miss it?", Main) Notification1.Notify(1) The Notification1.Insistent=True keeps beeping until user acks notification. Thanks again. Sandy