B4A Library Clock-View

A "partial" wrap for this Github Project. When I have some more time available I will try to add some more features.

Posting:
1. The B4A sample project (b4aClock.zip)
2. LibRes.zip - extract it and copy the LibRes folder with its contents to be on the same folder level as that of the /Objects and /Files folders of the B4A project.
3. The Java code (library and wrapper) - change it to your liking....
4. B4A lib files (ClockLibFiles.zip). Extract the jar and xml and copy them to your additional libs folder.

Sample code:
B4X:
#Region  Project Attributes
    #ApplicationLabel: b4aClock
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: False
#End Region

#AdditionalRes: ..\LibRes
#AdditionalJar: com.android.support:support-v4

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private cv1 As ClockView
    Private cv2 As ClockView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")
    
    cv1.BorderColor = Colors.LightGray
    cv1.ShowBorder = True
    
    cv1.ShowSecondsNeedle = True
    cv1.ShowSecondsProgress = True
    cv1.SecondsNeedleColor = Colors.Magenta
    cv1.SecondsProgressColor = Colors.Magenta
    
    cv1.ShowMinutesValues = True
    cv1.ShowMinutesProgress = True
    cv1.MinutesNeedleColor = Colors.Cyan
    cv1.MinutesProgressColor = Colors.Yellow   
    
    cv1.ShowHoursValues = True
    cv1.HoursValuesColor = Colors.Red
    cv1.HoursProgressColor = Colors.Yellow
    cv1.HoursNeedleColor = Colors.Red
    
    cv1.ShowCenter = True
    cv1.CenterOuterColor = Colors.White
    cv1.CenterInnerColor = Colors.Green

    
    cv1.ShowDegrees = True
    cv1.DegreesColor = Colors.Cyan
    
    'this can be cv1.DISPOSITION_ALTERNATE, cv1.DISPOSITION_REGULAR
    cv1.ClockValueDisposition = cv1.DISPOSITION_ALTERNATE
    
    'this can be cv1.DEGREE_TYPE_CIRCLE, cv1.DEGREE_TYPE_LINE, cv1.DEGREE_TYPE_SQUARE
    cv1.ClockDegreesType = cv1.DEGREE_TYPE_CIRCLE
    
    ' this can be cv1.DEGREE_STEP_QUARTER, cv1.DEGREE_STEP_FULL, or cv1.DEGREE_STEP_TWELVE
    cv1.ClockDegreeStep = cv1.DEGREE_STEP_FULL
    

    '2nd clock
    cv2.BorderColor = Colors.Yellow
    cv2.ShowBorder = True
    
    cv2.ShowSecondsNeedle = True
    cv2.ShowSecondsProgress = True
    cv2.SecondsNeedleColor = Colors.Blue
    cv2.SecondsProgressColor = Colors.Blue
    
    cv2.ShowMinutesValues = True
    cv2.ShowMinutesProgress = True
    cv2.MinutesNeedleColor = Colors.Cyan
    cv2.MinutesProgressColor = Colors.White
    
    cv2.ShowHoursValues = True
    cv2.HoursValuesColor = Colors.Yellow
    cv2.HoursProgressColor = Colors.Red
    cv2.HoursNeedleColor = Colors.Yellow
    
    cv2.ShowCenter = True
    cv2.CenterOuterColor = Colors.Green
    cv2.CenterInnerColor = Colors.White

    
    cv2.ShowDegrees = True
    cv2.DegreesColor = Colors.Red
    
    'this can be cv2.DISPOSITION_ALTERNATE, cv2.DISPOSITION_REGULAR
    cv2.ClockValueDisposition = cv2.DISPOSITION_REGULAR
    
    'this can be cv2.DEGREE_TYPE_CIRCLE, cv2.DEGREE_TYPE_LINE, cv2.DEGREE_TYPE_SQUARE
    cv2.ClockDegreesType = cv2.DEGREE_TYPE_LINE
    
    ' this can be cv2.DEGREE_STEP_QUARTER, cv2.DEGREE_STEP_FULL, or cv2.DEGREE_STEP_TWELVE
    cv2.ClockDegreeStep = cv2.DEGREE_STEP_QUARTER

    
    
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub






Clock
Version:
1
  • ClockView
    Fields:
    • DEGREE_TYPE_SQUARE As int
    • DISPOSITION_ALTERNATE As int
    • DEGREE_TYPE_CIRCLE As int
    • DEGREE_STEP_TWELVE As int
    • DISPOSITION_REGULAR As int
    • DEGREE_TYPE_LINE As int
    • DEGREE_STEP_QUARTER As int
    • DEGREE_STEP_FULL As int
    Methods:
    • DesignerCreateView (base As anywheresoftware.b4a.objects.PanelWrapper, lw As anywheresoftware.b4a.objects.LabelWrapper, props As anywheresoftware.b4a.objects.collections.Map) As void
    • IsInitialized As boolean
    • Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String) As void
    • BringToFront As void
    • SetLayout (arg0 As int, arg1 As int, arg2 As int, arg3 As int) As void
    • SendToBack As void
    • SetVisibleAnimated (arg0 As int, arg1 As boolean) As void
    • RemoveView As void
    • Invalidate3 (arg0 As int, arg1 As int, arg2 As int, arg3 As int) As void
    • Invalidate2 (arg0 As android.graphics.Rect) As void
    • SetColorAnimated (arg0 As int, arg1 As int, arg2 As int) As void
    • SetBackgroundImageNew (arg0 As android.graphics.Bitmap) As anywheresoftware.b4a.objects.drawable.BitmapDrawable
    • Invalidate As void
    • SetLayoutAnimated (arg0 As int, arg1 As int, arg2 As int, arg3 As int, arg4 As int) As void
    • RequestFocus As boolean
    Properties:
    • ShowSecondsProgress As boolean [write only]
    • Left As int
    • ClockValueStep As int [write only]
    • Parent As java.lang.Object [read only]
    • BorderColor As int [write only]
    • SecondsProgressFactor As float [write only]
    • HoursNeedleColor As int [write only]
    • ShowCenter As boolean [write only]
    • ClockDegreeStep As int [write only]
    • SecondsNeedleColor As int [write only]
    • HoursProgressColor As int [write only]
    • Visible As boolean
    • Padding As int[]
    • Height As int
    • ShowSecondsNeedle As boolean [write only]
    • Width As int
    • ShowBorder As boolean [write only]
    • HoursValuesColor As int [write only]
    • ClockValueDisposition As int [write only]
    • DegreesColor As int [write only]
    • Background As android.graphics.drawable.Drawable
    • ShowHoursProgress As boolean [write only]
    • Color As int [write only]
    • MinutesNeedleColor As int [write only]
    • MinutesValuesFactor As float [write only]
    • Enabled As boolean
    • CenterOuterColor As int [write only]
    • CenterInnerColor As int [write only]
    • ClockDegreesType As int [write only]
    • Top As int
    • MinutesProgressFactor As float [write only]
    • ShowMinutesValues As boolean [write only]
    • MinutesProgressColor As int [write only]
    • ShowHoursValues As boolean [write only]
    • Tag As java.lang.Object
    • ShowMinutesProgress As boolean [write only]
    • ClockBackground As int [write only]
    • SecondsProgressColor As int [write only]
    • ClockType As int [write only]
    • ShowDegrees As boolean [write only]

1.png
 

Attachments

  • LibRes.zip
    109.4 KB · Views: 282
  • ClockLibFiles.zip
    31.1 KB · Views: 281
  • b4aClock.zip
    9.5 KB · Views: 289
  • TheJavaCode.zip
    20.7 KB · Views: 261

Johan Schoeman

Expert
Licensed User
Longtime User
This is Version 1.01. Have added the ability to build the Clock View via the Builder in ClockTheme.java of the attached Java source code. Sure you will figure it out.

Attached:
1. zipped B4A project - cv3 uses the builder to build a clock view. I think most of the properties has been taken care of in the builder.
2. LibRes.zip - see post #1 above what to do with it.
3. zipped and cleaned up Java project (lib and wrappers)
4. zipped B4A Library files (ver 1.01) - copy the to your additional libs folder.

1.png


Clock
Author:
Github: Belkilani Ahmed Radhouane, Wrapped by: Johan Schoeman
Version: 1.01
  • ClockViewBuilder
    Fields:
    • DEGREE_TYPE_SQUARE As int
    • DISPOSITION_ALTERNATE As int
    • DEGREE_TYPE_CIRCLE As int
    • DEGREE_STEP_TWELVE As int
    • DISPOSITION_REGULAR As int
    • DEGREE_TYPE_LINE As int
    • DEGREE_STEP_QUARTER As int
    • DEGREE_STEP_FULL As int
    Methods:
    • borderColor (bordercolor As int) As clockviewwrapper.clockviewBuilderWrapper
    • setClockDegreeStep (clockDegreeStep As int) As clockviewwrapper.clockviewBuilderWrapper
    • IsInitialized As boolean
    • Initialize (ba As anywheresoftware.b4a.BA) As void
    • centerInnerColor (innerColor As int) As clockviewwrapper.clockviewBuilderWrapper
    • setDegreesColor (degreesColor As int) As clockviewwrapper.clockviewBuilderWrapper
    • showMinutesProgress (showMinutesProgress As boolean) As clockviewwrapper.clockviewBuilderWrapper
    • centerOuterColor (outerColor As int) As clockviewwrapper.clockviewBuilderWrapper
    • secondsProgressColor (secondsprogressColor As int) As clockviewwrapper.clockviewBuilderWrapper
    • setMinutesValuesFactor (minutesValuesFactor As float) As clockviewwrapper.clockviewBuilderWrapper
    • setSecondsProgressFactor (secondsProgressFactor As float) As clockviewwrapper.clockviewBuilderWrapper
    • showMinutesValues (showMinutesValues As boolean) As clockviewwrapper.clockviewBuilderWrapper
    • minutesProgressColor (minutesProgressColor As int) As clockviewwrapper.clockviewBuilderWrapper
    • setClockValueDisposition (clockValueDisposition As int) As clockviewwrapper.clockviewBuilderWrapper
    • showDegrees (showDegrees As boolean) As clockviewwrapper.clockviewBuilderWrapper
    • showHoursValues (showHoursValues As boolean) As clockviewwrapper.clockviewBuilderWrapper
    • showBorder (showBorder As boolean) As clockviewwrapper.clockviewBuilderWrapper
    • setHoursValuesColor (hoursValuesColor As int) As clockviewwrapper.clockviewBuilderWrapper
    • setSecondsNeedleColor (secondsNeedleColor As int) As clockviewwrapper.clockviewBuilderWrapper
    • showSecondsProgress (showSecondsProgress As boolean) As clockviewwrapper.clockviewBuilderWrapper
    • build As com.arbelkilani.clock.model.ClockTheme
    • setMinutesNeedleColor (minutesNeedleColor As int) As clockviewwrapper.clockviewBuilderWrapper
    • showCenter (showCenter As boolean) As clockviewwrapper.clockviewBuilderWrapper
    • showSecondsNeedle (showSecondsNeedle As boolean) As clockviewwrapper.clockviewBuilderWrapper
    • setClockDegreeType (clockDegreesType As int) As clockviewwrapper.clockviewBuilderWrapper
    • setHoursNeedleColor (hoursNeedleColor As int) As clockviewwrapper.clockviewBuilderWrapper
  • ClockView
    Fields:
    • DEGREE_TYPE_SQUARE As int
    • DISPOSITION_ALTERNATE As int
    • DEGREE_TYPE_CIRCLE As int
    • DEGREE_STEP_TWELVE As int
    • DISPOSITION_REGULAR As int
    • DEGREE_TYPE_LINE As int
    • DEGREE_STEP_QUARTER As int
    • DEGREE_STEP_FULL As int
    Methods:
    • DesignerCreateView (base As anywheresoftware.b4a.objects.PanelWrapper, lw As anywheresoftware.b4a.objects.LabelWrapper, props As anywheresoftware.b4a.objects.collections.Map) As void
    • IsInitialized As boolean
    • Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String) As void
    • BringToFront As void
    • SetLayout (arg0 As int, arg1 As int, arg2 As int, arg3 As int) As void
    • SendToBack As void
    • SetVisibleAnimated (arg0 As int, arg1 As boolean) As void
    • RemoveView As void
    • Invalidate3 (arg0 As int, arg1 As int, arg2 As int, arg3 As int) As void
    • Invalidate2 (arg0 As android.graphics.Rect) As void
    • SetColorAnimated (arg0 As int, arg1 As int, arg2 As int) As void
    • SetBackgroundImageNew (arg0 As android.graphics.Bitmap) As anywheresoftware.b4a.objects.drawable.BitmapDrawable
    • Invalidate As void
    • SetLayoutAnimated (arg0 As int, arg1 As int, arg2 As int, arg3 As int, arg4 As int) As void
    • RequestFocus As boolean
    Properties:
    • ShowSecondsProgress As boolean [write only]
    • Left As int
    • ClockValueStep As int [write only]
    • Parent As java.lang.Object [read only]
    • BorderColor As int [write only]
    • SecondsProgressFactor As float [write only]
    • HoursNeedleColor As int [write only]
    • ShowCenter As boolean [write only]
    • ClockDegreeStep As int [write only]
    • SecondsNeedleColor As int [write only]
    • HoursProgressColor As int [write only]
    • Visible As boolean
    • Padding As int[]
    • Height As int
    • ShowSecondsNeedle As boolean [write only]
    • Width As int
    • ShowBorder As boolean [write only]
    • HoursValuesColor As int [write only]
    • ClockValueDisposition As int [write only]
    • DegreesColor As int [write only]
    • Background As android.graphics.drawable.Drawable
    • ShowHoursProgress As boolean [write only]
    • Color As int [write only]
    • MinutesNeedleColor As int [write only]
    • MinutesValuesFactor As float [write only]
    • Enabled As boolean
    • CenterOuterColor As int [write only]
    • CenterInnerColor As int [write only]
    • ClockDegreesType As int [write only]
    • Top As int
    • MinutesProgressFactor As float [write only]
    • ShowMinutesValues As boolean [write only]
    • MinutesProgressColor As int [write only]
    • Theme As com.arbelkilani.clock.model.ClockTheme [write only]
    • ShowHoursValues As boolean [write only]
    • Tag As java.lang.Object
    • ShowMinutesProgress As boolean [write only]
    • ClockBackground As int [write only]
    • SecondsProgressColor As int [write only]
    • ClockType As int [write only]
    • ShowDegrees As boolean [write only]

Sample code building the clock via the builder:
B4X:
....
....
Private cv1 As ClockView

Private cv2 As ClockView

Private cv3 As ClockView

Dim cvb As ClockViewBuilder
....
....
....
    '3rd Clock = building it via the Builder
    cv3.Theme = cvb.showHoursValues(True) _
                             .showSecondsNeedle(True) _
                             .showBorder(True) _
                             .showCenter(True) _
                             .centerInnerColor(Colors.Yellow) _
                             .centerOuterColor(Colors.Red) _
                             .borderColor(Colors.DarkGray) _
                             .showSecondsProgress(True) _
                             .secondsProgressColor(Colors.Green) _
                             .setSecondsNeedleColor(Colors.Green) _
                             .setSecondsProgressFactor(0.9f) _
                             .showDegrees(True) _
                             .setHoursNeedleColor(Colors.Yellow) _
                             .setHoursValuesColor(Colors.Yellow) _
                             .showMinutesProgress(True) _
                             .showMinutesValues(True) _
                             .setMinutesNeedleColor(Colors.Magenta) _
                             .minutesProgressColor(Colors.Magenta) _
                             .setMinutesValuesFactor(0.4f) _
                             .setDegreesColor(Colors.Cyan) _
                             .setClockDegreeType(cvb.DEGREE_TYPE_LINE) _
                             .setClockDegreeStep(cvb.DEGREE_STEP_TWELVE) _
                             .setClockValueDisposition(cvb.DISPOSITION_ALTERNATE) _
                             .build

Just change the values in the parameters that are being passed to the builder to make a new clock...
 

Attachments

  • LibRes.zip
    109.4 KB · Views: 248
  • theJavaCode.zip
    19.6 KB · Views: 222
  • b4aLibFiles.zip
    33.9 KB · Views: 250
  • b4aClock.zip
    9.8 KB · Views: 239
Last edited:

Almora

Active Member
Licensed User
Longtime User
very nice..
I did not try but widget and the background is added to the picture?
 

AnandGupta

Expert
Licensed User
Longtime User
I understand Almora means "Does it has widget support ? Can we add background image to the clock ?

Regards,

Anand
 

Johan Schoeman

Expert
Licensed User
Longtime User
I understand Almora means "Does it has widget support ? Can we add background image to the clock ?

Regards,

Anand
There is a method to add a background image but have not investigated and wrapped it. Will look into it when time permits me to do so. Seems to be expecting a Drawable....
 

Johan Schoeman

Expert
Licensed User
Longtime User
I understand Almora means "Does it has widget support ? Can we add background image to the clock ?

Regards,

Anand
Add background image like this....(V1.02)?

1.png


B4X:
#Region  Project Attributes
    #ApplicationLabel: b4aClock
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: False
#End Region

#AdditionalRes: ..\LibRes
#AdditionalJar: com.android.support:support-v4

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private cv1 As ClockView
    Private cv2 As ClockView
    Private cv3 As ClockView
    Dim cvb As ClockViewBuilder
    
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")
    cvb.Initialize
    
    Dim bm1 As Bitmap
    bm1.Initialize(File.DirAssets, "stitch.jpg")
    Dim mbmd As BitmapDrawable
    mbmd.Initialize(bm1)
    cv1.ClockDrawableBackground = mbmd
    
    cv1.BorderColor = Colors.LightGray
    cv1.ShowBorder = True
    
    cv1.ShowSecondsNeedle = True
    cv1.ShowSecondsProgress = True
    cv1.SecondsNeedleColor = Colors.Magenta
    cv1.SecondsProgressColor = Colors.Magenta
    
    cv1.ShowMinutesValues = True
    cv1.ShowMinutesProgress = True
    cv1.MinutesNeedleColor = Colors.Cyan
    cv1.MinutesProgressColor = Colors.Yellow   
    
    cv1.ShowHoursValues = True
    cv1.HoursValuesColor = Colors.Red
    cv1.HoursProgressColor = Colors.Yellow
    cv1.HoursNeedleColor = Colors.Red
    
    cv1.ShowCenter = True
    cv1.CenterOuterColor = Colors.White
    cv1.CenterInnerColor = Colors.Green

    
    cv1.ShowDegrees = True
    cv1.DegreesColor = Colors.Cyan
    
    'this can be cv1.DISPOSITION_ALTERNATE, cv1.DISPOSITION_REGULAR
    cv1.ClockValueDisposition = cv1.DISPOSITION_ALTERNATE
    
    'this can be cv1.DEGREE_TYPE_CIRCLE, cv1.DEGREE_TYPE_LINE, cv1.DEGREE_TYPE_SQUARE
    cv1.ClockDegreesType = cv1.DEGREE_TYPE_CIRCLE
    
    ' this can be cv1.DEGREE_STEP_QUARTER, cv1.DEGREE_STEP_FULL, or cv1.DEGREE_STEP_TWELVE
    cv1.ClockDegreeStep = cv1.DEGREE_STEP_FULL
    

    '2nd clock
    
    Dim bm2 As Bitmap
    bm2.Initialize(File.DirAssets, "b4aimage.png")
    Dim mbmd As BitmapDrawable
    mbmd.Initialize(bm2)
    cv2.ClockDrawableBackground = mbmd
    cv2.BorderColor = Colors.Yellow
    cv2.ShowBorder = True
    
    cv2.ShowSecondsNeedle = True
    cv2.ShowSecondsProgress = True
    cv2.SecondsNeedleColor = Colors.Blue
    cv2.SecondsProgressColor = Colors.Blue
    
    cv2.ShowMinutesValues = True
    cv2.ShowMinutesProgress = True
    cv2.MinutesNeedleColor = Colors.Cyan
    cv2.MinutesProgressColor = Colors.White
    
    cv2.ShowHoursValues = True
    cv2.HoursValuesColor = Colors.Yellow
    cv2.HoursProgressColor = Colors.Red
    cv2.HoursNeedleColor = Colors.Yellow
    
    cv2.ShowCenter = True
    cv2.CenterOuterColor = Colors.Green
    cv2.CenterInnerColor = Colors.White

    
    cv2.ShowDegrees = True
    cv2.DegreesColor = Colors.Red
    
    'this can be cv2.DISPOSITION_ALTERNATE, cv2.DISPOSITION_REGULAR
    cv2.ClockValueDisposition = cv2.DISPOSITION_REGULAR
    
    'this can be cv2.DEGREE_TYPE_CIRCLE, cv2.DEGREE_TYPE_LINE, cv2.DEGREE_TYPE_SQUARE
    cv2.ClockDegreesType = cv2.DEGREE_TYPE_LINE
    
    ' this can be cv2.DEGREE_STEP_QUARTER, cv2.DEGREE_STEP_FULL, or cv2.DEGREE_STEP_TWELVE
    cv2.ClockDegreeStep = cv2.DEGREE_STEP_QUARTER


    '3rd Clock = building it via the Builder
    
    Dim bm3 As Bitmap
    bm3.Initialize(File.DirAssets, "android.png")
    Dim mbmd As BitmapDrawable
    mbmd.Initialize(bm3)
    cv3.Theme = cvb.showHoursValues(True) _
                    .showSecondsNeedle(True) _
                    .showBorder(True) _
                    .showCenter(True) _
                    .centerInnerColor(Colors.Yellow) _
                    .centerOuterColor(Colors.Red) _
                    .borderColor(Colors.DarkGray) _
                    .showSecondsProgress(True) _
                    .secondsProgressColor(Colors.Green) _
                    .setSecondsNeedleColor(Colors.Green) _
                    .setSecondsProgressFactor(0.9f) _
                    .showDegrees(True) _
                    .setHoursNeedleColor(Colors.Yellow) _
                    .setHoursValuesColor(Colors.Yellow) _
                    .showMinutesProgress(True) _
                    .showMinutesValues(True) _
                    .setMinutesNeedleColor(Colors.Magenta) _
                    .minutesProgressColor(Colors.Magenta) _
                    .setMinutesValuesFactor(0.4f) _
                    .setDegreesColor(Colors.Cyan) _
                    .setClockDegreeType(cvb.DEGREE_TYPE_LINE) _
                    .setClockDegreeStep(cvb.DEGREE_STEP_TWELVE) _
                    .setClockValueDisposition(cvb.DISPOSITION_ALTERNATE) _
                    .setClockDrawableBackground(mbmd) _
                    .build
    
    
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

See post #1 for LibRes and what to do with it - download it from post #1.
 

Attachments

  • b4aClock.zip
    99.7 KB · Views: 240
  • ClockB4AlibFiles_V1.02.zip
    34.2 KB · Views: 239

Albert Kallal

Active Member
Licensed User
Ok, I attempting to give this a try.
Steps 1, and 4 – they make sense.

1)
Unzip the b4aClock.zip.

4)
Unzip the LibRes.zip. Add files to my libraries folder.

Up to this point, so far so good.

Now step 2 –
2. LibRes.zip - extract it and copy the LibRes folder with its contents to be on the same folder level as that of the /Objects and /Files folders of the B4A project.

I assume we copy these files into the b4a project folder? I currently have this:

1608463641787.png

quite sure I am copy LibRes into the project.

But what I don’t understand, is step 3?

3 – The java code (library and wrapper) – change it to your liking.

I not sure what changes are to be made to allow this to run?
Am I to re-build these files based on the code in the source Java files?

So, with steps 1,2, and 4. The project does compile.

I get this:
1608463878988.png


To me, it not so much I can’t get this sample to work, but WORSE is I don’t know the next trouble shooting step (that is my shortcoming – but it IS a area that I have to “seriously” step my game up!!). In the new year – more time shall be spent with B4A and consuming js libraries!

Anyway – can someone explain what the steps are in regards to the res files? (or direct me to some reading).

The manifest shows the platform at SDK 26 - and I do see a warning.

Any pointers or help is approached here. I actually "more" interested in what steps required to troubleshoot this?
(open to reading more on this subject).

(on B4A 10.2).

Regards,
Albert D. Kallal
Edmonton, Alberta Canada
 

Johan Schoeman

Expert
Licensed User
Longtime User
You don't have to do anything with the Java code. Only posted it in case someone wants to modify the library and recompile it into a new jar and xml. Have just tested it again on my device and all working fine. What is inside your Files folder?

1608465953025.png
 

Johan Schoeman

Expert
Licensed User
Longtime User
invalid resource directory name: ..\libres font
Read post #1 - it tells you what to do with LibRes.zip once you have downloaded it and extracted it from the zipped file.
 

Johan Schoeman

Expert
Licensed User
Longtime User

amidgeha

Active Member
Licensed User
Longtime User
Yes, the font directory contains 2 otf files
the values directory contains 2 files attrs.xml and strings.xml
 

amidgeha

Active Member
Licensed User
Longtime User
Please copy and post the error from the B4A log when you compile the B4A project
B4A Version: 10.2
Java Version: 11
Parsing code. (0.01s)
Building folders structure. (0.01s)
Compiling code. (0.01s)

ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. Error
invalid resource directory name: ..\libres font
 

Johan Schoeman

Expert
Licensed User
Longtime User
B4A Version: 10.2
Java Version: 11
Parsing code. (0.01s)
Building folders structure. (0.01s)
Compiling code. (0.01s)

ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. Error
invalid resource directory name: ..\libres font

What I see when I compile the B4A project

B4X:
B4A Version: 10.2
Java Version: 8
Parsing code.    (0.00s)
Building folders structure.    (0.06s)
Compiling code.    (0.04s)
Compiling layouts code.    (0.01s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Generating R file.    (0.00s)
Compiling generated Java code.    (0.03s)
Convert byte code - optimized dex.    (2.43s)
Packaging files.    (1.11s)
Copying libraries resources    (0.00s)
Signing package file (debug key).    (1.46s)
ZipAlign file.    (0.06s)
Installing file to device.    (6.69s)
    Device serial: RF8M70NF4RL
Completed successfully.

Have no idea why you get the error. Maybe @Erel can assist with this
 
Top