Documentation
¶
Overview ¶
Package mobile reaches the Android services Gio doesn't expose - the system share sheet and the activity lifecycle - through a small Java helper (mobile_android.java, shipped as mobile_android.jar, which gogio packs into the APK). Elsewhere its functions report ErrUnsupported.
It takes the JVM, Android context and view as plain handles rather than importing gioui.org/app, so it type-checks without the NDK.
Index ¶
- Variables
- func ClipboardImageURI(vm, ctx uintptr) (string, error)
- func Dictate(vm, ctx, view uintptr, lang string) (int, <-chan Speech, error)
- func FileURI(vm, ctx uintptr, path, mime string) (string, error)
- func Haptic(vm, ctx, view uintptr, c int) error
- func KeepAliveDeclared(vm, ctx uintptr) (bool, error)
- func KeepScreenOn(vm, ctx, view uintptr, on bool) error
- func ListenShares(vm, ctx uintptr, handler func(Shared)) error
- func NotificationsEnabled(vm, ctx uintptr) (bool, error)
- func OpenCustomTab(vm, ctx, view uintptr, url string) error
- func OpenDownloads(vm, ctx, view uintptr) error
- func OpenURL(vm, ctx, view uintptr, url string) error
- func PickDocuments(vm, ctx, view uintptr, mimes []string, multiple bool, limit int, media bool) (<-chan Documents, error)
- func PickPhoto(vm, ctx, view uintptr, maxSide int, camera bool) (<-chan Photo, error)
- func PickPhotos(vm, ctx, view uintptr, maxSide, limit int) (<-chan Photos, error)
- func PlaySound(vm, ctx uintptr, pcm []byte, rate, channels int) error
- func Publish(vm, ctx uintptr, path, mime string) (string, error)
- func ReadURI(vm, ctx uintptr, uri string, max int) ([]byte, error)
- func RequestNotifications(vm, ctx, view uintptr) (<-chan bool, error)
- func SaveToDownloads(vm, ctx uintptr, path, mime, folder string) (string, error)
- func SaveToGallery(vm, ctx uintptr, path, mime, album string) error
- func SecureDelete(vm, ctx uintptr, name string) error
- func SecureGet(vm, ctx uintptr, name string) ([]byte, bool, error)
- func SecureSet(vm, ctx uintptr, name string, value []byte) error
- func SetLifecycleHandlers(background, foreground func())
- func ShareText(vm, ctx, view uintptr, text, subject, title string) error
- func ShareURI(vm, ctx, view uintptr, uri, mime, title string) error
- func ShareURIs(vm, ctx, view uintptr, uris []string, mime, title string) error
- func StartKeepAlive(vm, ctx uintptr, reason string) error
- func StopDictation(vm, ctx uintptr, id int) error
- func StopKeepAlive(vm, ctx uintptr) error
- func ViewURI(vm, ctx, view uintptr, uri, mime string) error
- func WatchLifecycle(vm, ctx uintptr) error
- type Document
- type Documents
- type Photo
- type Photos
- type Shared
- type SharedFile
- type Speech
Constants ¶
This section is empty.
Variables ¶
var ErrCanceled = errors.New("canceled")
ErrCanceled is returned when the user dismisses a picker.
var ErrUnsupported = errors.New("not supported on this platform")
ErrUnsupported is returned on platforms without the service.
Functions ¶
func ClipboardImageURI ¶
ClipboardImageURI reports ErrUnsupported outside Android.
func KeepAliveDeclared ¶
KeepAliveDeclared reports ErrUnsupported outside Android.
func KeepScreenOn ¶
KeepScreenOn reports ErrUnsupported outside Android.
func ListenShares ¶
ListenShares reports ErrUnsupported outside Android.
func NotificationsEnabled ¶
NotificationsEnabled reports ErrUnsupported outside Android.
func OpenCustomTab ¶
OpenCustomTab reports ErrUnsupported outside Android.
func OpenDownloads ¶
OpenDownloads reports ErrUnsupported outside Android.
func PickDocuments ¶
func PickDocuments(vm, ctx, view uintptr, mimes []string, multiple bool, limit int, media bool) (<-chan Documents, error)
PickDocuments reports ErrUnsupported outside Android.
func PickPhotos ¶
PickPhotos reports ErrUnsupported outside Android.
func RequestNotifications ¶
RequestNotifications reports ErrUnsupported outside Android.
func SaveToDownloads ¶
SaveToDownloads reports ErrUnsupported outside Android.
func SaveToGallery ¶
SaveToGallery reports ErrUnsupported outside Android.
func SecureDelete ¶
SecureDelete reports ErrUnsupported outside Android.
func SetLifecycleHandlers ¶
func SetLifecycleHandlers(background, foreground func())
SetLifecycleHandlers sets the functions run when the app goes to the background and comes back; nil clears one. They run on the platform's main thread.
func StartKeepAlive ¶
StartKeepAlive reports ErrUnsupported outside Android.
func StopDictation ¶
StopDictation reports ErrUnsupported outside Android.
func StopKeepAlive ¶
StopKeepAlive reports ErrUnsupported outside Android.
func WatchLifecycle ¶
WatchLifecycle reports ErrUnsupported outside Android.
Types ¶
type Document ¶
Document is a file PickDocuments returned: an open file descriptor the receiver owns, with the file's display name and size (-1 when unknown).
type Documents ¶
Documents is a PickDocuments result: the files, or ErrCanceled when the user picked none, or an error.
type Photo ¶
Photo is the result of PickPhoto: a JPEG, its display name, or an error (ErrCanceled when the user backed out).
type Photos ¶
Photos is the result of PickPhotos: the picked photos, or an error (ErrCanceled when the user picked none).