Mobile/Archive/Sharing: Difference between revisions

Jump to navigation Jump to search
Android back-end research
(Android back-end research)
Line 27: Line 27:


== Designs ==
== Designs ==
=== Back-end software design ===
==== Android ====
Message passing in Android is done with objects called [http://developer.android.com/reference/android/content/Intent.html Intents].  An intent includes an ''action'' (a string representing a verb), an optional URI, optional MIME type, and optional bundle of key-value pairs ("extras").  There are many standard actions defined by the OS, including ''ACTION_DIAL, ACTION_VIEW, ACTION_EDIT''.  So to open a web page, you could send an ''ACTION_VIEW'' intent with an http: URI.
Intents can be sent within an application, to a specific other application, or broadcast for any application to handle.  Each application declares what types of intent it can handle, based on the action, URI, and MIME type.  When an intent is broadcast, the OS will launch the user's preferred default app for that intent if there is one, or else will ask the user to choose from a list of available apps (and optionally set a default).
The "Share" command in the stock Android browser sends an ''ACTION_SEND'' event with type text/plain and the page address and description in the ''EXTRA_TEXT'' property.  It uses [http://developer.android.com/reference/android/content/Intent.html#createChooser%28android.content.Intent,%20java.lang.CharSequence%29 Intent.createChooser] to force the OS to prompt the user for an app, rather than launch the default app.
Fennec could do the same, and the native app chooser UI would appear just as it does in the stock browser.  Or we could enumerate the available apps for ''ACTION_SEND text/plain'' using the [http://developer.android.com/reference/android/content/pm/PackageManager.html#queryIntentActivities%28android.content.Intent,%20int%29 PackageManager queryIntentActivities] method, and display our own app chooser UI.
==== Maemo ====
(Need to document how to discover and invoke Maemo apps through .desktop files and dbus.)


=== Research ===
=== Research ===
canmove, Confirmed users
1,584

edits

Navigation menu