Jun 15, 2017 Replies: 20 This is a wrap for this Githubproject. LEDView Version: 1 LEDView Fields: ba As BA Methods: BringToFront DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map) Initialize (EventName As String) Invalidate Invalidate2 (arg0 As Rect) Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int) IsInitialized As Boolean RemoveView RequestFocus As Boolean SendToBack SetBackgroundImage (arg0 As Bitmap) SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int) SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int) SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int) SetVisibleAnimated (arg0 As Int, arg1 As Boolean) initLED (str As String, ledColor As Int, ledTextSize As Int, ledPixel As Int) run Properties: Background As Drawable Color As Int [write only] Enabled As Boolean Height As Int LEDColor As Int [read only] LEDText As String [read only] Left As Int Padding()() As Int Parent As Object [read only] Tag As Object Top As Int Visible As Boolean Width As Int Attached: LedViewEx.zip The Example LEDViewVx.x.zip The Library (copy the content to your additional libs folder) Java source Unfortunately the lib (Github-project) does not provide much properties. And i dont know how to change the speed or to stop the animation... Attachments java-src.zip java-src.zip 4.2 KB · Views: 720 LEDViewV1.0.zip LEDViewV1.0.zip 9.4 KB · Views: 805 LEDViewEx.zip LEDViewEx.zip 7.8 KB · Views: 772 Last edited: Jun 15, 2017 Click to expand...
This is a wrap for this Githubproject. LEDView Version: 1 LEDView Fields: ba As BA Methods: BringToFront DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map) Initialize (EventName As String) Invalidate Invalidate2 (arg0 As Rect) Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int) IsInitialized As Boolean RemoveView RequestFocus As Boolean SendToBack SetBackgroundImage (arg0 As Bitmap) SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int) SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int) SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int) SetVisibleAnimated (arg0 As Int, arg1 As Boolean) initLED (str As String, ledColor As Int, ledTextSize As Int, ledPixel As Int) run Properties: Background As Drawable Color As Int [write only] Enabled As Boolean Height As Int LEDColor As Int [read only] LEDText As String [read only] Left As Int Padding()() As Int Parent As Object [read only] Tag As Object Top As Int Visible As Boolean Width As Int Attached: LedViewEx.zip The Example LEDViewVx.x.zip The Library (copy the content to your additional libs folder) Java source Unfortunately the lib (Github-project) does not provide much properties. And i dont know how to change the speed or to stop the animation...
jimmyF Active Member Licensed User Longtime User Jun 15, 2017 #3 When I do this: Code: Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("Layout1") LED.initLED("My string of text",Colors.Magenta,28,120) LED.run End Sub It all works except the text does not change from your default text. It still displays "Hello LED". The other parameters take effect.
When I do this: Code: Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("Layout1") LED.initLED("My string of text",Colors.Magenta,28,120) LED.run End Sub It all works except the text does not change from your default text. It still displays "Hello LED". The other parameters take effect.
Peter Simpson Expert Licensed User Longtime User Jun 15, 2017 #4 That's excellent @DonManfred, thank you
demasi Active Member Licensed User Longtime User Jun 15, 2017 #6 Good Job! This is a very nice looking view. You included the lib's java source, so how we can do to compile this lib source? Using Eclipse? I know a little java but only using inline in B4A. I want to learn more about creating java libs and how to wrap java projects. Thank you.
Good Job! This is a very nice looking view. You included the lib's java source, so how we can do to compile this lib source? Using Eclipse? I know a little java but only using inline in B4A. I want to learn more about creating java libs and how to wrap java projects. Thank you.
Daniel-White Active Member Licensed User Longtime User Jun 15, 2017 #7 Why this remember my old days with my CGA monitor LoL, thank for share it.
Peter Simpson Expert Licensed User Longtime User Jun 16, 2017 #8 jimmyF said: When I do this: Code: Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("Layout1") LED.initLED("My string of text",Colors.Magenta,28,120) LED.run End Sub It all works except the text does not change from your default text. It still displays "Hello LED". The other parameters take effect. Click to expand... Jimmy, you can use Sleep(0) followed by LED.initLED to clear text or write new text, you can then keep changing the text without using Sleep. Code: Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("Layout1") Sleep(0) LED.initLED("Hello Jimmy", Colors.Green, 16, 60) End Sub Last edited: Jun 17, 2017
jimmyF said: When I do this: Code: Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("Layout1") LED.initLED("My string of text",Colors.Magenta,28,120) LED.run End Sub It all works except the text does not change from your default text. It still displays "Hello LED". The other parameters take effect. Click to expand... Jimmy, you can use Sleep(0) followed by LED.initLED to clear text or write new text, you can then keep changing the text without using Sleep. Code: Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("Layout1") Sleep(0) LED.initLED("Hello Jimmy", Colors.Green, 16, 60) End Sub
jimmyF Active Member Licensed User Longtime User Jun 17, 2017 #9 Bingo! Thanks Peter! Works like a charm!
Didier9 Well-Known Member Licensed User Longtime User Jun 18, 2017 #10 I would like to check this example but this is apparently incompatible with B4A v6.31. The error seems to come from the library itself. Do I need to upgrade or is there a work around for v6.31? Code: ** Service (starter) Create ** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** Error occurred on line: 31 (Main) java.lang.RuntimeException: java.lang.RuntimeException: unknown type at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166) at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:340) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134) at b4a.example.main.afterFirstLayout(main.java:102) at b4a.example.main.access$000(main.java:17) at b4a.example.main$WaitForLayout.run(main.java:80) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: java.lang.RuntimeException: unknown type at anywheresoftware.b4a.ConnectorUtils.readMap(ConnectorUtils.java:144) at anywheresoftware.b4a.ConnectorUtils.readMap(ConnectorUtils.java:133) at anywheresoftware.b4a.ConnectorUtils.readMap(ConnectorUtils.java:133) at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:140) ... 20 more ** Activity (main) Resume **
I would like to check this example but this is apparently incompatible with B4A v6.31. The error seems to come from the library itself. Do I need to upgrade or is there a work around for v6.31? Code: ** Service (starter) Create ** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** Error occurred on line: 31 (Main) java.lang.RuntimeException: java.lang.RuntimeException: unknown type at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166) at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:340) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134) at b4a.example.main.afterFirstLayout(main.java:102) at b4a.example.main.access$000(main.java:17) at b4a.example.main$WaitForLayout.run(main.java:80) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: java.lang.RuntimeException: unknown type at anywheresoftware.b4a.ConnectorUtils.readMap(ConnectorUtils.java:144) at anywheresoftware.b4a.ConnectorUtils.readMap(ConnectorUtils.java:133) at anywheresoftware.b4a.ConnectorUtils.readMap(ConnectorUtils.java:133) at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:140) ... 20 more ** Activity (main) Resume **
Erel B4X founder Staff member Licensed User Longtime User Jun 19, 2017 #11 The error comes from the layout file which is not compatible with B4A v6.3. You will need to recreate the layout file.
The error comes from the layout file which is not compatible with B4A v6.3. You will need to recreate the layout file.
Didier9 Well-Known Member Licensed User Longtime User Jun 19, 2017 #12 Erel said: The error comes from the layout file which is not compatible with B4A v6.3. You will need to recreate the layout file. Click to expand... When trying to add the LEDView to the layout, I get an error "The given key was not present in the dictionary". I know I should just upgrade, but my copy is not yet a year old and I am trying to old on for another 3 months... I want to understand the potential difficulties in running an older version of the tool, so this is more like an exercise. If it just will not work, that's OK, but I want to know if I should even try. Thanks again for your help.
Erel said: The error comes from the layout file which is not compatible with B4A v6.3. You will need to recreate the layout file. Click to expand... When trying to add the LEDView to the layout, I get an error "The given key was not present in the dictionary". I know I should just upgrade, but my copy is not yet a year old and I am trying to old on for another 3 months... I want to understand the potential difficulties in running an older version of the tool, so this is more like an exercise. If it just will not work, that's OK, but I want to know if I should even try. Thanks again for your help.
DonManfred Expert Licensed User Longtime User Jun 19, 2017 #13 Didier9 said: When trying to add the LEDView to the layout, I get an error "The given key was not present in the dictionary". Click to expand... Please upload your project. File-Export as zip.
Didier9 said: When trying to add the LEDView to the layout, I get an error "The given key was not present in the dictionary". Click to expand... Please upload your project. File-Export as zip.
Didier9 Well-Known Member Licensed User Longtime User Jun 19, 2017 #15 DonManfred said: Please upload your project. File-Export as zip. Click to expand... I am trying the example...
DonManfred said: Please upload your project. File-Export as zip. Click to expand... I am trying the example...
DonManfred Expert Licensed User Longtime User Jun 19, 2017 #16 Remove the layout from the example. It is made with b4a 7. Create a new layout with your b4a version.
Remove the layout from the example. It is made with b4a 7. Create a new layout with your b4a version.
Didier9 Well-Known Member Licensed User Longtime User Jun 19, 2017 #17 DonManfred said: Remove the layout from the example. It is made with b4a 7. Create a new layout with your b4a version. Click to expand... This is what I did. When I tried to add the LEDView custom view, I got the error message "The given key was not present in the dictionary" in the designer. Attachments Designer error.png 77.8 KB · Views: 677
DonManfred said: Remove the layout from the example. It is made with b4a 7. Create a new layout with your b4a version. Click to expand... This is what I did. When I tried to add the LEDView custom view, I got the error message "The given key was not present in the dictionary" in the designer.
DonManfred Expert Licensed User Longtime User Jun 19, 2017 #18 Which ava version are you using? Which android.jar are you using? Though i´m not sure what exactly the problem is...
Which ava version are you using? Which android.jar are you using? Though i´m not sure what exactly the problem is...
Didier9 Well-Known Member Licensed User Longtime User Jun 19, 2017 #19 B4A version 6.31 Java: C:\Program Files (x86)\Java\jdk1.8.0_102\bin\javac.exe SDK: C:\Android\android-sdk\platforms\android-16\android.jar I tried it on two different computers, both running Win 7 64bit and I believe both have the same version of java and sdk. I get the same error on both.
B4A version 6.31 Java: C:\Program Files (x86)\Java\jdk1.8.0_102\bin\javac.exe SDK: C:\Android\android-sdk\platforms\android-16\android.jar I tried it on two different computers, both running Win 7 64bit and I believe both have the same version of java and sdk. I get the same error on both.
DonManfred Expert Licensed User Longtime User Jun 19, 2017 #20 Try a newer version of android jar... 25