SlideShare ist ein Scribd-Unternehmen logo
1 von 25
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

Weitere ähnliche Inhalte

Was ist angesagt?

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 CodeigniterSachin G Kulkarni
 
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 codeYashobanta 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'sAntônio Roberto Silva
 
PostgREST Design Philosophy
PostgREST Design PhilosophyPostgREST Design Philosophy
PostgREST Design Philosophybegriffs
 
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 ApplicationZendCon
 
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 QueueSam Hennessy
 
An introduction to Laravel Passport
An introduction to Laravel PassportAn introduction to Laravel Passport
An introduction to Laravel PassportMichael Peacock
 
Application Diagnosis with Zend Server Tracing
Application Diagnosis with Zend Server TracingApplication Diagnosis with Zend Server Tracing
Application Diagnosis with Zend Server TracingZendCon
 
Integration and Acceptance Testing
Integration and Acceptance TestingIntegration and Acceptance Testing
Integration and Acceptance TestingAlan Hecht
 
05.SharePointCSOM
05.SharePointCSOM05.SharePointCSOM
05.SharePointCSOMEaswariSP
 

Was ist angesagt? (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
 

Andere mochten auch

ACTiCOM Business Presentation
ACTiCOM Business PresentationACTiCOM Business Presentation
ACTiCOM Business PresentationVad Zaborski
 
e-ticket_7242125247859
e-ticket_7242125247859e-ticket_7242125247859
e-ticket_7242125247859Emile Rached
 
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 infinitivesgoknely
 
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 SearchAras
 
Opensolaris Expotic
Opensolaris ExpoticOpensolaris Expotic
Opensolaris ExpoticJaime Pérez
 
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 #EDH3Dialhogar
 
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 2016El 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
 
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 buenoIvan Garcia
 
Albert 2 oklahoma telemedicine
Albert 2 oklahoma telemedicineAlbert 2 oklahoma telemedicine
Albert 2 oklahoma telemedicineTAOklahoma
 
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.comCristina Nebot Fortea
 
Ficha estiramientos
Ficha estiramientosFicha estiramientos
Ficha estiramientosJAESHUANMAR1
 

Andere mochten auch (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À
 

Ähnlich wie 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 Vaswanivvaswani
 
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 2014Puppet
 
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 HaroQuickBase, Inc.
 
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 platformsAyush Sharma
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with ExpressAaron Stannard
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For BeginnersJonathan Wage
 
[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress DevelopmentAdam Tomat
 
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 - RestEasyJBug Italy
 
Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Elena Kolevska
 
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 RubyLaunchAny
 
Nodejs first class
Nodejs first classNodejs first class
Nodejs first classFin 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 Securityjemond
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Kürzlich hochgeladen (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

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