javaobject

  1. M

    Android Question SetField of a Type with Reflector or JavaObject ?

    Hi, I want to use a type as an enum and I don't want to set the value of each string of that type since the fieldname IS what the string value will be. How to do it with Reflector or JavaObject ? Dim r As Reflector r.Target = BiomeType r.Target = r.RunMethod("getClass") Dim...
  2. walterf25

    Android Question JavaObject or Reflection Code

    Hi all, does anyone know how to write this code using either JavaObject or Reflection libraries, maybe both are needed? I'm not so good and don't really understand much how to use those two libraries, i've tried several things but none of them work try {...
  3. Chianca

    Android Question Using .aar library with JavaObject

    Hello, How can I use an .aar Library inside my B4A project? I've already added #AdditionalJar, but now, I want to call the methods of the Library. #AdditionalJar: libposdigital-1.4.0-2-release.aar
  4. 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...
  5. M

    Android Question Using JavaObject or Reflector to get height of TabStripViewPager ?

    Hi, TabStripViewPager exposes very few attributes and I'm trying to get the height of the whole TabStrip. I have not been able to obtain this value using code such as : Dim r As Reflector r.Target = tabStrip Dim tabStripHeight As Int = r.RunMethod("getMeasuredHeight") However I know it's in...
  6. I

    B4J Question Multitouch

    Hi, I am working on multitouch in B4J and I have some questions. Idea is to have pane same size as form, and when there is touch event on pane i get data on x, y, id of touch... My code is here: #Region Project Attributes #MainFormWidth: 600 #MainFormHeight: 600 #End Region Sub...
  7. F

    Android Question AppBrains AdId

    Hi: I've managed to include a banner with Appbrains thanks to Erel and amidgeha. Now, i'd like to show some banners in several activities so i've created some of them in Appbrains web. The problem comes when i want to identify the banner i'm showing. I've searched in appbrains documentation and...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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 =...
  13. 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)...
  14. 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...
  15. 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...
  16. ShaneG30

    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...
  17. 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...
  18. 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) {...
  19. 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