B4A Library Astro library

RUNO

Active Member
Licensed User
Longtime User
Hi all , this library for moon only or moon and sun.
I used it but values does not apply to reality .
 

derez

Expert
Licensed User
Longtime User
It is written in the first post:
The library provides the times of Sunrise, Sunset, Moon rise and Moon set, according to place and date.
It also provides the phase of the moon (equivalent to the day of the moon month).
If you have problems - show your code and we'll help.
 

RUNO

Active Member
Licensed User
Longtime User
Thank you derez
I used example from forum but values not correct with my location. .
 

RUNO

Active Member
Licensed User
Longtime User
Hi
I used astrolib demo with changes location value but old results are still, can you help me ?
 

derez

Expert
Licensed User
Longtime User
I am willing to help you but I can't without seeing the code and values you use to get the results.
 

Del

Member
Licensed User
Longtime User
Derez

This is a great library and very useful.

However note that you get :-
java.text.ParseException: Unparseable date: "01/01/1900" (at offset 2)
if you have previously set DateTime.DateFormat to "HH:mm"

Obvious really but confusing !

Regards

Del
 

derez

Expert
Licensed User
Longtime User
if you have previously set DateTime.DateFormat to "HH:mm"
I'm not sure I get the comment. What you show is time format, not date format.
 

RUNO

Active Member
Licensed User
Longtime User
Derez
I used this library , but need some value like lat ,lon from my location.
If I used GPS ,how I get this value?
How I get my city from app ? any library to do that.
I need answers for this questions , please.
 

RUNO

Active Member
Licensed User
Longtime User
I used before in my app to determine location but didn't give me value for Lat or Lon .
after that I put my location value in code not GPS .
 

RosarioAR

Member
Licensed User
Longtime User
Hi, i have tried the lib with the next code:
B4X:
Dim sunA As Astro
Dim result() As String
   
result=sunA.Sun(26,6,2016,32,-60,-3)
Log(result(0))
Log(result(1))
The result obtained is:
SunRise= 05:56
SunSet= 20:10

I am in Argentine (Lat=32, Long=-60, DST=-3), and today the correct Sunrise/Sunset is 08:06/18:05 aprox.

What am I doing wrong?

Thanks
Regards
 

derez

Expert
Licensed User
Longtime User
The Lat should also be negative -32 since you are in southern latitude.
I get 08:01 and 18:05
 
Last edited:

Emerito

Active Member
Licensed User
Longtime User

Derez, can this library be used freely?
 

derez

Expert
Licensed User
Longtime User
I have checked and also found wrong results (in elevation, azimuth looks ok). I'll check.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…