question about making an App for Android

Chris Angelico rosuav at gmail.com
Thu Oct 10 18:49:03 EDT 2019


On Fri, Oct 11, 2019 at 9:41 AM Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
>
> On Thu, 10 Oct 2019 08:47:07 -0700, pyotr filipivich <phamp at mindspring.com>
> declaimed the following:
>
>
> >"A simple program" to divide the amount of "today's" daylight into 12
> >even '"hours", so that Dawn begins the First hour, the third hour is
> >mid-morning, noon is the middle of the day, the ninth hour mid after
> >noon, and the twelfth hour ends at sunset.  Is simple, no?  {no.}
> >
>         Even ignoring "phone" this is anything but simple. It relies upon
> knowing one's latitude and date to allow computing the angle of the sun.
> And you'll need to handle the fact that above/below arctic/antarctic
> circles you will run into "zeros" where there is either 24 hours of
> daylight or 24 hours of night.
>

Or.... maybe it's really simple, because there's an HTTP API that
gives you the information. There's an API for everything these days. A
quick web search showed up this:

https://sunrise-sunset.org/api

Which means the project is a matter of taking the data and formatting
it. (Also probably getting lat/long from the phone's location API.)
I'd say this is a good-fun project - a one-week project for a student,
a weekend project for an expert. And yes, there WILL be edge cases to
deal with, but for the most part, it shouldn't be too hard.

ChrisA



More information about the Python-list mailing list