Custom Notification library

barx

Well-Known Member
Licensed User
Longtime User
I've been tinkering with notifications and have hit some limitations. Having read around the internet it seems that custom notifications can be created. This could well solve all my problems.

The example and code for doing this in java/eclipse is in the link posted below. I wish I could create a library for it but the simple fact is I know no java.

Are there any wizards out there with a little time and the required knowledge to build a library to add this function for us mere b4a mortals.

The one shown with an image to the left and labels to the right would suffice if it would be more difficult to create one that you can add your own views to. So that I could add image and texts.

Status Bar Notifications | Android Developers

Thanks
 

barx

Well-Known Member
Licensed User
Longtime User
How would one go about it, I'm not into the advanced stuff yet so clueless. Should it be a lib? a use of reflector?I don't know wish I had this knowledge lol, been staring at that page for hours and still don't know where to start.

Thinking of getting the android dev books out and maybe trying to learn it all. The whole reason for using b4a though was because I was stuggling with the java/eclipse way. More at home with basic ;)
 

thedesolatesoul

Expert
Licensed User
Longtime User
The only way to do this is to create a lib.
The gist of it is: You need to create a remoteview and assign the notification contentview to the remote view.
In theory it looks simple. In practice, there are a lot of things I do not understand regarding B4A's handling of these objects.
I already got into trouble the first time I did this (do a search), so I am not going to attempt it. Besides my attempts failed and you might need to go too deep and create your own notifcations wrapper instead of using a quick hack.
 

barx

Well-Known Member
Licensed User
Longtime User
Thanks for the info Mr soul.

Having looked back over recent library activity, I believe this is a task for corwin.
I can see it now AHCustomNotification lol;)
 

barx

Well-Known Member
Licensed User
Longtime User
If only... I don't even know what a remote view is. Lol

I do have the Sam's teach yourself android application development in 24hours and the android application development for dummies books. Maybe they can shed some light.
 

barx

Well-Known Member
Licensed User
Longtime User
Looking at his recent activity, XverhelstX could well be my man here. Something your willing to do @ XverhelstX. Or any pointers how to go about it. I've literally been staring at this for ages. I'm assuming it's going to need some readonly files like the AH xxxxxx libs. I'm guessing these can be copied straight from the example. It's the other stuff I have no idea of. How to wrap the 'properties' etc.

Again I'm guessing some sort of initalizing needs to be done then pass some info. Text for title, body and an image.
 

barx

Well-Known Member
Licensed User
Longtime User
Hi XverhelstX
Thanks for considering this.

Basically I'm trying to make an app (as we all are). It's intended purpose is to use the notification to display notes / reminders similar to

This

But I will be adding functionality such as being able to set a notification for the future and the notification settings (light, sound, vibrate)

So that this doesn't fill the status bar with icons I am giving to option to show only one icon (the number of notifications is shown with .number and the other notifications use a transparent icon (as I have found out you can't have 'no icon')) The problem with this is that then the actual notification in the list has no icon beside it. Therefore, I'm hoping to create custom notification just like in the link in my previous post as this will allow my to assign a img (<<- read icon ;)) to the items that have a transparent status bar icon.

Hope that makes sense lol. I have made a good start on the app, but really could do with this custom notification lib. cheers
 

barx

Well-Known Member
Licensed User
Longtime User
My problem described here is also from the same project. I was trying to see what the best results I could achieve with the custom notification functionality and have somehow lost the notification list icons all together lol.

The following bits are just thoughts and not a must:

If the required example is produced then I'm guessing other layouts could easily be done myself (or by others) if needed by tweaking the remote view structure file? You would know better about this but again it's not a must.

Also, this looks like a small lib (again you would know better) but if it turns out simple to make posting the source could well help me and others create such things in future. I literally have non idea where to start with it but would love to 'get into it'.


I could offer a small donation for this (wouldn't be able to stretch much further than 10gbp mind, but it may sweeten the deal for your efforts ;))

Not sure if that kid of activity is allowed though, erel will have to step in if it isn't lol.
 

barx

Well-Known Member
Licensed User
Longtime User
After looking at some library source code I thought something would click and allow me to sort it myself....

No such luck.:sign0104:
 
Top