SlideShare a Scribd company logo
REST API for your WP7 App

      Agnius Paradnikas
        @Agnius101
About me
•   .NET web developer for more than 6 years.
•   Recently focused on mobile app development.
•   Graduated KTU.
•   Created first WP7 app more than 1 year ago.
•   Now developing Weepin WP7 app on my
    spare time.
My first WP7 app
www.weepin.lt
• Weepin won 2-nd
  place in additional
  round in WP7 app
  challenge.
• At the moment is
  the first in The Best
  App category in
  LOGIN2012.
REST API




?          Server   DB
REST API

REST
 API

           Server   DB
REST API
• Stands for REpresentational State Transfer.
• Client-server: separation of concerns.
• Statless: no state is saved on server, if needed
  it is saved on client.
• Cacheable: clients can cache responses.
REST API
•   Easy to scale out.
•   Easy to build, maintain and modify.
•   Less overhead - higher performance.
•   Implementation does not require high
    technical skill level.
REST API example
http://www.domain.com/api/names?count=2
{
    "Names": [
        {
            "NameHTML": "<b>Ipr</b>amol",
            "NameText": "Ipramol",
            "IsShortname": true
        },
        {
            "NameHTML": "<b>Ipr</b>atropiumbromid Arrow",
            "NameText": "Ipratropiumbromid Arrow",
            "IsShortname": false
        }
    ]
}
• Simple REST and HTTP API Client for .NET.
• No need to know about low-level networking.
• Covers all needed cases like:
  –   Async requests (all requests in WP7 should be async!);
  –   Data mapping;
  –   Authentication;
  –   JSON/XML serialization;
  –   Implement your own custom serialization;
  –   Etc.
Getting Started
• Add reference via NuGet.
• And you’re done.
TodoApp DEMO and Example
http://todoapp.agnius.lt/api/todos
[
    {
          "id": "1",
          "todo": "Make dinner.",
          "username": "Agnius101",
          "created": "2012-04-09",
    },
    {
          "id": "2",
          "todo": "Finish WP7 presentation",
          "username": "Agnius101",
          "created": "2012-04-13",
          ]
    },

    ...
]
var client = new RestClient();
client.BaseUrl = "http://todoapp.agnius.lt/api";

RestRequest request = new RestRequest();
request.Resource = "todos";
request.RequestFormat = DataFormat.Json;
request.Method = Method.GET;
client.ExecuteAsync<List<TodoModel>>(request, (response)
=> {
  if (response.ResponseStatus != ResponseStatus.Error
      && response.StatusCode == System.Net.HttpStatusCode.OK)
  {
      this.todosListBox.ItemsSource = response.Data;
  } else {
      MessageBox.Show("Ups! Error occured.");
  }
});
REST API Server side
• Choose any technology you want:
  – .NET
  – JAVA
  – PHP
  – Python
  – Ruby
  – and so on…
• Cheap and easy way to implement server side
  REST API.
• For PHP and MySQL.
• Supports all needed tools to build REST API:
  – MVC
  – Routing
  – ORM
  – Logging & Profiling
  – and so on…
Getting Started
•   Go to http://www.doophp.com/
•   Download latest version.
•   Create MySQL database tables.
•   Make configuration changes in:
    – appprotectedconfigcommon.conf.php
    – appprotectedconfigdb.conf.php
Define routes
appprotectedconfigroutes.conf.php
<?php
$route['get']['/todos'] = array('MainController', 'getAll');
$route['get']['/todos/:id'] = array('MainController', 'getById');
$route['post']['/todos/new'] = array('MainController', 'createNew');
$route['post']['/todos/:id'] = array('MainController', 'deleteTodo');
?>
Create models
appprotectedmodelTodo.php
<?php
class Todo{
    public $id;
    public $todo;
    public $username;
    public $created;
    public $_table = 'todos';
    public $_primarykey = 'id';
    public $_fields =
array('id','user_id','todo','username', 'created');
}
?>
Implement controllers
appprotectedcontrollerMainController.php
<?php
class MainController extends DooController{

     public function getAll(){
        $todos = $this->db()->find('Todo');
        $result = json_encode($todos);
        $this->setContentType('json', 'utf-8');
        echo $result;
     }
}
?>
Upload everything to the server
If you are lucky everything should work.
My own experience
• Never try to do everything yourself.
• Be fast.
• Think how to add Facebook and YouTube
  effect to your app.
• Read carefully certification requirements
  before submitting your app.
How can I help you
• Support creating WP7 app from scratch.
• Setup REST API and DB in both .NET and PHP
  technologies.
• Share my experience if you decide to move with
  advanced techniques like MvvM.
• Give advice on usability.
• Give advice how to improve functionality.
• I don’t have experience creating games on XNA.
Follow me on Twitter


@Agnius101

More Related Content

What's hot

REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
Sachin G Kulkarni
 
Slim Framework
Slim FrameworkSlim Framework
Slim Framework
Pramod Raghav
 
Zend - Installation And Sample Project Creation
Zend - Installation And Sample Project Creation Zend - Installation And Sample Project Creation
Zend - Installation And Sample Project Creation Compare Infobase Limited
 
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
Sencha
 
Create a fake REST API without writing a single line of code
Create a fake REST API without writing a single line of codeCreate a fake REST API without writing a single line of code
Create a fake REST API without writing a single line of code
Yashobanta Bai
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
Antônio Roberto Silva
 
Rack
RackRack
PostgREST Design Philosophy
PostgREST Design PhilosophyPostgREST Design Philosophy
PostgREST Design Philosophy
begriffs
 
Unleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIUnleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIFilip W
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
Sencha
 
Try using Aeromock by Marverick, Inc.
Try using Aeromock by Marverick, Inc.Try using Aeromock by Marverick, Inc.
Try using Aeromock by Marverick, Inc.
scalaconfjp
 
Magento - a Zend Framework Application
Magento - a Zend Framework ApplicationMagento - a Zend Framework Application
Magento - a Zend Framework Application
ZendCon
 
Learn How To Use CA PPM REST API in 2 minutes!
Learn How To Use CA PPM REST API in 2 minutes!Learn How To Use CA PPM REST API in 2 minutes!
Learn How To Use CA PPM REST API in 2 minutes!
Prominder Nayar
 
Performance Tuning of .NET Application
Performance Tuning of .NET ApplicationPerformance Tuning of .NET Application
Performance Tuning of .NET ApplicationMainul Islam, CSM®
 
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job QueueTask Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
Sam Hennessy
 
An introduction to Laravel Passport
An introduction to Laravel PassportAn introduction to Laravel Passport
An introduction to Laravel Passport
Michael Peacock
 
Application Diagnosis with Zend Server Tracing
Application Diagnosis with Zend Server TracingApplication Diagnosis with Zend Server Tracing
Application Diagnosis with Zend Server Tracing
ZendCon
 
API gateway setup
API gateway setupAPI gateway setup
API gateway setup
sivachandra mandalapu
 
Integration and Acceptance Testing
Integration and Acceptance TestingIntegration and Acceptance Testing
Integration and Acceptance Testing
Alan Hecht
 
05.SharePointCSOM
05.SharePointCSOM05.SharePointCSOM
05.SharePointCSOMEaswariSP
 

What's hot (20)

REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
 
Slim Framework
Slim FrameworkSlim Framework
Slim Framework
 
Zend - Installation And Sample Project Creation
Zend - Installation And Sample Project Creation Zend - Installation And Sample Project Creation
Zend - Installation And Sample Project Creation
 
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
 
Create a fake REST API without writing a single line of code
Create a fake REST API without writing a single line of codeCreate a fake REST API without writing a single line of code
Create a fake REST API without writing a single line of code
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
Rack
RackRack
Rack
 
PostgREST Design Philosophy
PostgREST Design PhilosophyPostgREST Design Philosophy
PostgREST Design Philosophy
 
Unleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIUnleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web API
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
 
Try using Aeromock by Marverick, Inc.
Try using Aeromock by Marverick, Inc.Try using Aeromock by Marverick, Inc.
Try using Aeromock by Marverick, Inc.
 
Magento - a Zend Framework Application
Magento - a Zend Framework ApplicationMagento - a Zend Framework Application
Magento - a Zend Framework Application
 
Learn How To Use CA PPM REST API in 2 minutes!
Learn How To Use CA PPM REST API in 2 minutes!Learn How To Use CA PPM REST API in 2 minutes!
Learn How To Use CA PPM REST API in 2 minutes!
 
Performance Tuning of .NET Application
Performance Tuning of .NET ApplicationPerformance Tuning of .NET Application
Performance Tuning of .NET Application
 
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job QueueTask Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
 
An introduction to Laravel Passport
An introduction to Laravel PassportAn introduction to Laravel Passport
An introduction to Laravel Passport
 
Application Diagnosis with Zend Server Tracing
Application Diagnosis with Zend Server TracingApplication Diagnosis with Zend Server Tracing
Application Diagnosis with Zend Server Tracing
 
API gateway setup
API gateway setupAPI gateway setup
API gateway setup
 
Integration and Acceptance Testing
Integration and Acceptance TestingIntegration and Acceptance Testing
Integration and Acceptance Testing
 
05.SharePointCSOM
05.SharePointCSOM05.SharePointCSOM
05.SharePointCSOM
 

Viewers also liked

ACTiCOM Business Presentation
ACTiCOM Business PresentationACTiCOM Business Presentation
ACTiCOM Business PresentationVad Zaborski
 
e-ticket_7242125247859
e-ticket_7242125247859e-ticket_7242125247859
e-ticket_7242125247859Emile Rached
 
Body size and metabolism
Body size and metabolismBody size and metabolism
Body size and metabolism
José Luis Moreno Garvayo
 
Turkish infinitives and english gerunds or infinitives
Turkish infinitives and  english gerunds or infinitivesTurkish infinitives and  english gerunds or infinitives
Turkish infinitives and english gerunds or infinitives
goknely
 
Grados y radianes 9a
Grados y radianes 9aGrados y radianes 9a
Grados y radianes 9amaria_arango
 
Making users More Productive with Enterprise Search
Making users More Productive with Enterprise SearchMaking users More Productive with Enterprise Search
Making users More Productive with Enterprise Search
Aras
 
Opensolaris Expotic
Opensolaris ExpoticOpensolaris Expotic
Opensolaris ExpoticJaime Pérez
 
02 liquidacion final baja / ModaClub
02 liquidacion final baja / ModaClub02 liquidacion final baja / ModaClub
02 liquidacion final baja / ModaClub
Equipo de Mujeres Triunfadoras ModaClub
 
Diviértete y aprende como ahorrar en el Encuentro Dialhogar #EDH3
Diviértete y aprende como ahorrar en el Encuentro Dialhogar  #EDH3Diviértete y aprende como ahorrar en el Encuentro Dialhogar  #EDH3
Diviértete y aprende como ahorrar en el Encuentro Dialhogar #EDH3
Dialhogar
 
El librito majorero nº22 abril 2016
El librito majorero nº22 abril 2016El librito majorero nº22 abril 2016
El librito majorero nº22 abril 2016
El Librito Majorero
 
Xavier & Associates - Startup Club legal talk (23 Apr2015) (slideshare)
Xavier & Associates - Startup Club legal talk (23 Apr2015) (slideshare)Xavier & Associates - Startup Club legal talk (23 Apr2015) (slideshare)
Xavier & Associates - Startup Club legal talk (23 Apr2015) (slideshare)
Bernard Chung
 
A historia da igreja
A historia da igrejaA historia da igreja
A historia da igreja
leniogravacoes
 
Teoria y ejercicios tema completo muy bueno
Teoria y ejercicios   tema completo   muy buenoTeoria y ejercicios   tema completo   muy bueno
Teoria y ejercicios tema completo muy bueno
Ivan Garcia
 
Albert 2 oklahoma telemedicine
Albert 2 oklahoma telemedicineAlbert 2 oklahoma telemedicine
Albert 2 oklahoma telemedicine
TAOklahoma
 
La Historia del Bambú en multinivel por internet. CristinaNebot.com
La Historia del Bambú en multinivel por internet. CristinaNebot.comLa Historia del Bambú en multinivel por internet. CristinaNebot.com
La Historia del Bambú en multinivel por internet. CristinaNebot.com
Cristina Nebot Fortea
 
Ficha estiramientos
Ficha estiramientosFicha estiramientos
Ficha estiramientosJAESHUANMAR1
 
Preisliste wpc terrassendielen
Preisliste wpc terrassendielenPreisliste wpc terrassendielen
Preisliste wpc terrassendielen
Fassadenverkleidung
 
TEATRE ROMÀ
TEATRE ROMÀTEATRE ROMÀ

Viewers also liked (20)

ACTiCOM Business Presentation
ACTiCOM Business PresentationACTiCOM Business Presentation
ACTiCOM Business Presentation
 
e-ticket_7242125247859
e-ticket_7242125247859e-ticket_7242125247859
e-ticket_7242125247859
 
Body size and metabolism
Body size and metabolismBody size and metabolism
Body size and metabolism
 
Turkish infinitives and english gerunds or infinitives
Turkish infinitives and  english gerunds or infinitivesTurkish infinitives and  english gerunds or infinitives
Turkish infinitives and english gerunds or infinitives
 
Grados y radianes 9a
Grados y radianes 9aGrados y radianes 9a
Grados y radianes 9a
 
Making users More Productive with Enterprise Search
Making users More Productive with Enterprise SearchMaking users More Productive with Enterprise Search
Making users More Productive with Enterprise Search
 
Opensolaris Expotic
Opensolaris ExpoticOpensolaris Expotic
Opensolaris Expotic
 
02 liquidacion final baja / ModaClub
02 liquidacion final baja / ModaClub02 liquidacion final baja / ModaClub
02 liquidacion final baja / ModaClub
 
Diviértete y aprende como ahorrar en el Encuentro Dialhogar #EDH3
Diviértete y aprende como ahorrar en el Encuentro Dialhogar  #EDH3Diviértete y aprende como ahorrar en el Encuentro Dialhogar  #EDH3
Diviértete y aprende como ahorrar en el Encuentro Dialhogar #EDH3
 
El librito majorero nº22 abril 2016
El librito majorero nº22 abril 2016El librito majorero nº22 abril 2016
El librito majorero nº22 abril 2016
 
Xavier & Associates - Startup Club legal talk (23 Apr2015) (slideshare)
Xavier & Associates - Startup Club legal talk (23 Apr2015) (slideshare)Xavier & Associates - Startup Club legal talk (23 Apr2015) (slideshare)
Xavier & Associates - Startup Club legal talk (23 Apr2015) (slideshare)
 
A historia da igreja
A historia da igrejaA historia da igreja
A historia da igreja
 
Teoria y ejercicios tema completo muy bueno
Teoria y ejercicios   tema completo   muy buenoTeoria y ejercicios   tema completo   muy bueno
Teoria y ejercicios tema completo muy bueno
 
Reglas aton
Reglas atonReglas aton
Reglas aton
 
Albert 2 oklahoma telemedicine
Albert 2 oklahoma telemedicineAlbert 2 oklahoma telemedicine
Albert 2 oklahoma telemedicine
 
La Historia del Bambú en multinivel por internet. CristinaNebot.com
La Historia del Bambú en multinivel por internet. CristinaNebot.comLa Historia del Bambú en multinivel por internet. CristinaNebot.com
La Historia del Bambú en multinivel por internet. CristinaNebot.com
 
Manejo De Lesiones de EESS 2
Manejo De Lesiones de EESS 2Manejo De Lesiones de EESS 2
Manejo De Lesiones de EESS 2
 
Ficha estiramientos
Ficha estiramientosFicha estiramientos
Ficha estiramientos
 
Preisliste wpc terrassendielen
Preisliste wpc terrassendielenPreisliste wpc terrassendielen
Preisliste wpc terrassendielen
 
TEATRE ROMÀ
TEATRE ROMÀTEATRE ROMÀ
TEATRE ROMÀ
 

Similar to REST API for your WP7 App

Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram VaswaniCreating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
vvaswani
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
Igor Bronovskyy
 
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Puppet
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio Haro
QuickBase, Inc.
 
RESTEasy
RESTEasyRESTEasy
Flask and Angular: An approach to build robust platforms
Flask and Angular:  An approach to build robust platformsFlask and Angular:  An approach to build robust platforms
Flask and Angular: An approach to build robust platforms
Ayush Sharma
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with Express
Aaron Stannard
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
Jonathan Wage
 
[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development
Adam Tomat
 
Complex Sites with Silex
Complex Sites with SilexComplex Sites with Silex
Complex Sites with Silex
Chris Tankersley
 
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Fwdays
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
JBug Italy
 
Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5
Elena Kolevska
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
Andréia Bohner
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
Andréia Bohner
 
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyUsing Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in Ruby
LaunchAny
 
Nodejs first class
Nodejs first classNodejs first class
Nodejs first class
Fin Chen
 
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
崇之 清水
 
General Principles of Web Security
General Principles of Web SecurityGeneral Principles of Web Security
General Principles of Web Security
jemond
 

Similar to REST API for your WP7 App (20)

Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram VaswaniCreating REST Applications with the Slim Micro-Framework by Vikram Vaswani
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio Haro
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Flask and Angular: An approach to build robust platforms
Flask and Angular:  An approach to build robust platformsFlask and Angular:  An approach to build robust platforms
Flask and Angular: An approach to build robust platforms
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with Express
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development
 
Complex Sites with Silex
Complex Sites with SilexComplex Sites with Silex
Complex Sites with Silex
 
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
 
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyUsing Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in Ruby
 
Nodejs first class
Nodejs first classNodejs first class
Nodejs first class
 
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
 
General Principles of Web Security
General Principles of Web SecurityGeneral Principles of Web Security
General Principles of Web Security
 

Recently uploaded

Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 

Recently uploaded (20)

Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 

REST API for your WP7 App

  • 1. REST API for your WP7 App Agnius Paradnikas @Agnius101
  • 2. About me • .NET web developer for more than 6 years. • Recently focused on mobile app development. • Graduated KTU. • Created first WP7 app more than 1 year ago. • Now developing Weepin WP7 app on my spare time.
  • 5. • Weepin won 2-nd place in additional round in WP7 app challenge. • At the moment is the first in The Best App category in LOGIN2012.
  • 6. REST API ? Server DB
  • 7. REST API REST API Server DB
  • 8. REST API • Stands for REpresentational State Transfer. • Client-server: separation of concerns. • Statless: no state is saved on server, if needed it is saved on client. • Cacheable: clients can cache responses.
  • 9. REST API • Easy to scale out. • Easy to build, maintain and modify. • Less overhead - higher performance. • Implementation does not require high technical skill level.
  • 10. REST API example http://www.domain.com/api/names?count=2 { "Names": [ { "NameHTML": "<b>Ipr</b>amol", "NameText": "Ipramol", "IsShortname": true }, { "NameHTML": "<b>Ipr</b>atropiumbromid Arrow", "NameText": "Ipratropiumbromid Arrow", "IsShortname": false } ] }
  • 11. • Simple REST and HTTP API Client for .NET. • No need to know about low-level networking. • Covers all needed cases like: – Async requests (all requests in WP7 should be async!); – Data mapping; – Authentication; – JSON/XML serialization; – Implement your own custom serialization; – Etc.
  • 12. Getting Started • Add reference via NuGet. • And you’re done.
  • 13. TodoApp DEMO and Example http://todoapp.agnius.lt/api/todos [ { "id": "1", "todo": "Make dinner.", "username": "Agnius101", "created": "2012-04-09", }, { "id": "2", "todo": "Finish WP7 presentation", "username": "Agnius101", "created": "2012-04-13", ] }, ... ]
  • 14. var client = new RestClient(); client.BaseUrl = "http://todoapp.agnius.lt/api"; RestRequest request = new RestRequest(); request.Resource = "todos"; request.RequestFormat = DataFormat.Json; request.Method = Method.GET;
  • 15. client.ExecuteAsync<List<TodoModel>>(request, (response) => { if (response.ResponseStatus != ResponseStatus.Error && response.StatusCode == System.Net.HttpStatusCode.OK) { this.todosListBox.ItemsSource = response.Data; } else { MessageBox.Show("Ups! Error occured."); } });
  • 16. REST API Server side • Choose any technology you want: – .NET – JAVA – PHP – Python – Ruby – and so on…
  • 17. • Cheap and easy way to implement server side REST API. • For PHP and MySQL. • Supports all needed tools to build REST API: – MVC – Routing – ORM – Logging & Profiling – and so on…
  • 18. Getting Started • Go to http://www.doophp.com/ • Download latest version. • Create MySQL database tables. • Make configuration changes in: – appprotectedconfigcommon.conf.php – appprotectedconfigdb.conf.php
  • 19. Define routes appprotectedconfigroutes.conf.php <?php $route['get']['/todos'] = array('MainController', 'getAll'); $route['get']['/todos/:id'] = array('MainController', 'getById'); $route['post']['/todos/new'] = array('MainController', 'createNew'); $route['post']['/todos/:id'] = array('MainController', 'deleteTodo'); ?>
  • 20. Create models appprotectedmodelTodo.php <?php class Todo{ public $id; public $todo; public $username; public $created; public $_table = 'todos'; public $_primarykey = 'id'; public $_fields = array('id','user_id','todo','username', 'created'); } ?>
  • 21. Implement controllers appprotectedcontrollerMainController.php <?php class MainController extends DooController{ public function getAll(){ $todos = $this->db()->find('Todo'); $result = json_encode($todos); $this->setContentType('json', 'utf-8'); echo $result; } } ?>
  • 22. Upload everything to the server If you are lucky everything should work.
  • 23. My own experience • Never try to do everything yourself. • Be fast. • Think how to add Facebook and YouTube effect to your app. • Read carefully certification requirements before submitting your app.
  • 24. How can I help you • Support creating WP7 app from scratch. • Setup REST API and DB in both .NET and PHP technologies. • Share my experience if you decide to move with advanced techniques like MvvM. • Give advice on usability. • Give advice how to improve functionality. • I don’t have experience creating games on XNA.
  • 25. Follow me on Twitter @Agnius101