0

can someone tell me please is there a way to pass custom parameters on getting table (or insert, update...) from azure mobile services. My scripts sometimes are using request.parameters but I didn't find any example of adding them in Android SDK.

Is there a way?

1
  • On which way FusionCharts are connected to my problem? I'm asking about connecting Azure Mobile Services and Android app so... Commented Dec 31, 2013 at 11:27

1 Answer 1

1

For each of the [insert | update | delete] methods there is an overload which allow you to pass those parameters - the overload with a List<Pair<String, String>> argument. This is how you'd pass a few extra parameters in an insert call:

MobileServiceTable<TodoItem> table = mClient.getTable(TodoItem.class); List<Pair<String, String>> queryParams = new ArrayList<Pair<String, String>>(); queryParams.add(new Pair<String, String>("option", "value")); table.insert(todoItem, queryParams, new TableOperationCallback<TodoItem>() { public void onCompleted(TodoItem inserted, Exception error, ServiceFilterResponse response) { // Your logic here } }); 

For delete / update, the code is similar.

For query operations, you can pass the parameters via the parameter method:

MobileServiceTable<TodoItem> table = mClient.getTable(TodoItem.class); table .where().field("complete").eq(val(false)) .parameter("option", "value") .parameter("otherOption", "otherValue") .execute(new TableQueryCallback<TodoItem>() { public void onCompleted(List<TodoItem> results, int count, Exception error, ServiceFilterResponse response) { // Your logic here } }); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.