SlideShare a Scribd company logo
1 of 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

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 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
 

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
 
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
 

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 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
 

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

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Recently uploaded (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

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