B4A Library Notification Builder Library.

Jones Hone

Active Member
Licensed User
Longtime User
I download demo apk(NBDemo.apk) and try ".DefaultVibrate =False", is ok.
But, my app set ".DefaultVibrate =False" , It still vibrate.
Is there a problem?
My code is as follows:
B4X:
      cnf.Initialize
  cnf.SmallIcon ="icon"
  cnf.Ticker ="My Message"
  cnf.DefaultLight =True
  cnf.DefaultVibrate =False
  cnf.DefaultSound =False
  cnf.ContentTitle ="ttile"
  cnf.ContentText ="Text"
  cnf.ContentInfo ="info"
  cnf.SubText ="subtext"
  cnf.Notify(1)
 

barx

Well-Known Member
Licensed User
Longtime User
I am current away with no pc so cannot look into the issue until after tuesday, sorry. Hope you manage to sort it out before then.
 

Jones Hone

Active Member
Licensed User
Longtime User
After so many days of testing, I still can not solve this problem.
Can you give me the source code of NBDemo.apk?
Thank you very much.
 

barx

Well-Known Member
Licensed User
Longtime User
sure, there is nothing special about it. Maybe a little hard to follow though due to all the extra stuff for code outputting.

What version of the lib are you using?
 

Attachments

  • NBDemo.zip
    50 KB · Views: 401

Jones Hone

Active Member
Licensed User
Longtime User
I use Nitification Builder V2.31, b4a V3.80
Thank you for giving me the source code.
Wait me try.
 

barx

Well-Known Member
Licensed User
Longtime User
try compiling the above project and install on device, see if the issue is still present. Maybe I broke something in 2.31
 

barx

Well-Known Member
Licensed User
Longtime User
You could try your project using v2.3 see if that makes a difference.
 

Jones Hone

Active Member
Licensed User
Longtime User
The problem has been resolved.
That's my problem: In my project there is a activity use the Notification of the system,so this problem occur. When I delete the activity, Now is ok!

Disturbing you. I am sorry!
 

barx

Well-Known Member
Licensed User
Longtime User
No worries, glad you got sorted
 

FabioG

Active Member
Licensed User
Longtime User
Hello,

the library has always worked but with the latest update of b4a does not work anymore
I have not changed anything in the code
I just updated B4A

there are problems?
 

barx

Well-Known Member
Licensed User
Longtime User
Not that I am aware of. I have the latest B4A installed and all seems ok. Could you give more detail? Do you get any errors?
Have you updated the Android SDK, try updating your version of the support v4 library.
 

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,
I just installed the demo APK from the first post onto my phone and when notifications come up on my phone they are also coming up on my Android Wear device (LG G Watch). So Cool!

I even made it come up with actions and the actions also work and it notifys my phone of the action that was pressed on my wear device.
I was waiting for version 3 to support wear devices and thought I would give this ago in the mean time, and found it working.

Is there going to be anything new in version 3 that is going to make the notifications better on wear devices ?
Are you able to make the notifications only come up on wear devices and not phones and only come up on phones and not wear devices ?
 
Last edited:

FabioG

Active Member
Licensed User
Longtime User
Not that I am aware of. I have the latest B4A installed and all seems ok. Could you give more detail? Do you get any errors?
Have you updated the Android SDK, try updating your version of the support v4 library.

everything worked fine
I updated B4A and now no longer works
I did downgrade B4A and still does not work

no error
I do not know what to do

EDIT:

SOLVED
I accidentally deleted the file icon notification

thanks anyway for the help
 
Last edited:

barx

Well-Known Member
Licensed User
Longtime User

Basically, yes, all the functionality I have shown so far is what works with the existing library version. Including Styles (if you haven't tried them yet). The stuff I need to add is Wear specific. I need to tweak the Action system as you can specify an Action to be Wear only. Then there is voice input and additional 'Pages'.

I don't recall reading anything so far about notifications being on Wear only. I don't think this will be available as the Wear device is intended to be an extension of your devices notification system.
 

barx

Well-Known Member
Licensed User
Longtime User
everything worked fine
I updated B4A and now no longer works
I did downgrade B4A and still does not work

no error
I do not know what to do

EDIT:

SOLVED
I accidentally deleted the file icon notification

thanks anyway for the help

If it still does not work then it is not an issue with the b4a version. Try re-downloading the library and as mentioned above check sdk
 

fishwolf

Well-Known Member
Licensed User
Longtime User
Good Library

but Sorry

what the correct setting for use a custom sound of app ?

where i must put the sound file into app folders ?

i have try this code and copy sound files into all folders.

Thanks

B4X:
Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

   Dim nb As NotificationBuilder
   Dim nbBigTextStyle As NotificationBigTextStyle
End Sub

Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   'Activity.LoadLayout("Layout1")
   
   nb.Initialize
  nb.SmallIcon = "icon"
   nb.Ticker = "Ticker"
   nb.ContentTitle = "Title"
   nb.ContentText = "Text"
   nb.ContentInfo = "Info"
   nb.SubText = "SubText"
   nb.OnGoingEvent = True
   nb.AddAction("icon","Wait","Tag",Me)
   nb.DefaultSound = False
   nb.CustomSound = "notification.ogg" or "notification.mp3"
   nbBigTextStyle.Initialize
   nbBigTextStyle.BigText = "BigText"
   nbBigTextStyle.BigContentTitle = "Title"
   nbBigTextStyle.SummaryText = "Summary"
   
   nb.SetStyle(nbBigTextStyle)
   nb.Notify(1)

End Sub
 

barx

Well-Known Member
Licensed User
Longtime User

You need to provide the full file uri. Check the documentation that pops up as you type the command.
 

barx

Well-Known Member
Licensed User
Longtime User
I wasn't aware that the ChitChat section of the forum can be so easily missed (doesn't show in searches). So incase anybody else missed out on this thread here is a link
It's just on about the update for this library I'm working on. Maybe interesting to some...
 

fishwolf

Well-Known Member
Licensed User
Longtime User
Good Library

but Sorry

what the correct setting for use a custom sound of app ?

where i must put the sound file into app folders ?

i have try this code and copy sound files into all folders.

Thanks

B4X:
Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

   Dim nb As NotificationBuilder
   Dim nbBigTextStyle As NotificationBigTextStyle
End Sub

Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   'Activity.LoadLayout("Layout1")
   
   nb.Initialize
  nb.SmallIcon = "icon"
   nb.Ticker = "Ticker"
   nb.ContentTitle = "Title"
   nb.ContentText = "Text"
   nb.ContentInfo = "Info"
   nb.SubText = "SubText"
   nb.OnGoingEvent = True
   nb.AddAction("icon","Wait","Tag",Me)
   nb.DefaultSound = False
   nb.CustomSound = "notification.ogg" or "notification.mp3"
   nbBigTextStyle.Initialize
   nbBigTextStyle.BigText = "BigText"
   nbBigTextStyle.BigContentTitle = "Title"
   nbBigTextStyle.SummaryText = "Summary"
   
   nb.SetStyle(nbBigTextStyle)
   nb.Notify(1)

End Sub
You need to provide the full file uri. Check the documentation that pops up as you type the command.

Sorry,

i have read the documentation and try many solutions, but doesn't work

if i have a my sound into "Files" folder of the project, what is the correct format ?

"file://sound.mp3"
"file://Files/sound.mp3"
"file:Files/sound.mp3"
doesn't work
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…