Barn Owl

Barn Owl in Glen Canyon Park, San Francisco

SONY DSC-RX10M4 220mm f4.0 1/100s ISO6400

A Barn Owl hunting in Glen Canyon Park, San Francisco on Christmas Eve 2021.

(Previously: Great Horned Owlets)

Add your comment...

Related Posts

(Recent Photos)

(Published to the Fediverse as: Barn Owl #photo #owl Photo of a Barn Owl hunting in Glen Canyon Park, San Francisco, California. )

The Secret Diary of a Xamarin Android Developer, Aged 48 1/3

WallpaperColors

I have been trying to update Catfood Earth for Android to support Material You in Android 12. This sets a color palette from your wallpaper and other than making notifications harder to manage seems to be the main thing that Google has been working on for the past year. Live wallpaper isn't automatically supported, it's up to you to tell the system about your colors.

Happily there is an overridable OnComputeColors in WallpaperService.Engine, and you can create a WallpaperColors object from a bitmap so this looked like a five minute update. Hahahahahahhahahahah.

I spent a few weeks waiting for the Android 12 SDK to be available in Xamarin. I found some pointers to their GitHub and assumed it would show up there and so waited a few weeks. It still isn't there. I found some article about forcing it to install in Visual Studio 2019 that didn't work for me, and then realized that Visual Studio 2019 update checks were crashing. While trying to fix that I found that Visual Studio 2022 has been released and this installs with the Android 12 SDK!

These days I work on side projects when I get the occasional free hour. Almost inevitably that hour is consumed with updating two or three things and then hoping that the next time I get some time at least I'll be ready to go. But when that hour arrives I'm back to updating again.

So finally I have the right SDK and drop in an OnComputeColors and a call to NotifyColorsChanged when my wallpaper is updated. Time to start testing. The good news is that Material You is now working with Catfood Earth selected as the current wallpaper. The bad news is that every time I call NotifyColorsChanged the launcher disappears and I'm just left with the wallpaper and no icons or search box. Probably not a good experience. I try moving the NotifyColorsChanged call around to different points in code and it makes no difference. This simple update is rapidly spiraling from minutes to days to weeks.

Maybe it's some Xamarin bug, or something in Android 12 or maybe a change in the solemn contract between live wallpaper services and the rest of the system. Can't find any hint of any of this on the Internet.

It's also possible that the bitmap I'm passing is too large or too complex or too something else. So let's try just sending back a simple WallpaperColors in OnComputeColors and see if that helps.

The Android documentation for WallpaperColors suggests that you can construct it from three colors which seems sensible. The Xamarin implementation takes ColorObject instead of Color. What is a ColorObject? The sparse Xamarin documentation suggests that it has an empty constructor that creates an opaque black color and then properties like Red that are read only. So an immutable black? That can't be right? When constructing a color the constructor would seem like a great place to tell the class what color it is. Failing that, a FromColor or FromArgb would seem to follow the right sort of convention. But no. You need to find ValueOf. To create a color that is a class and not a value. Sigh. Maybe that is some kind of deep Android convention that I would just know if I did this more often than once a year or so.

Although, maybe most Google Developers can't figure out how to make a non-black color and that's the origin of Material Design 2. Everything else is just marketing rationalization on top of a terrible API.

Finally I have a simple WallpaperColors to test with but my build has broken. At some point while figuring out how to get a ColorObject that isn't black I thought a NuGet package would help. My project is now completely broken. My experience with touching NuGet is that you can either spend several days unpicking the carnage or just start over. Git reset --hard  HEAD it is then.

After quickly reimplementing the changes so far, returning a vanilla WallpaperColors object works... and so does the FromBitmap version. So 90% chance that I bodged something subtle the first time and didn't make the mistake on the second pass. 10% chance it was something strange in Visual Studio.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: The Secret Diary of a Xamarin Android Developer, Aged 48 1/3 #code #android #xamarin #catfood #earth An adventure in persuading Android live wallpaper to support Material You colors via the magic of Xamarin and weeks of frustration. )

Winter Solstice 2021

Winter Solstice 2021

Winter Solstice 2021 rendered in Catfood Earth (15:59 UTC, December 21, 2021). Winter begins in the northern hemisphere, summer if you happen to be south of the equator.

(Previously: Winter Solstice 2020)

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Winter Solstice 2021 #code #winter #solstice #catfood #earth The moment of Winter Solstice 2021 (15:59 UTC December 21, 2021) rendered in Catfood Earth. )

Creekside Trail to Big Leaf Trail Loop

Updated on Saturday, February 19, 2022

Awesome trees along Creekside Trial in Shiloh Ranch Regional Park.

Pond as seen from Pond Trail in Shiloh Ranch Regional Park.

Missing tile in Google Earth reveals the stars below Sonomoa.

3.8 mile loop with 600 foot elevation gain in Shiloh Ranch Regional Park near Santa Rosa in Sonoma County.

This is the first time my Pixel 4 XL GPS has failed me. Sometimes it wanders a little off trail, but this time it took a completely unauthorized trip to a Home Depot before eventually snapping back to reality. I've included it here but unlike any other track I've uploaded you might not want to use this one (see the route on AllTrails instead, distance incorrect below). The really strange thing is that when I look at the trail in Google Earth there is a missing tile around where the GPS freaks out and Google Earth sends the route plunging down into outer space (because it's clamping to its elevation model but the stars under Sonoma are not as far away as they look?) See the screenshot above. Something is odd at Shiloh Ranch...

Hike starts at: 38.525412, -122.762561. View in Google Earth.

Add your comment...

Related Posts

(Hike Map)

(Published to the Fediverse as: Creekside Trail to Big Leaf Trail Loop #hike #hikevid #map #video 3.8 mile loop in Shiloh Ranch Regional Park, Sonoma, California. This hike includes a GPS failure and a suspicious missing tile in Google Maps that shows the stars below Sonoma. )

Barker Dam and Wall Street Mill

Barker Dam and Wall Street Mill

Barker Dam and Wall Street Mill

Double feature in Joshua Tree National Park. Barker Dam is just over a mile, a short loop that takes in rock art, the dam, and a nice mix of boulders and desert. Wall Street Mill is two miles out and back and the mill extracted gold to send to the US Mint in San Francisco.

Hike starts at: 34.025005, -116.142098. View in Google Earth.

Add your comment...

Related Posts

(Hike Map)

(Published to the Fediverse as: Barker Dam and Wall Street Mill #hike #map #joshua wo hikes from the same parking lot in Joshua Tree National Park, a one mile loop (Barker Dam) and a two mile out and back (Wall Street Mill). )

Ladder Canyon and Painted Canyon

Ladder Canyon and Painted Canyon

Ladder Canyon and Painted Canyon

Amazing 4.5 mile hike in the Mecca Hills Wilderness in Riverside County, California. You ascend a slot canyon with ladders of various difficulty helping you up and down along the way. There is a sunny section on a ridge at the top with views back to the Salton Sea and then you return along the wash at the bottom of Painted Canyon. A must do hike if you can handle a few ladders and are in the area.

Hike starts at: 33.618781, -115.99902. View in Google Earth.

Add your comment...

Related Posts

(Hike Map)

(Published to the Fediverse as: Ladder Canyon and Painted Canyon #hike #ladders #canyon #map 4.5 mile loop hike that includes ladders and canyons in Riverside County, California. )

Teddybear Cholla

Teddybear Cholla

SONY ILCE-7C 40mm f22.0 1/40s ISO125

Photo of the Teddybear Cholla garden in Joshua Tree National Park.

Add your comment...

Related Posts

(Recent Photos)

(Published to the Fediverse as: Teddybear Cholla #photo #joshua #cholla Teddybear Cholla photographed at sunset in Joshua Tree National Park. )

Sawmill Flats

Updated on Saturday, February 19, 2022

Large boulders in Mount San Jacinto State Park

Bobcat seen at Mount San Jacinto State Park

Four and a half mile hike from Stone Creek Campground in Mount San Jacinto State Park to the ruins of a sawmill and back again. The mill is hidden but watch out for a yellow sign off the trail.

The campground was closed for the season when we arrived and a permit is required. We phoned the ranger station who said the trail was off limits and to come get a permit and discuss other hikes. After much discussion it turned out the concern was illegal parking near the campground and after promising to find legal parking and walk in we were allowed to complete the hike.

I don't have a GPS track for this one. Usually I download a GPX to Gaia GPS on my phone and use this to follow the trail. Traveling without a laptop I tried to do this from the AllTrails mobile app which wanted a paid upgrade. I have used AllTrails a fair bit so was happy to pay, but even after upgrading you can only download locally to AllTrails, the mobile app won't allow you to generate a GPX. I understand the commercial desire to lock people into their app, but I have used Gaia GPS for years an trust it to not drain my battery or otherwise cause problems when off the beaten track. AllTrails also won't let you copy and paste from hike descriptions (even ones with a long URL to check for road closures in them), and you can't export the route you took either (which I do from Gaia GPS to generate maps and elevation profiles for this blog). So I'll be cancelling that AllTrails subscription and have learned to get an export from a laptop and ignore the mobile app.

Saw a bobcat which is a first. Probably due to the trail being closed and quiet.

Add your comment...

Related Posts

(Hike Map)

(Published to the Fediverse as: Sawmill Flats #hike #bobcat #jacinto #video Four and a half mile out and back hike to the ruins of a sawmill in Mount San Jacinto State Park near Idyllwild, California. Starts at 6,000 feet with around 800 gain. Trailhead at Stone Creek Campground. )

Book reviews for November 2021

The Dark Hours (Renée Ballard, #4; Harry Bosch Universe, #35) by Michael Connelly

The Dark Hours (Renée Ballard, #4; Harry Bosch Universe, #35) by Michael Connelly

4/5

 

Invisible Sun (Empire Games #3) by Charles Stross

Invisible Sun (Empire Games #3) by Charles Stross

4/5

 

Better off Dead (Jack Reacher, #26) by Lee Child

Better off Dead (Jack Reacher, #26) by Lee Child

3/5

 

First Person Singular: Stories by Haruki Murakami

First Person Singular: Stories by Haruki Murakami

4/5

 

Homeland Elegies by Ayad Akhtar

Homeland Elegies by Ayad Akhtar

5/5

 

Add your comment...

Related Posts

(All Reviews)

Links for November 2021