Java Question Sample Library

Roger Garstang

Well-Known Member
Licensed User
Longtime User
For those new to making Libraries in Eclipse for B4A. This Giant thing is the Source for Version 1.6 of my Line Layout library. It shows a lot of the integration and interaction between Java/Android and B4A to give you an idea on how to do Events, extend functionality, etc. It does some interesting things too...the biggest probably being how AddView figures out the layout of a control/view before it is rendered so the library can do its thing and keep track of positions. (Thousands of posts in various forums trying to do this very thing...I pieced it all together and added some of my own to it to make it happen.

I share to help others understand the inner workings and possibly give ideas to enhance B4A even further. If you have suggestions, ideas for improvement/optimization, bugs/errors, etc just drop me a note here. Its is kind of to the point where it just needs extended- Once I use them more I plan on adding Checkboxes, Radio Buttons, Toggle Buttons, etc to it as other Add methods. For as little as I use them though just adding them with the AddView method for now is better and keeps the library small. Some controls won't gain much to justify their own Add method too.

In college we used to make massive .h files for C++ that did everything we'd ever need to setup any C++ app. We called them KitchenSink.h as a play on words for having "Everything but the Kitchen Sink". Adding much more would kind of make this become that when the original intent was to just give an easy way to make a Form that can be loaded from a Database with "Tab Order", State Management, and fix shortcomings in some views. But, if you have anything cool or get brave and make methods for the missing controls or other functionality pass them along.
 

Attachments

  • LineLayoutSource.zip
    8.9 KB · Views: 306
Last edited:

bloxa69

Active Member
Licensed User
Longtime User
very helpful

Roger,
thanks a lot for sharing, it's very helpful. Many people struggling with wrapping .jar libraries. Do you have by any chance an Eclipse project utilizing external library wrapper that you might share with us?
Thanks!:sign0188:
 

Roger Garstang

Well-Known Member
Licensed User
Longtime User
The only one I'd need to wrap at the moment would be a barcode scanner, but I think it has already been done. The Motorola ET1 I'd mostly use it on doesn't need it though since it has a Wedge interface built-in and feeds the scanned barcode right to the focused field. I'm sure I'll eventually need one...I just got an email from a Facial Recognition company that used WinMobile in the past announcing a Java library, so may play with it soon.
 

bloxa69

Active Member
Licensed User
Longtime User
Hey, thanks for reply Roger. I will appreciate any info or samples in that regard. I am sure I'm not alone. At the moment I'm struggling with finding a way to either wrap a library or find any other way to use OpenGL lib with Live Wallpaper Lib. Or anything that would give me hardware accelerated 2D Live Wallpaper in B4A.
I've played with GLWallpaperService Lib but I get a strong feeling it might be beyond my abilities.
:sign0188::sign0098:
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…