Copying and pasting from and to the system clipboard. Assuming text and/or html content.
Read more…All snippets tagged with java
Page 3 of 3Using the clipboard
Camera2 implementation in an extendable Fragment
If you’re going to add a custom camera to your app, use these snippets to do it right. This recipe uses the Camera2 APIs, and hides all the weird code required for setting up a viewfinder and taking pictures.
Read more…Barcode scanner using Google Vision
The implementation of the Google Vision api is not that hard, but there are a few fixes you’ll need to make your app production ready. Most importantly: the default implementation does not support autofocus which makes it very hard to scan a barcode.
Read more…Vibration and haptic feedback
For haptic feedback on button touches:
Read more…Showing notifications
Simple snippet for showing a notification. Tweak where needed.
Read more…FragmentActivity
This recipe is outdated! We’ll keep it for now, because it might be useful when maintaining old apps, but the
new prefered way is to use a FragmentContainerView
instead.