com.googlecode.android_scripting.facade
Class ContactsFacade

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

public class ContactsFacade
extends RpcReceiver

Provides access to contacts related functionality.

Author:
MeanEYE.rcf (meaneye.rcf@gmail.com

Field Summary
 java.lang.String mContactId
           
 java.lang.String mHasPhoneNumber
           
 Uri mPhoneContent
           
 java.lang.String mPhoneNumber
           
 java.lang.String mPrimary
           
 
Constructor Summary
ContactsFacade(FacadeManager manager)
           
 
Method Summary
 java.util.List<JSONObject> contactsGet(JSONArray attributes)
           
 java.util.List<java.lang.String> contactsGetAttributes()
           
 JSONObject contactsGetById(java.lang.Integer id, JSONArray attributes)
           
 java.lang.Integer contactsGetCount()
           
 java.util.List<java.lang.Integer> contactsGetIds()
           
 Intent pickContact()
           
 java.lang.String pickPhone()
           
 JSONArray queryAttributes(java.lang.String uri)
           
 java.util.List<JSONObject> queryContent(java.lang.String uri, JSONArray attributes, java.lang.String selection, JSONArray selectionArgs, java.lang.String order)
          Exactly as per ContentResolver.query
 void shutdown()
          Invoked when the receiver is shut down.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mPhoneContent

public Uri mPhoneContent

mContactId

public java.lang.String mContactId

mPrimary

public java.lang.String mPrimary

mPhoneNumber

public java.lang.String mPhoneNumber

mHasPhoneNumber

public java.lang.String mHasPhoneNumber
Constructor Detail

ContactsFacade

public ContactsFacade(FacadeManager manager)
Method Detail

pickContact

@Rpc(description="Displays a list of contacts to pick from.",
     returns="A map of result values.")
public Intent pickContact()
                   throws JSONException
Throws:
JSONException

pickPhone

@Rpc(description="Displays a list of phone numbers to pick from.",
     returns="The selected phone number.")
public java.lang.String pickPhone()
                           throws JSONException
Throws:
JSONException

contactsGetAttributes

@Rpc(description="Returns a List of all possible attributes for contacts.")
public java.util.List<java.lang.String> contactsGetAttributes()

contactsGetIds

@Rpc(description="Returns a List of all contact IDs.")
public java.util.List<java.lang.Integer> contactsGetIds()

contactsGet

@Rpc(description="Returns a List of all contacts.",
     returns="a List of contacts as Maps")
public java.util.List<JSONObject> contactsGet(@RpcParameter(name="attributes")@RpcOptional
                                                                    JSONArray attributes)
                                       throws JSONException
Throws:
JSONException

contactsGetById

@Rpc(description="Returns contacts by ID.")
public JSONObject contactsGetById(@RpcParameter(name="id")
                                                 java.lang.Integer id,
                                                 @RpcParameter(name="attributes")@RpcOptional
                                                 JSONArray attributes)
                           throws JSONException
Throws:
JSONException

contactsGetCount

@Rpc(description="Returns the number of contacts.")
public java.lang.Integer contactsGetCount()

queryContent

@Rpc(description="Content Resolver Query",
     returns="result of query as Maps")
public java.util.List<JSONObject> queryContent(@RpcParameter(name="uri",description="The URI, using the content:// scheme, for the content to retrieve.")
                                                                     java.lang.String uri,
                                                                     @RpcParameter(name="attributes",description="A list of which columns to return. Passing null will return all columns")@RpcOptional
                                                                     JSONArray attributes,
                                                                     @RpcParameter(name="selection",description="A filter declaring which rows to return")@RpcOptional
                                                                     java.lang.String selection,
                                                                     @RpcParameter(name="selectionArgs",description="You may include ?s in selection, which will be replaced by the values from selectionArgs")@RpcOptional
                                                                     JSONArray selectionArgs,
                                                                     @RpcParameter(name="order",description="How to order the rows")@RpcOptional
                                                                     java.lang.String order)
                                        throws JSONException
Exactly as per ContentResolver.query

Throws:
JSONException

queryAttributes

@Rpc(description="Content Resolver Query Attributes",
     returns="a list of available columns for a given content uri")
public JSONArray queryAttributes(@RpcParameter(name="uri",description="The URI, using the content:// scheme, for the content to retrieve.")
                                                       java.lang.String uri)
                          throws JSONException
Throws:
JSONException

shutdown

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

Specified by:
shutdown in class RpcReceiver