B4A Library Notification Builder Library.

Inman

Well-Known Member
Licensed User
Longtime User

Hi, any update on this issue?
 

barx

Well-Known Member
Licensed User
Longtime User
Completely slipped my mind Inman, sorry buddy. Will get onto it...

I don't believe the ParentActivity issue ever got sorted either did it? lol, brain been a little fried just of late.
 

barx

Well-Known Member
Licensed User
Longtime User
Should all be fixed Inman. Check original post for updated lib (v2.10)
 

Kevin

Well-Known Member
Licensed User
Longtime User
I started using this instead of the advanced notifications in my app. Works great! I did however just get an email from a customer who stated that my app force closes all the time now since the update. On a hunch, I had him completely disable notifications in my app ( has that option) and he said it fixed it.

I plan to look into this and check over my code tomorrow but figured I'd throw this it here just in case anyone may have ideas. The customer is running 3.2.1 Honeycomb on a Toshiba Thrive.

I can't duplicate on my devices. Any known issues or workarounds? I'm using my phone right now so it's a bit of a pain to try searching.

Kevin
 

Kevin

Well-Known Member
Licensed User
Longtime User
Bug with Honeycomb?

I'm looking into the FC my customer reported and using an emulator running 3.2 (API 13) and I am indeed getting a FC. Not sure at this point if it is my code or the library but judging from the error in the logs, it may be the lib. It mentions an error setting "progress" but I do not use that at all.

Error Log:

My code:
B4X:
Dim an As NotificationBuilder
   If an.IsInitialized = False Then an.Initialize()
   an.SmallIcon = "icon"
   an.AutoCancel = False: an.DefaultLight = False: an.DefaultSound = False: an.DefaultVibrate = False: an.OnGoingEvent = True: an.OnlyAlertOnce = True
   
   If OnOff = True Then
      Dim RcvrName As String
      Try
         RcvrName = STBName
         Catch
            RcvrName = ""
      End Try
      If RcvrName <> "" AND RcvrName.ToLowerCase <> "none" Then ' Still alive...
         If Common.NotificationScreen = "" Then Common.NotificationScreen = "Main"
         If ScrollText <> "" Then an.Ticker = ScrollText
         an.ContentTitle = MainText: an.ContentText = SubText
         If PrgEp <> "" Then an.SubText = PrgEp Else an.SubText = ""
         If PrgTime <> "" Then an.ContentInfo = PrgTime Else an.ContentInfo = ""
         
         If Bigtext <> "" Then
            Dim nBigtextStyle As NotificationBigTextStyle
            nBigtextStyle.Initialize
            nBigtextStyle.BigContentTitle = MainText
            nBigtextStyle.Bigtext = Bigtext
            nBigtextStyle.SummaryText = ""
            an.SetStyle (nBigtextStyle)
         End If
         
         an.setActivity (Main)
            Else
               an.ContentTitle = "DirecTV Remote+": an.ContentText = "Press here to use the remote"
               If PrgEp <> "" Then an.SubText = PrgEp Else an.SubText = ""
               If PrgTime <> "" Then an.ContentInfo = PrgTime Else an.ContentInfo = ""
               an.setActivity (Main)
      End If
      If ShowButtons AND Common.DemoVersion = False Then 
         an.AddAction (Null, "Remote", "remote", Main)
         an.AddAction (Null, "Mini-Guide", "miniguide", FavsGuide)
         an.AddAction2 (Null, "Refresh", "refresh", "NotificationService")
      End If
   End If
   
   If Common.LNTitle = "" OR Common.LNTitle <> MainText OR Common.LNText <> SubText OR Common.LNSubText <> PrgEp OR Common.LNInfo <> PrgTime OR Common.LNBigText <> Bigtext Then
      an.Notify (1) ' Only show if different to prevent notification from reopening repeatedly
      Common.LNTitle = MainText: Common.LNText = SubText: Common.LNSubText = PrgEp: Common.LNInfo = PrgTime: Common.LNBigText = Bigtext
   End If
 

barx

Well-Known Member
Licensed User
Longtime User
Hi Kevin

Check out this post on Stackoverflow

android: Notification Crash only on Honeycomb 3.2 - Stack Overflow

It seems to point towards an older support lib file, using the android package manager make sure you first have the latest release and then ensure to copy the latest from android package to your b4a additional library folder, overwriting the old one. Also, make sure you don't have another version installed in the standard b4a lib folder.

Hope that makes sense.
 

barx

Well-Known Member
Licensed User
Longtime User
... and peace fell upon the land once more...





p.s. glad it sorted it out mate.
 

walterf25

Expert
Licensed User
Longtime User
Notification Builder

Hey Barx, great library, however i seem to be running into an issue, when I try to run my application, I get an error, the application stops right at
B4X:
nb.Initialize

I'm not sure what the problem could be, I did copy the v4-support.jar file in the additional library folder where i also copied both files from your library.
I also downloaded the example you provided on one of your posts and this example also gives me the same error, i wonder what i could be doing wrong.

This is the error i get every time.


Can you help me figure this out.

I'm using a Motorola Photon running android version 2.3.4 and i'm compiling my app with Android SDK 17.

Your help will be appreciated, i really need to get this working to update one of my apps.

thanks,
Walter
 

walterf25

Expert
Licensed User
Longtime User
Notification Builder

Sorry everyone, it turns out that I had an old copy of the v4-support.jar file in the main library folder, and i had a latest one in the additional library folders, i guess they were conflicting with each-other, i deleted the older one and everything works great now.

Thanks for your help.

Cheers,
Walter
 

Souta

New Member
Licensed User
Longtime User
Strange thing....

Hi guys, I'm a beginner though, but maybe you can help me...

I have a very strange problem with this Plugin.

My App creates a Notifications via a Class Module. Cause it should be able to manage more then just one Notifications the Class generates at Start a Random ID. I was thinking to add a Refresh Action Button to the Notification. So i did sNotif.AddAction2(Null, "Refresh", "ref-" & ID, ServerRefreshService).
Everything seems to work, but after the first run it is impossible to change the Action Tag. It allways returns the same value ref-74968309. Even if i change the line to sNotif.AddAction2(Null, "Refresh", "test", ServerRefreshService) it shows the same...

See Log :
B4X:
Installing file.
PackageAdded: package:fls.servermanager.android
** Activity (main) Create, isFirst = true **
Action2 Tag set to test
** Activity (main) Resume **
Closed due to user request.
** Service (serverrefreshservice) Create **
** Service (serverrefreshservice) Start **
Service Started
ref-74968309

I use an Nexus 4, and i did uninstall the app. I realy don't know how the app allways keeps this result. Funny is that when i add a second Action Button, i can change that Tag as i want and it works.

I realy don't understand this.


PS. Sorry for my pure english.
 

barx

Well-Known Member
Licensed User
Longtime User
Maybe try logging ID just before the AddAction to see if the value is different. Failing that, you would need to post the relevant parts of your code or an example project showing the problem.
 

Souta

New Member
Licensed User
Longtime User
Here we go. I just created an example of this problem.
Also now i add an exit function where all notifications should get cancled.
But it didn't fix the problem.

Maybe i'm doing something wrong...
 

Attachments

  • NotifTest.zip
    2.4 KB · Views: 484

barx

Well-Known Member
Licensed User
Longtime User
I have downloaded you sample and will look at it this evening when I get in from work.
 

barx

Well-Known Member
Licensed User
Longtime User
hmmmm, the example seems to be working fine, see the log below, I opened the app and the notification shown. I click the notification and as it loads the Main activity as you can see it generates a new Rnd number. Tapping 'Refresh' action starts the service with correct tag holding that last generated number.

B4X:
** Activity (main) Pause, UserClosed = true **

** Activity (main) Create, isFirst = false **
ID Before new Action2 Tag: 4322891
Action2 Tag set to ref-4322891
ID After new Action2 Tag 4322891
** Activity (main) Resume **
** Service (test) Start **
Service Started
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false **
ID Before new Action2 Tag: 2330906
Action2 Tag set to ref-2330906
ID After new Action2 Tag 2330906
** Activity (main) Resume **
** Service (test) Start **
Service Started
** Service (test) Start **
Service Started
ref-2330906
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…