T Tata Mapassa Active Member Licensed User Longtime User May 26, 2018 #1 Hello, How does one use a service with startAt?
F FrankBerra Active Member Licensed User Longtime User May 26, 2018 #2 With: StartServiceAt or StartServiceAtExact Upvote 0
T Tata Mapassa Active Member Licensed User Longtime User May 26, 2018 #3 how to use the service startAt service to display a message at a specific time? if datetime.time = "08:00" then msgbox ("message", "title") end thank you Upvote 0
how to use the service startAt service to display a message at a specific time? if datetime.time = "08:00" then msgbox ("message", "title") end thank you
MarkusR Well-Known Member Licensed User Longtime User May 26, 2018 #4 https://www.b4x.com/android/forum/threads/startserviceat-headaches.33646/#content Upvote 0
Erel B4X founder Staff member Licensed User Longtime User May 27, 2018 #5 You cannot show a Msgbox from a service. Upvote 0
MarkusR Well-Known Member Licensed User Longtime User May 27, 2018 #6 you can open a activity with StartActivity or CallSubDelayed and show something there. or for a short message ToastMessageShow. Upvote 0
you can open a activity with StartActivity or CallSubDelayed and show something there. or for a short message ToastMessageShow.
T Tata Mapassa Active Member Licensed User Longtime User May 27, 2018 #7 Thank you for your return. How to display a toastmessageshow message with the StartActivity or CallSubDelayed service Upvote 0
Thank you for your return. How to display a toastmessageshow message with the StartActivity or CallSubDelayed service
MarkusR Well-Known Member Licensed User Longtime User May 27, 2018 #8 instead of a message you can jump into a activity with StartActivity or CallSubDelayed Code: Copy Sub Activity_Create(FirstTime As Boolean) Log("Activity_Create") Dim p As Period p.Seconds = 10 Dim time As Long = DateUtils.AddPeriod(DateTime.Now,P) Log(time) StartServiceAtExact(TestStartService,time,True) Log("..") Code: Copy Sub Service_Start (StartingIntent As Intent) Service.StopAutomaticForeground 'Call this when the background task completes (if there is one) ToastMessageShow("HELLO",True) End Sub Upvote 0
instead of a message you can jump into a activity with StartActivity or CallSubDelayed Code: Copy Sub Activity_Create(FirstTime As Boolean) Log("Activity_Create") Dim p As Period p.Seconds = 10 Dim time As Long = DateUtils.AddPeriod(DateTime.Now,P) Log(time) StartServiceAtExact(TestStartService,time,True) Log("..") Code: Copy Sub Service_Start (StartingIntent As Intent) Service.StopAutomaticForeground 'Call this when the background task completes (if there is one) ToastMessageShow("HELLO",True) End Sub
T Tata Mapassa Active Member Licensed User Longtime User May 27, 2018 #9 I have the following error messages: -variable not declared "service" it is used before having assigned a value to it. -variable not declared "teststartservice" it is used before having assigned a value to it. thank you Upvote 0
I have the following error messages: -variable not declared "service" it is used before having assigned a value to it. -variable not declared "teststartservice" it is used before having assigned a value to it. thank you
MarkusR Well-Known Member Licensed User Longtime User May 27, 2018 #10 i made a service TestStartService, there you find Service_Start event, see project/add new module/service module and i started it from a activity in Activity_Create for testing Upvote 0
i made a service TestStartService, there you find Service_Start event, see project/add new module/service module and i started it from a activity in Activity_Create for testing
T Tata Mapassa Active Member Licensed User Longtime User May 27, 2018 #11 merci, c'est Ok. Mais comment faire pour que si datetime = "08:00" le toastmessageshow soit affiché ? Upvote 0
merci, c'est Ok. Mais comment faire pour que si datetime = "08:00" le toastmessageshow soit affiché ?
T Tata Mapassa Active Member Licensed User Longtime User May 27, 2018 #12 Sorry, thanks, that's OK. But how to make sure if datetime.now = "08:00" the toastmessageshow is displayed? Upvote 0
Sorry, thanks, that's OK. But how to make sure if datetime.now = "08:00" the toastmessageshow is displayed?
MarkusR Well-Known Member Licensed User Longtime User May 27, 2018 #13 me thought u started the service "at" 8 o clock so why u will check that again? Upvote 0
T Tata Mapassa Active Member Licensed User Longtime User May 27, 2018 #14 in your example "Dim p As Period p.Seconds = 10 Dim time As Long = DateUtils.AddPeriod (DateTime.Now, P) " I do not see the part about the time "08:00" Upvote 0
in your example "Dim p As Period p.Seconds = 10 Dim time As Long = DateUtils.AddPeriod (DateTime.Now, P) " I do not see the part about the time "08:00"
MarkusR Well-Known Member Licensed User Longtime User May 27, 2018 #15 that was explained at post #4 in the link Upvote 0