### Initialize SunriseSunsetCalculator in Java Source: https://github.com/mikereedell/sunrisesunsetlib-java/blob/master/README.markdown Demonstrates how to create an instance of SunriseSunsetCalculator in Java, requiring a Location object with latitude and longitude, and a time zone identifier. ```Java Location location = new Location("39.9522222", "-75.1641667"); SunriseSunsetCalculator calculator = new SunriseSunsetCalculator(location, "America/New_York"); ``` -------------------------------- ### Add Gradle Dependency for SunriseSunsetLib Source: https://github.com/mikereedell/sunrisesunsetlib-java/blob/master/README.markdown Instructions to add the SunriseSunsetLib library as a dependency to a Gradle project by configuring the mavenCentral repository and adding the compile dependency in the build.gradle file. ```Groovy repositories { mavenCentral() } dependencies { compile 'com.luckycatlabs:SunriseSunsetCalculator:1.2' } ``` -------------------------------- ### Add Maven Dependency for SunriseSunsetLib Source: https://github.com/mikereedell/sunrisesunsetlib-java/blob/master/README.markdown Instructions to add the SunriseSunsetLib library as a dependency to a Maven project by including the specified groupId, artifactId, and version in the pom.xml file. ```XML com.luckycatlabs SunriseSunsetCalculator 1.2 ``` -------------------------------- ### Calculate Sunrise and Sunset Times in Java Source: https://github.com/mikereedell/sunrisesunsetlib-java/blob/master/README.markdown Shows how to use the initialized SunriseSunsetCalculator to retrieve official sunrise and sunset times for a given date, returning results as String or Calendar objects. ```Java String officialSunrise = calculator.getOfficialSunriseForDate(Calendar.getInstance()); Calendar officialSunset = calculator.getOfficialSunsetCalendarForDate(Calendar.getInstance()); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.