B4A Library Notification Builder Library.

barx

Well-Known Member
Licensed User
Longtime User
hmmm, no idea then I'm afraid. Only other thing I could suggest would be to make sure your using latest support-v4 lib but I have no idea if it will make any difference.
 

dieterp

Active Member
Licensed User
Longtime User
I've managed to get it working by updating the android-support-v4.jar and android-support-v13.jar files. I needed to copy both of these files into the Libraries folder, not just the android-support-v4.jar file. Strangely enough I tried this before without success. Not too sure why it worked now?

Anyway, hope this helps anyone resolve the same issue that I was having!
 

dieterp

Active Member
Licensed User
Longtime User
With regards to the CustomSound functionality,when I directly copy a 'notification.ogg' file to the 'Notifications' folder on my device, it works fine when I use the code Notification2.CustomSound = "file:///sdcard/notifications/notification.ogg"

However, when I copy the 'notification.ogg' file to the File.DirDefaultExternal folder, I cannot seem to play it from that folder. I've tried several paths (using file:///) but i just can't seem to get it to play. Will it not work from the File.DirDefaultExternal folder? I've seen a few similar posts on this forum but there doesn't seem to be a defined answer. Has anybody managed to get this to work?
 

Mrjoey

Active Member
Licensed User
Longtime User
hey mr.barx , i got crash from a user who has : Galaxy Centura , Android 4.0.3 - 4.0.4 :
B4X:
java.lang.NoSuchFieldError: android.app.Notification.bigContentView
at barxdroid.NotificationBuilder.NotificationBuilder.PrepareNotification(NotificationBuilder.java:576)
at barxdroid.NotificationBuilder.NotificationBuilder.Notify(NotificationBuilder.java:525)
at com.auxmp.jk.bs._service_create(bs.java:1887)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
at com.auxmp.jk.bs.onCreate(bs.java:45)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2257)
at android.app.ActivityThread.access$1600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4429)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:3151)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:2918)
at dalvik.system.NativeStart.main(Native Method)

what it is related to? and if there anyway to solve this crash? thank you.
 

Mrjoey

Active Member
Licensed User
Longtime User

oops , im sorry , its related to the Api level wish has to be 16+ for big content view , and here is obviously below 16.sorry again
 

dieterp

Active Member
Licensed User
Longtime User
Is there anyone who has perhaps figured out how to open a 'notification.ogg' file from the File.DirDefaultExternal folder? I am using the CustomSound functionality but I can't seem to open it from there? If I copy the file to a location like "file:///sdcard/notifications/notification.ogg" then the CustomSound will work, but not from File.DirDefaultExternal. Anyone have any suggestions on how to do this?
 

fbritop

Active Member
Licensed User
Longtime User
Barx,
I'm trying to run the sample code, but it throws me an exception:

java.lang.RuntimeException: Method: AddAction not found in: barxdroid.NotificationBuilder.NotificationBuilder

Just after I execute addAction

AdditionalLibs folder contains android-support-v4.jar, NotificationBuilder.jar/xml
Android SDK is version 19
Android Support Library is version 21.0.3

What could be wrong?

Thanks
FBP
 

barx

Well-Known Member
Licensed User
Longtime User
What version of Notification Builder library are you using?
 

Chris Williams

Member
Licensed User
Longtime User
Hello, barx, I have created an app which makes use of your library. I would like to know what I need to do prior to my submitting it to Google Play to give you proper credit for your work. I have included a credits page in the app...
 

barx

Well-Known Member
Licensed User
Longtime User
Hello, barx, I have created an app which makes use of your library. I would like to know what I need to do prior to my submitting it to Google Play to give you proper credit for your work. I have included a credits page in the app...

Hi @Chris Williams, there are no requirements for giving credit within your app but thank you for asking.

Just use the Lib and good luck with your app success
 

Dave61

Member
Licensed User
Longtime User
I tried adding your library to a project of mine. The general notifications worked fine but I couldn't get the InboxStyle to work.
Does the InboxStyle require Lollipop to work?

I have 3 tablet/phones here all running Android 4.4.2 and all of them just show the standard notification even from your demo app.

The 3rd phone has never been connected to B4A, just had the demo downloaded from the Play Store and Style set to 'InboxStyle' but just shows:
Some Title 10:26
Some Text
Some Sub Text Bit Of Info
 

barx

Well-Known Member
Licensed User
Longtime User
The styles have been available since jellybeans (4.3). If it is not showing then chances are it is not the top notification. Usually, only the top one is displayed expanded. Try expanding the notification (like zoom out on an image)
 

Dave61

Member
Licensed User
Longtime User
Ah, you are correct - all my 3 devices had another notification that was higher up in the notification list. Blocking notifications from those other apps fixed that except on the tablet where it insists on notifying me that I have no sim card installed with no way to delete the message. I guess there isn't a way to push my app notifications higher so I will have to find a sim card to stop it annoying me.
Thanks for the great library!
 

CryoGenID

Active Member
Licensed User
Longtime User
Hello everybody,

I am currently trying (unfortunately without success) to simply get a notification (first step only text, next step a picture) to a (simulated) Android Wear device.

Could anybody please give me a (really basic) headstart? I have read all the threads regarding this module and the "WearableDataLayer" but I am currently
stuck on how to only get these two types of notifications to the wear device.
In the first step I wouldn't want/need a special app on the wear device, just those notifications ;-)

Any help (e.g. a really simple demo program) to get off the ground would be _really_ appreciated

Thanks a lot and best regards,

Chris
 

barx

Well-Known Member
Licensed User
Longtime User

You don't need the WearableDataLayer Library to get notifications on the Wear device. All you need is this library. For simple notifications you don't need to do anything extra other than issue the notification as standard.

If you install the demo app and activate a notification you should also see it on your Wear device along with the code to do .
 

CryoGenID

Active Member
Licensed User
Longtime User
Hello Barx,

thanks so much for your answer
I did as told and installed your demo app and voila I could see the code.
So I copy&pasted it into an empty app:
B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
   
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Private Button1 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Main1")

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub



Sub Button1_Click
    Dim nb As NotificationBuilder
    Dim nbPage2 As NotificationBuilder
    Dim wearableExtender As NotificationWearableExtender
    nb.Initialize
    nbPage2.Initialize
    wearableExtender.Initialize
   
    nb.SmallIcon = "icon"
    nb.Ticker = "New Demo"
    nb.Tag = "some Tag"
    nb.setActivity(Me)
    nb.DefaultLight = True
    nb.DefaultVibrate = True
    nb.DefaultSound = True
    nb.ContentTitle = "Some Title"
    nb.ContentText = "Some Text"
    nb.ContentInfo = "Bit of Info"
    nb.SubText = "Some Sub Text"
    nbPage2.SmallIcon = "icon"
    nbPage2.ContentTitle = "Page 2"
    nbPage2.ContentText = "Body 2"
    wearableExtender.AddPage(nbPage2)
    nb.Extend(wearableExtender)
    nb.Notify(1)
   
End Sub

I corrected a few things from the code your app gave me:
- Typo: Dim nbPage2 As NotifictaionBuilder
- Missing quotation marks: nbpage2.ContentText = Body 2
- Wrong variable: WearableExtender.AddPage(nb2)

I hope I corrected those correctly in my demo code above and didn't just THINK that they were wrong ;-)

But the problem is:
I get the notification on the tablet perfectly fine, but NOT on the Android Wear simulator :-(
When I send a notification/demo card from the Android Wear app on the tablet to the simulator, it is displayed fine there...
My tablet is a Google Nexus 7 with Android 5.0.2 ...

Could you please again help me?

Thanks a lot and best regards,

Chris
 

barx

Well-Known Member
Licensed User
Longtime User


Hi Chris,

Your code adjustments look right to me (i guess I need to go through it all again and check for typos lol)

I had a similar issue on my n7 tablet and it turned out that the notifications for Wear are turned off by default for tablets. I can't remember exactly how to enable it, but I'm almost sure it is in the Wear app on the tablet.

I will look on my tablet later when I get home if you have no luck.
 

CryoGenID

Active Member
Licensed User
Longtime User
Hello BarX,

thank you so much for the hint ;-)
As soon as I read your reply I remembered that I had read a thread here where you already told somebody else to look for that setting...
But at that time I was by no way so far to make up my mind about that problem *g*
Not it seems to work perfectly fine
Text is already on the simulated watch, now I need to play around to change the Icon, send a (fullscreen?) picture etc.
But hopefully playing around and testing out stuff will bring me there ;-)

Again: THANK YOU (for your help AND your wunderful library!)

Best regards,

Chris
 

barx

Well-Known Member
Licensed User
Longtime User
check out BigPictureStyle, see if that is what you require
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…