I want to know how to get the return value from a function called B4X from inline JAVA.
Private Sub Button1_Click
Me.As(JavaObject).RunMethod("sum", Array(1,2))
End Sub
Sub getsum(a As Int,b As Int) As String
Return a+b
End Sub
#if java
public void sum(Int a,Int b){...
Calculate width of Charsequence Text
Uses Java Function measureText(charSequence , int Start, int End)
' textSize is default textsize of label where charsequence is displayed
Sub getWidthofCS(cx As Object,textSize As Float) As Float
Dim jo As JavaObject = Me
Return...
I need to use the following inline java code in my B4A application:
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
//This broadcast receiver...
I'm trying to follow this example: https://riptutorial.com/opencv/example/22915/template-matching-with-java
I'm not a java programmer, so I'm having a hard time ...
The program returns the error below:
I imported the java libraries and created a little program.
B4J project and opencv libs...
Hi All,
I have to intercept, from an Android device, an event raised from a library of the device.
I added the library with
#AdditionalJar: companyregdevicelibrary
In this library there is an "IButton" object that I initialize with JavaObject
Dim CompDevice As JavaObject...
requires new api
however if i use new api my permissions are all messed up.
is there away to ask for overlay permission via if java???
I don't want to update my version of b4a just to change a permission...
Please help thanks.
** Service (notify_builder) Start **
PanelMain
PanelMain
PanelMain...
Hello,
this is a simple B4A class to make easy the use of the built-in led of our beloved android devices.
Tested on various devices up to android 8.
The goal is to use the led as a Torch.
The code is commented and comes with an example.
It uses inline java and depends on:
-Javaobject lib...
I'm testing some things and have a piece of inline java that is throwing an exception under some conditions. That exception is not fatal for the app at all, and is also wrapped in a try/catch block.
However, if the exception is thrown, it's not possible to live update the code anymore. In...
Ola
At some stage I will need to work with MS Word Tables, this is my attempt to do do using Inline Java.
Dependencies: poi-3-17 / jPOI Library
Output:
Reproduction
Dim msword As MashMSWord
msword.Initialize
msword.Create(File.DirApp,"msword.docx")
msword.AddParagraph("Anele...
I'm trying to use this code to see the log in the java code:
#if Java
public static class MyAdListener extends com.google.android.gms.ads.AdListener {
String eventName = "nativead";
BA.Log(eventName);
@Override
public void onAdClosed() {...
I seem to now have a working Unit Test solution for B4A for anybody interested.
The test code and test runner are included in the project to be tested, but can be excluded from compilation using a conditional directive - I use '#if UNIT_TESTS', with 'UNIT_TESTS' defined when required in a Build...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.