javaobject

  1. B

    Android Question javaobject question - deezer sdk

    Hi, I've been trying to get the deezer sdk working in B4A (some functions work ok, but no sound yet). Can someone point me in the right direction here ? I don't know any Java. Java (I did manage to get it working here, but doing the whole thing in Java is not what I would prefer): String...
  2. Brandsum

    Android Question JavaObject Constructor not found

    Hi, I just want to set path effect to the canvas paint object. Here is the code: Original Java Code: mCanvas.setPathEffect(new CornerPathEffect(10)); My Code: Dim drawingCanvas As Canvas drawingCanvas.Initialize(panelArtwork) Dim pathEffect As JavaObject...
  3. rleiman

    Android Question JavaObject not always returning a value when media has finished playing

    I seem to be having a bit of a problem with the execution of this code which is in my service: Sub IsStreamActive(Stream As Int) As Boolean Dim jo As JavaObject Return jo.InitializeStatic("android.media.AudioSystem").RunMethod("isStreamActive", _ Array(Stream, 0)) End Sub I'm...
  4. L

    Android Question 3th part library. Callback problem with annotations

    Hi, I've to integrate my app with a library that manage the communication of a device with a POS. I initialize my class object with javaObject and run methods without problems. But the lib needs a method "Register(callbacksClass)" where I pass my activity istance to manage the callbacks methods...
  5. H

    B4J Question JavaObject, calling the java class method.

    Greetings everyone, How do you call the following code under the .RunMethod of a JavaObject: myDoc = collection.find(eq("i", 71)).first(); The above code is an example given for mongodb tutorial in Java. I tried the following code in B4J to follow the above code: cursor =...
  6. Yunus ÖZ

    Android Question Change StatusColor from class

    I have a class file name funcs, and there is a code like this Public Sub statusBarColor(color As Int) If ph.SdkVersion >= 21 Then Dim jObj As JavaObject jObj.InitializeContext Dim window As JavaObject = jObj.RunMethodJO("getWindow", Null)...
  7. Maodge

    Android Question [solved]How judge same file

    hi, when i use file explorer lib (https://www.b4x.com/android/forum/threads/class-file-explorer-with-visualization.19003/), i get diffrent path for the same selected file. for example : /mnt/sdcard/1.txt , /sdcard/1.txt, /storage/sdcard/1.txt ... above all is the same file. so i can't using...
  8. Sandman

    Android Tutorial How to determine needed permissions from JavaObject code

    Now and then there are JavaObject code snippets posted in the forum. Usually there are permissions required listed together with the code, but not always. Which could be because none are needed. (This very small tutorial sprung out of this thread.) This is how one determines what permissions...
  9. LWGShane

    B4J Question VBox & TextField Issue

    I'm creating a wrapper for VBox and HBox (along with LinearLayout and UIStackView). I've completed VBox however, I have an issue with the TextField control: When I add one to the VBox, the VBox ignores its "PrefWidth" property. I'm creating the wrappers instead of using the designer because...
  10. G

    Android Question Exception using JavaObject and AdditionalJar SDK

    Hello, I'be been trying to use the JavaObject to access a Java API for a rfid reader sdk. The fist code I tried is below : #Region Project Attributes #ApplicationLabel: Test RFID #VersionCode: 1 #VersionName: 'SupportedOrientations possible values: unspecified, landscape or...
  11. 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) {...
  12. Shivito1

    B4J Question jo.RunMethod error

    Error: Waiting for debugger to connect... Program started. Type Network Path: example(\\Server\SharedFolder) Error occurred on line: 61 (Main) java.lang.IllegalArgumentException: object is not an instance of declaring class at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)...
Top