B4J Code Snippet Hebrew calendar

ilan

Expert
Licensed User
Longtime User
hi @BeneBarros

i am just trying your class and the GetParshaX function returns "Error"
if i use it on Android emulator it returns the correct parasha but on b4j (pc), b4a (physical device) and b4i (physical device) i always get "Error"

what could be the reason that only on the android emulator it works and not on a physical device?

thanks
 

BeneBarros

Active Member
Licensed User
Longtime User
Good morning... I'll check
 

ilan

Expert
Licensed User
Longtime User
according to b4x installation guide we shale use jdk 14




is there any possibility to make it run also on jdk 14?

thank you
 

BeneBarros

Active Member
Licensed User
Longtime User
It's quite possible that it's the special characters that are causing the problem... try using Default Font
 

ilan

Expert
Licensed User
Longtime User
just for information.
if i run it on android emulator it is working fine only if it is a physical device it is not working. no change are made. the program runs fine on emulator but not on real device.
 

ilan

Expert
Licensed User
Longtime User
do you have any idea why it is not working for me?
i tested on 2 physical (b4a+b4i) devices and on 2 different pc (b4j)
 

BeneBarros

Active Member
Licensed User
Longtime User
do you have any idea why it is not working for me?
i tested on 2 physical (b4a+b4i) devices and on 2 different pc (b4j)
I can't even imagine.... you would have to test the sources you are using so that you can detect the error.
 

BeneBarros

Active Member
Licensed User
Longtime User
Try uncommenting line 776 Log(nParshaNumber), to see what number it is generating.... It cannot be greater than 64
 

ilan

Expert
Licensed User
Longtime User
Strange... in your example the "Today" field is different from "HebtoGreg"
you are right. setting the timezone solves the problem.
i am running your example but i add this line before the DateTime.DateFormat line


B4X:
MainForm = Form1
    MainForm.SetFormStyle("UNIFIED")
    'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    MainForm.Title = "Hebrew calendar"
    HG.Initialize
    DateTime.SetTimeZone(3) '<-----
    DateTime.DateFormat = "MM/dd/yyyy"
    Dim dtNow As String = DateTime.Date(DateTime.Now)
    '...'

and now it is working fine

 

ilan

Expert
Licensed User
Longtime User
in the hebcal class i add the settimeone in the initialize event and it is working fine

B4X:
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
    DateTime.SetTimeZone(DateTime.TimeZoneOffset) '<---
    DateTime.DateFormat = "MM/dd/yyyy"
    '1488 +
'    AlphaH = Array As String("Alef", "Bet", "Guimel", "Dalet", "He", "Vav", "Zayin", "Het", "Tet", "Yod", _
'    "Kaf_End", "Kaf", "Lamed", "Mem_End", "Mem", "Nun_End", "Nun", "Samekh", "Ayin", "Pe_End", "Pe", _
'    "Tsade_End", "Tsade", "Qoph", "Resh", "Shin", "Tav")
    Alpha = "ABGDHVZJTYcCLmMnNSIpPqQKRWX"
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…