android detect if night
<p>Is there a better way than this?</p>

<pre><code>Boolean isNight;
Calendar cal = Calendar.getInstance();
int hour = cal.get(Calendar.HOUR_OF_DAY);
if(hour &lt; 6 || hour &gt; 18){
    isNight = true;
} else {
    isNight = false;
}
</code></pre>

<p>It just checks if hour is between 7pm and 5am.  Is there any other way to do this?</p>
