com.googlecode.android_scripting.facade
Class CommonIntentsFacade

java.lang.Object
  extended by com.googlecode.android_scripting.jsonrpc.RpcReceiver
      extended by com.googlecode.android_scripting.facade.CommonIntentsFacade

public class CommonIntentsFacade
extends RpcReceiver

A selection of commonly used intents.

These can be used to trigger some common tasks.


Constructor Summary
CommonIntentsFacade(FacadeManager manager)
           
 
Method Summary
 Intent pick(java.lang.String uri)
           
 Intent scanBarcode()
           
 void search(java.lang.String query)
           
 void shutdown()
          Invoked when the receiver is shut down.
 void view(java.lang.String uri, java.lang.String type, JSONObject extras)
           
 void viewContacts()
           
 void viewHtml(java.lang.String path)
           
 void viewMap(java.lang.String query)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonIntentsFacade

public CommonIntentsFacade(FacadeManager manager)
Method Detail

shutdown

public void shutdown()
Description copied from class: RpcReceiver
Invoked when the receiver is shut down.

Specified by:
shutdown in class RpcReceiver

pick

@Rpc(description="Display content to be picked by URI (e.g. contacts)",
     returns="A map of result values.")
public Intent pick(@RpcParameter(name="uri")
                                         java.lang.String uri)
            throws JSONException
Throws:
JSONException

scanBarcode

@Rpc(description="Starts the barcode scanner.",
     returns="A Map representation of the result Intent.")
public Intent scanBarcode()
                   throws JSONException
Throws:
JSONException

view

@Rpc(description="Start activity with view action by URI (i.e. browser, contacts, etc.).")
public void view(@RpcParameter(name="uri")
                                java.lang.String uri,
                                @RpcParameter(name="type",description="MIME type/subtype of the URI")@RpcOptional
                                java.lang.String type,
                                @RpcParameter(name="extras",description="a Map of extras to add to the Intent")@RpcOptional
                                JSONObject extras)
          throws java.lang.Exception
Throws:
java.lang.Exception

viewMap

@Rpc(description="Opens a map search for query (e.g. pizza, 123 My Street).")
public void viewMap(@RpcParameter(name="query, e.g. pizza, 123 My Street")
                                   java.lang.String query)
             throws java.lang.Exception
Throws:
java.lang.Exception

viewContacts

@Rpc(description="Opens the list of contacts.")
public void viewContacts()
                  throws JSONException
Throws:
JSONException

viewHtml

@Rpc(description="Opens the browser to display a local HTML file.")
public void viewHtml(@RpcParameter(name="path",description="the path to the HTML file")
                                    java.lang.String path)
              throws JSONException
Throws:
JSONException

search

@Rpc(description="Starts a search for the given query.")
public void search(@RpcParameter(name="query")
                                  java.lang.String query)