Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. protected void onCreate(Bundle savedInstanceState) {
  2. super.onCreate(savedInstanceState);
  3. setContentView(R.layout.activity_main);
  4. try {
  5. mClient = new MobileServiceClient("https://myservice.azure-mobile.net/",
  6. "slkerjasfi234eSomePrivateKey", this);
  7.  
  8. Item item = new Item();
  9. item.setText("Awesome item");
  10. item.setComplete(false);
  11. mClient.getTable(Item.class).insert(item,
  12. new TableOperationCallback<Item>() {
  13. public void onCompleted(Item entity,
  14. Exception exception,
  15. ServiceFilterResponse response) {
  16. if (exception == null) {
  17. ShowMessage("Success");
  18. } else {
  19. ShowMessage("Failed");
  20. }
  21. }
  22. });
  23.  
  24. } catch (MalformedURLException e) {
  25. // TODO Auto-generated catch block
  26. e.printStackTrace();
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement