简体   繁体   English

是否可以在没有位置或光传感器的情况下在 android 中获得日出/日落?

[英]Is it possible to get sunrise/sunset in android WITHOUT location or the light sensor?

I want to know aproximately when is light and when is dark WITHOUT relying on gps, location or the light sensor of the device.我想知道什么时候亮什么时候暗,而不依赖于 gps、位置或设备的光传感器。 Is it possible?可能吗? Thanks for the help.谢谢您的帮助。

well, you must know at least coarse location of user, sunrise/sunset time is different in center of north pole and equator, isn't it?好吧,您至少必须知道用户的粗略位置,北极和赤道中心的日出/日落时间不同,不是吗?

on Android you can get approximate location with在 Android 上,您可以获得大致位置

Locale.getDefault().getCountry()

or或者

Locale.getDefault().getLanguage()

some wiki explanation how to calculate sunrise一些维基解释如何计算日出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM