B4A Library [B4X] [XUI] AS Scheduler ? - MonthView, DayView (Week), AgendaView and CalendarView [Payware]

vfafou

Well-Known Member
Licensed User
Longtime User
Hello!
I would like to ask if it's possible to use the Scheduler with an external database or even better with jRDC.
 

Alexander Stolte

Expert
Licensed User
Longtime User
I would like to ask if it's possible to use the Scheduler with an external database or even better with jRDC.
Just synchronize the data. The scheduler has a built-in sqlite database, there are certainly some tutorials in the forum on how to use jRDC together with a sqlite database.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 3.13
    • DayView
      • BugFixes and Improvements
New thread about the DayView features
 

MarcoRome

Expert
Licensed User
Longtime User
I developed using ASScheduler_DayView in B4J.
On Windows everything works without problems.
On Mac (I tried on 2 real and not virtual Macs) there is the following problem.

When you compile and test the program with run.command with Macsigner 102 everything works.

When you create the package, so you get a single file, after opening the app, if you try to open the activity where the calendar is present, the app closes when it loads the layout containing the ASScheduler_DayView object.
If I delete the ASScheduler_DayView1 object from the layout everything works.

The doubt I have about the crash is the following:
Since using run.command everything works, and on the package file it doesn't, could it be that somewhere the ASScheduler_DayView library calls like File.DirApp or similar ?
Are there other files they use that are copied into some directory?
I say this because I noticed in other cases that using the File.DirApp directory on the package file went into error and I solved it by using File.DirTemp (for example when I exported an Excel file).

Thank you
 

Alexander Stolte

Expert
Licensed User
Longtime User
ASScheduler_DayView library calls like File.DirApp or similar ?
The SchedulerInternShared Modul is calling this:
B4X:
#If B4J
    SQL.InitializeSQLite(File.DirApp,"scheduler.db",True)
#Else
    SQL.Initialize(xui.DefaultFolder,"scheduler.db",True)
#End If
Nothing else is done in the date view as in the other views
 

MarcoRome

Expert
Licensed User
Longtime User
In which module is this code present ?
So add the following code and try

B4X:
#If B4J
        If DetectOS = "windows" Then
            SQL.InitializeSQLite(File.DirApp,"scheduler.db",True)
        Else
            SQL.InitializeSQLite(File.DirTemp,"scheduler.db",True)
        End If
#Else
    SQL.Initialize(xui.DefaultFolder,"scheduler.db",True)
#End If

Sub DetectOS As String
    Dim os As String = GetSystemProperty("os.name", "").ToLowerCase
    If os.Contains("win") Then
        Return "windows"
    Else If os.Contains("mac") Then
        Return "mac"
    Else
        Return "linux"
    End If
End Sub

Although I still have the doubt whether the db file is stored inside the Temp directory (but we'll see this later)
 

Alexander Stolte

Expert
Licensed User
Longtime User

MarcoRome

Expert
Licensed User
Longtime User
But then it will be deleted and then I don't need a database, then I could have done everything with hash maps ?

as i said above: "...Although I still have the doubt whether the db file is stored inside the Temp directory (but we'll see this later)..."

I tried it and this is how it works.

Now the question is... in which directory can we insert the db so that it is not deleted, given that File.DirApp is to be excluded ?

 

Alexander Stolte

Expert
Licensed User
Longtime User
Now the question is... in which directory can we insert the db so that it is not deleted, given that File.DirApp is to be excluded ?
Sounds like a question that should be on a seperate thread, it seems to be a problem with File.DirApp on macbooks.
 

MarcoRome

Expert
Licensed User
Longtime User
Hi dear @Alexander Stolte.
I solved it this way. If you want you can add it to the fix.
The solution could be good for everyone (windows, mac, linux). But I would leave it like this to make it compatible with programs already in production.
In this way the file will be copied into a (non-temporary) directory which will have the name of the package.
Thank you again for this fantastic library.

B4X:
Public Sub Initialize
    If isIni = False Then
        isIni = True
    #If B4J
    If DetectOS = "windows" Then
        SQL.InitializeSQLite(File.DirApp,"scheduler.db",True)
    else
        Dim namepack As String
        Dim SystemProperty As Map = GetSystemProp
        For Each Key As String In SystemProperty.Keys
            If Key = "sun.java.command" Then
                'Log(SystemProperty.Get(Key))
                namepack = SystemProperty.Get(Key)
            End If
        Next
    
        namepack = namepack.Replace(".","")
    
        xui.SetDataFolder(namepack)
        SQL.InitializeSQLite(xui.DefaultFolder,"scheduler.db",True)
    end if
    #Else
        SQL.Initialize(xui.DefaultFolder,"scheduler.db",True)
    #End If
    
    End If
End Sub


#If B4J
'https://www.b4x.com/android/forum/threads/getscreenposition.50011/#content
Public Sub GetScreenPosition(n As Node) As Map
   ......
End Sub

Sub DetectOS As String
    Dim os As String = GetSystemProperty("os.name", "").ToLowerCase
    If os.Contains("win") Then
        Return "windows"
    Else If os.Contains("mac") Then
        Return "mac"
    Else
        Return "linux"
    End If
End Sub

Sub GetSystemProp As Map
    Dim jo As JavaObject
    jo.InitializeStatic("java.lang.System")
    Dim Prop As Map = jo.RunMethod("getProperties", Null)
    Return Prop
End Sub
#End If
 

Alexander Stolte

Expert
Licensed User
Longtime User
But I would leave it like this to make it compatible with programs already in production.
There will be no one but you who runs this lib. poductively on MacOS or Linux. Otherwise someone would have already noticed. Thanks for the solution, I will include it in the next update
 

MarcoRome

Expert
Licensed User
Longtime User
There will be no one but you who runs this lib. poductively on MacOS or Linux. Otherwise someone would have already noticed. Thanks for the solution, I will include it in the next update
Someone always notices first . It can happen and your fantastic library will not have problems even on these systems.
Thank you dear ?
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 3.15
    • DayView
      • Add Event CustomDrawAppointment
      • BugFix on 12h Time System
    • MonthView
      • Add Event CustomDrawAppointment
    • AgendaView
      • Add Event CustomDrawAppointment
Event CustomDrawAppointment
This event opens up completely new possibilities.
The event allows you to completely customize and change the appearance of an appointment.

e.g.
-Change the text color to match the background color of the appointment
-Add an icon
-Background images
 

Alexander Stolte

Expert
Licensed User
Longtime User
Could you share a complete example?
Just set in the designer the property "Scheduler Function" to "HeatMap" and add your appointments.
But yes, I can still make a tutorial, like with the DayView about all functions.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 3.16
    • MonthView
      • B4A BugFix
New Example
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…