Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Permanent local notification on Android


This question is not answered. Helpful answers available: 0. Correct answers available: 1.


Permlink Replies: 7 - Last Post: Oct 30, 2014 2:05 AM Last Post By: Smaniotto Andrea
Eitan Arbel

Posts: 508
Registered: 2/24/13
Permanent local notification on Android  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2014 5:24 AM
is there any way to make the notification system work when my app is not running?
i need a permanent notification, that will work let's say for the example, every day at 8pm.

if i understand it correctly, the a "Push Notification" is for working with a server/cloud, right?
then i don't need this. only a simple local Notification.

i "traveled" through these links, and still got to nowhere... :
* https://forums.embarcadero.com/thread.jspa?messageID=669752򣠸
* http://docwiki.embarcadero.com/RADStudio/XE6/en/Mobile_Tutorial:_Using_Notifications_%28iOS_and_Android%29
* https://translate.googleusercontent.com/translate_c?act=url&depth=1&hl=en&ie=UTF8&prev=_t&rurl=translate.google.com&sl=auto&tl=en&u=http://brsatalay.blogspot.com.tr/search/label/android%2520background%2520service&usg=ALkJrhgSVT9FvFGb0g7SzjQaesi9MsXQFA
and a few more...

i must say something:
i know Delphi since version 1, and worked with Turbo Pascal even before that, so i don't think i'm that big of a noob in this.
in the last few years i've been working on intraweb, and now i'm trying to make my first steps on FM (moved from XE2 to XE6), and some things in the FM framework just drive me crazy, and not to mention the TONS of bugs there are in it...

i won't ask here about my other (many...) problems i have in FM, but for this Notification thing :
why is it so hard to make...?
what's the point in a "notification" that only works while the app is running...???

i know nothing about developing services in Android, but it looks like this is what i need for permanent notifications.

i work with Delphi XE6 update 1(if it helps)

any help on making a permanent notification for Android will be VERY VERY appreciated
Thanks
Douglas Rudd

Posts: 314
Registered: 5/16/97
Re: Permanent local notification on Android
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2014 7:30 AM   in response to: Eitan Arbel in response to: Eitan Arbel
In the first place, in order for an android app to be able to do something when it is "not running", it has to be running as a background "service" and not as a regular app.

Apparently, it's not so easy to make a service:
http://www.fmxexpress.com/create-an-android-service-with-delphi-xe5-firemonkey/

After that, it should be easy enough for it to send a notification to the local user.
Eduardo Elias

Posts: 319
Registered: 9/20/12
Re: Permanent local notification on Android
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2014 9:02 AM   in response to: Douglas Rudd in response to: Douglas Rudd
I have not touch on Delphi service for Android, because looks difficult.

I made this with Java and of course, if you have the proper tools is not
difficult.

The Idea of service is because the phone needs to save battery.

If you have a process running constantly you kill the battery in less than
2 hours.

So when an application goes to background (does not have the focus anymore)
it when to the frozen state and can be killed at any time after that (yes,
lost focus is almost a dead app)

If you need to run in background it must be a service, and needs to be registered.
That service than can contact or launch your app if needed. Or save data
somewhere for your app.

If your app needs to be always running you need to tell that to your user.
Or it will be mad with you because the battery.

Otherwise you need to set a Timer (not delphi timer, ANDROID timer) to wake
up the service. Then you do some process and sleep back again. You service
can be running when the phone is awake, but when it goes to deep sleep it
will freeze the services also.

The only way is not let deep freezy and "adios" battery :)

So, it is good to think what you need, read about Android services and then
see how to do that in Delphi.

Eduardo

In the first place, in order for an android app to be able to do
something when it is "not running", it has to be running as a
background "service" and not as a regular app.

Apparently, it's not so easy to make a service:
http://www.fmxexpress.com/create-an-android-service-with-delphi-xe5-fi
remonkey/
After that, it should be easy enough for it to send a notification to
the local user.
László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Permanent local notification on Android  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2014 7:32 AM   in response to: Eitan Arbel in response to: Eitan Arbel
Eitan Arbel wrote:
is there any way to make the notification system work when my app is not running?
i need a permanent notification, that will work let's say for the example, every day at 8pm.

if i understand it correctly, the a "Push Notification" is for working with a server/cloud, right?
then i don't need this. only a simple local Notification.

i "traveled" through these links, and still got to nowhere... :
* https://forums.embarcadero.com/thread.jspa?messageID=669752򣠸
* http://docwiki.embarcadero.com/RADStudio/XE6/en/Mobile_Tutorial:_Using_Notifications_%28iOS_and_Android%29
* https://translate.googleusercontent.com/translate_c?act=url&depth=1&hl=en&ie=UTF8&prev=_t&rurl=translate.google.com&sl=auto&tl=en&u=http://brsatalay.blogspot.com.tr/search/label/android%2520background%2520service&usg=ALkJrhgSVT9FvFGb0g7SzjQaesi9MsXQFA
and a few more...

i must say something:
i know Delphi since version 1, and worked with Turbo Pascal even before that, so i don't think i'm that big of a noob in this.
in the last few years i've been working on intraweb, and now i'm trying to make my first steps on FM (moved from XE2 to XE6), and some things in the FM framework just drive me crazy, and not to mention the TONS of bugs there are in it...

i won't ask here about my other (many...) problems i have in FM, but for this Notification thing :
why is it so hard to make...?
what's the point in a "notification" that only works while the app is running...???

i know nothing about developing services in Android, but it looks like this is what i need for permanent notifications.

i work with Delphi XE6 update 1(if it helps)

any help on making a permanent notification for Android will be VERY VERY appreciated
Thanks

Just a thought ...
What if you "fire up" a local notificiation via a cycle for everyday at 8 pm.

Setnewnotification1 to 2014.10.10. 8 pm.
Setnewnotification2 to 2014.10.11. 8 pm.
Setnewnotification3 to 2014.10.12. 8 pm.
Setnewnotification4 to 2014.10.13. 8 pm.
and so on ...?
Eitan Arbel

Posts: 508
Registered: 2/24/13
Re: Permanent local notification on Android  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 20, 2014 5:00 PM   in response to: Eitan Arbel in response to: Eitan Arbel
Thank you for your replays and sorry for the long delay, i was hoping for a more Delphi-like answer...

building an Android service with Delphi/FM really does looks difficult.
especially if this is my first Android try in FM...

what if i "hook"/write a permanent notification to the Android's Calendar?
it wouldn't really be my notification, and i will need to add like 100's of the same "notification" to the Calendar, but could this work?

i wish it could be as easy as moving from an exe web-server to an ISAPI/dll service in intraweb, just by changing 3-4 lines of code...

my conclusion is that "Notification" in FM is really BS, unless (MAYBE) it works only with cloud.
so basically i need to be a java programmer, more then a Delphi one?
maybe i should learn java and move to Eclipse, i will probably have less bugs there then Delphi/FM...

Thanks
Eitan Arbel

Posts: 508
Registered: 2/24/13
Re: Permanent local notification on Android  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2014 9:29 AM   in response to: Eitan Arbel in response to: Eitan Arbel
anybody?
help...?
Unnamed Unnamed

Posts: 21
Registered: 10/5/14
Re: Permanent local notification on Android  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 29, 2014 1:27 PM   in response to: Eitan Arbel in response to: Eitan Arbel
Sadly but U are right. I'm and our company moving to java and leave Delphi (for mobile) forever. We lose too much time to make workarounds, get new bugs in next releases, wait months for hotfixes, report bugs which are never fixed.
Look at google for "Why FireMonkey is so fundamentally wrong in every aspect of it’s being" and U will understand it better. Before use FMX I was sure that any delphi haters made it, now I wake up and open my eyes. U can try Oxygene - it's a mixed pascal or if U want to build multiplatform app with one code look at xamarin. I saw few applications made in xamarin and they real native, not BS native what EMB says. Native is ELF execution format which is HUGE and cannot work alone (java bridge), so it's SLOW.
If U have time, move to other programming language, every delphi release getting worse and worse. U lose money and time only to fixing problems. As real good example is NOT FIXED (but reported) TEdit OnKeyDown, OnKeyUp problem on android. They had no time to fix it since XE5!!!

Pissed off, FMX user, soon past user...

b.r.
Smaniotto Andrea

Posts: 3
Registered: 11/29/14
Re: Permanent local notification on Android  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 30, 2014 2:05 AM   in response to: Eitan Arbel in response to: Eitan Arbel
Eitan I am trying to do the same for my App.
Waiting for a suggestion,
Thans

Eitan Arbel wrote:
is there any way to make the notification system work when my app is not running?
i need a permanent notification, that will work let's say for the example, every day at 8pm.

if i understand it correctly, the a "Push Notification" is for working with a server/cloud, right?
then i don't need this. only a simple local Notification.

i "traveled" through these links, and still got to nowhere... :
* https://forums.embarcadero.com/thread.jspa?messageID=669752򣠸
* http://docwiki.embarcadero.com/RADStudio/XE6/en/Mobile_Tutorial:_Using_Notifications_%28iOS_and_Android%29
* https://translate.googleusercontent.com/translate_c?act=url&depth=1&hl=en&ie=UTF8&prev=_t&rurl=translate.google.com&sl=auto&tl=en&u=http://brsatalay.blogspot.com.tr/search/label/android%2520background%2520service&usg=ALkJrhgSVT9FvFGb0g7SzjQaesi9MsXQFA
and a few more...

i must say something:
i know Delphi since version 1, and worked with Turbo Pascal even before that, so i don't think i'm that big of a noob in this.
in the last few years i've been working on intraweb, and now i'm trying to make my first steps on FM (moved from XE2 to XE6), and some things in the FM framework just drive me crazy, and not to mention the TONS of bugs there are in it...

i won't ask here about my other (many...) problems i have in FM, but for this Notification thing :
why is it so hard to make...?
what's the point in a "notification" that only works while the app is running...???

i know nothing about developing services in Android, but it looks like this is what i need for permanent notifications.

i work with Delphi XE6 update 1(if it helps)

any help on making a permanent notification for Android will be VERY VERY appreciated
Thanks
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02