inline java

  1. B

    Android Question How to get the return value of getBA().raiseEventFromUI

    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){...
  2. epiCode

    Android Code Snippet [B4X] Calculate width of Charsequence Text

    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...
  3. kstasadduq

    Android Question Need help for Inline Java Code

    I need to use the following inline java code in my B4A application: ////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////// //This broadcast receiver...
  4. LucaMs

    Android Question Inline Java code in B4XPages

    Is this correct? #If B4A #If Java '... #End If #End If
  5. jroriz

    B4J Question Opencv Template Matching (inline java)

    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...
  6. L

    Android Question Third part library - JavaObject

    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...
  7. Shivito1

    Android Question Android will not let me upload my app

    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...
  8. DavideV

    B4A Class Torch class

    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...
  9. Sandman

    Android Question Does exceptions in inline java mess with live updating the code?

    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...
  10. Mashiane

    B4J Library MashMSWord: Beginning MS Word Tables

    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...
  11. A

    Android Question BA.Log don't work in inline java code

    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() {...
  12. J

    B4A Class A Unit Test solution (class CTestRunner)

    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...
  13. Shivito1

    B4J Question Inline java use vairable

    Code: #if java public static void foo() { try { @SuppressWarnings("unused") String command = "c:\\windows\\system32\\net.exe use f: " + x ; Process p = Runtime.getRuntime().exec(command); System.out.print("does not = 1"); } catch (Exception name) {...
Top