Skip to main content

Participated in Potatotips #38 in Blog Coverage

This article was translated from Japanese by Claude Code.

I participated in Potatotips #38 (iOS/Android Development Tips Sharing) in the blog coverage slot. This article summarizes the Android presentations.

Venue @ Origami, Inc.
#

The event was held at Origami, Inc.’s office in Minami-Aoyama. Origami - Smart Payment

Summary of Android Presentation Session
#

Below is a summary of the Android presentation session.

Keisuke Kobayashi - Practical Implementation of Up Navigation
#

This was a presentation about controlling the behavior when pressing the Up button (back arrow in the top-left) on an app’s detail screen. For simple apps, just calling finish() might work, but in cases like:

  • When transitioning to a detail screen from search results
  • When launching a detail screen from a DeepLink

In these cases, rather than simply closing the app, you’d want to navigate to the parent screen of the detail screen. A solution presented was keeping track of the originating Activity and using the SINGLE_TOP flag to avoid recreating the Activity. Check out the article below for details:

NavUtils#navigateUpFromSameTask also appears.

NavUtils itself was new to me, and since I’m planning to work with Up button controls in the coming work, I’ll read the documentation and think through the implementation.

r21nomi - Let’s Make Photo Frame with Android Things
#

A presentation about creating a photo frame that displays pinned Pinterest images using Android Things, which allows you to build Android apps for Raspberry Pi and Edison devices.

When trying to obtain access tokens from Android Things to use the Pinterest API, the app would crash due to an SDK bug when trying to fire intents or launch WebView to get tokens. The solution was to use a custom smartphone app to perform Pinterest OAuth authentication, then sync the tokens to Android Things using Firebase Realtime Database.

I haven’t touched Android Things yet, but I’m interested. Maybe I’ll make something. (SDK is scary, and apparently animation-related stuff is a bit tricky.)

Source code is available at r21nomi/pin-board: pin-board is Pinterest client for Android.

androhi - ConstraintLayout Refresher
#

A presentation about getting reacquainted with ConstraintLayout. ConstraintLayout (an awesome version of RelativeLayout) has been released up to version 1.0.2 and feels stable. With the new Layout Editor, you can adjust Views and set constraints visually. You can now decide View sizes using aspect ratios, and implement Views linked together like a chain. It also seems Android Studio 2.3 has new templates.

I haven’t worked much with ConstraintLayout either, so I plan to play around with samples first.

pside - About MediaSession
#

MediaSession Talk - Google Slides

A presentation about using MediaSession instead of custom implementations when creating media playback apps.

By using MediaSessionCompat and PlaybackStateCompat, you can control states like paused, playing, fast-forward capable, rewind capable, etc. Also, Google’s sample code seems quite helpful. When specifying the State to control, you set it with a Builder, and by specifying appropriate values for the setActions method, you receive the correct Callback. (Conversely, if you don’t specify it correctly, you’ll get stuck.)

I’ve never made a media playback app, so I learned a lot from all the new information.

Once you understand it, it’s simple, but it took a significant amount of time to get to that point.

I think this is an “Android thing” beyond just media playback, so I’ll continue improving! (`・ω・´)ゞ

The presentation content is based on I/O 2016: Best Practices in Media Playback on Android // Speaker Deck.

Bonus
#

The food and office were both very stylish ლ(´ڡ`ლ)