B4A Tutorial Accessing third party Jar with #Additionaljar and JavaObject - Picasso - Erel    
Jan 19, 2026   
(27 reactions)   
tags: Lib, use jar in b4a, JAR.
With the help of JavaObject it is now possible to integrate third party jars without a wrapper... service directly.
Sub GetContext As JavaObject
Return GetBA.GetField("context")
End Sub
Sub GetBA As JavaObject
Dim jo As JavaObject
Dim cls As String = Me
cls = cls.SubString... will call the static method:
Sub GetPicasso As JavaObject
Dim jo As JavaObject
'com.squareup... the interface. This is done with JavaObject.CreateEvent (or CreateEventFromUI).
In this case we...
B4A Code Snippet Using StartActivityForResult with JavaObject - Erel    
Jun 18, 2020   
(11 reactions)   
tags: call external for resultSubName: StartActivityForResult
Description: This code demonstrates how JavaObject can be used to...
Sub StartActivityForResult(i As Intent)
Dim jo As JavaObject = GetBA
ion = jo.CreateEvent... As JavaObject
Dim cls As String = Me
cls = cls.SubString("class ".Length)
jo... jo As JavaObject = i
Dim uri As String = jo.RunMethod("getParcelableExtra"...
Return Null
End Sub
Dependencies: JavaObject v1.20+
Tags: StartActivityForResult, OnActivityResult...
B4A Code Snippet Tips regarding JavaObject and R8 optimizer - Erel    
Oct 1, 2026   
(6 reactions)JavaObject dynamically calls Java APIs. R8 doesn't detect these calls and can therefore remove... for example:
Dim builder As JavaObject
builder.InitializeNewInstance("com.google.android.gms...
link: ClassNotFoundException or MethodNotFoundException caused by JavaObject is quite difficult to diagnose.
In...
link: I did think about it and decided not to add such rule. Maybe in the future.
I expect that once we en...
link: .ads.** { *; }
whenever JavaObject accesses a class from that package.
This would obviously reduce...
B4J Question [SOLVED] - Javaobject Problem - JWT with RSA256 - hatzisn    
Sep 30, 2022   
(1 reaction) KeyFactory kf = KeyFactory.getInstance("RSA");
Dim KeyFactory As JavaObject
KeyFactory... META
Dim KF As JavaObject
KF = KeyFactory.RunMethod("getInstance",Array("RSA"))
Dim su As StringUtils
Dim keySpecPKCS8 As JavaObject
keySpecPKCS8...)))
Dim keySpecX509 As JavaObject
keySpecX509.InitializeNewInstance("java.security.spec...============================================================
Dim RSAPrivateKey As JavaObject
'I tried both with those two options but no luck...
B4J Code Snippet Set File Modified Date using JavaObject - aeric    
Jan 20, 2026   
(4 reactions)DateTime.DateFormat = "yyyy-MM-dd"
DateTime.TimeFormat = "hh:mm a"
Dim LastModifiedTime As Long = DateTime.DateTimeParse("2026-01-20", "10:05 pm")
Dim jo As JavaObject
jo.InitializeNewInstance("java.io.File", Array(File.Combine(File.DirApp...
link: Better two than zero 😊...
link: There are a lot of code snippets.
It's hard to know if the one you're writing already exists...
B4A Library JavaObject library - Erel    
Jul 11, 2016   
(23 reactions)The purpose of JavaObject library is similar to the purpose of Reflection library. Both libraries allow you to directly call Java APIs based on Java reflection features.
JavaObject design is different than Reflection library and in most cases simpler to use. However JavaObject doesn't replace... libraries together (both are lightweight libraries).
JavaObject approach is more "object oriented". You declare a JavaObject object which then "wraps" any other object and provide...
B4A Question [Solved]How to code in JavaCode for using JavaObject? - Olaan    
Feb 7, 2025I'm still learning how to use javaobject,but I don't know to recode javacode about return the value.
I need someone to show me the example....
link: Many Thanks all of you...
link: As @Daestrum suggests, you need to use a monospaced font.
161542
Set the EditText1 to a monospaced f...
link:
You probably need to use a fixed font so all characters (and spaces) are the same width.
The code ...
B4J Question [SOLVED] Turn Off Display - programmatically / from C++ to Java, more specific javaobject - Magma    
Mar 8, 2021 much java guy...
as far... but nothing at all... :-(
Dim user32 As JavaObject
user32 = user32...)
Dim ahwnd As JavaObject
ahwnd=ahwnd.InitializeNewInstance("com.sun.jna.platform.win32.WinDef.HWND","0xffff")
Dim awmsys As JavaObject
awmsys=awmsys... As JavaObject
scmon=scmon.InitializeNewInstance("com.sun.jna.platform.win32.WinDef.LPARAM"...
B4A Code Snippet Custom notifications (including expandable ones), with JavaObject and XML layout - GeoT    
Feb 23, 2026   
(10 reactions) notifications, I developed this example using AI, the JavaObject library, and native Android... automatically selects which one to use based on the state
Dim rvCustom As JavaObject = CreateRemoteViews...
link: I've also uploaded a new version where I've moved the notification creation code to the Cust...
link: Despite using Erel's code from post #2 and marking the files as read-only, they will disappear a...
link: Now I see that the part of creating the extended notification with actions can be moved from the ser...
B4J Tutorial OdoMeter with JavaObject - Johan Schoeman    
Sep 15, 2025   
(13 reactions) JavaObject as the original project extend Region that for some reason jut not want to show the UI... you will figure out the code in the Jar and then add additional methods using JavaObject including events...
link:
Thanks Mr Wizard. Looking at your code above makes me realize that I learn new things from you.
I ...
link: B4J esp. modifying existing Java libraries > compile > create JARs to be used by B4J.
Would...
link: Thanks Mr Wizard. Looking at your code above makes me realize that I learn new things from you.
I s...
Page: 1  
2  
3  
4  
5  
6  
7