Develop PHP mobile apps with Zend Framework



Similar documents
Collaborative Open Source with PHP on IBM i

Manage cloud infrastructures using Zend Framework

MySQL for IBM i Or Zend DBi == MySQL!

Integrating Mobile apps with your Enterprise

Getting Started Guide for Developing tibbr Apps

Enterprise Mobile Web Development. Robert Altland Principal Consultant, Mobility Neudesic, LLC

HTML5. Turn this page to see Quick Guide of CTTC

Syllabus INFO-UB Design and Development of Web and Mobile Applications (Especially for Start Ups)

APP DEVELOPMENT ON THE CLOUD MADE EASY WITH PAAS

1 Overview Configuration on MACH Web Portal 1

Syllabus INFO-GB Design and Development of Web and Mobile Applications (Especially for Start Ups)

Using the Push Notifications Extension Part 1: Certificates and Setup

Mobile Cross Platform Development really? Jonathan Marshall, IBM Mobile Technical Specialist IBM Corporation

Secure Application Development with the Zend Framework

Building Rich Internet Applications with PHP and Zend Framework

POINT-TO-POINT vs. MEAP THE RIGHT APPROACH FOR AN INTEGRATED MOBILITY SOLUTION

AgileZen and Zend Framework 2 Project management software and API integration

PHP on IBM i: What s New with Zend Server 5 for IBM i

Modern Web Development From Angle Brackets to Web Sockets

Enterprise Mobile App Management Essentials. Presented by Ryan Hope and John Nielsen

Middleware- Driven Mobile Applications

Creating Enterprise Mobile Apps with Red Hat

Petroleum Web Applications to Support your Business. David Jacob & Vanessa Ramirez Esri Natural Resources Team

Smartphone Enterprise Application Integration

Developing and deploying mobile apps

The Best Mobile App Development Platform. Period.

CA Service Desk Manager - Mobile Enabler 2.0

place/business fetch details, removefromfavorite () function, 189 search button handler bind, B BlackBerry build environment

Introduction to Web Development with R

Developing Cross-platform Mobile and Web Apps

Introduction to IBM Worklight Mobile Platform

OpenEdge and Mobile Applications

Using Cloud Services for Building Next Generation Mobile Apps

Zend Server 4.0 Beta 2 Release Announcement What s new in Zend Server 4.0 Beta 2 Updates and Improvements Resolved Issues Installation Issues

Kony Mobile Application Management (MAM)

ni.com Remote Connectivity with LabVIEW

Chatbots 3.3. Chatbots in Web Applications with RiveScript. Presented by Noah Petherbridge

Course Summary. Prerequisites

RFP# ADDENDUM No. 1 Questions and Answers

LDAPCON Sébastien Bahloul

RED HAT SOFTWARE COLLECTIONS BRIDGING DEVELOPMENT AGILITY AND PRODUCTION STABILITY

How Simple Is It To Develop a Mobile App? Uma Sudhan OpenEdge Developer 7 th Oct 2013

AppDev OnDemand Cloud Computing Learning Library

SAP Mobile Platform Intro

How Oracle MAF & Oracle Mobile Cloud can Accelerate Mobile App Development

6 CURRENT JOB OPENINGS:

Making Mobile a Reality

Gabriel Iuga. London, United Kingdom Tel: ; Website:

Bring your intranet to the IBM i With Drupal and Zend Server

Mobile Apps, Mobile Web, and Other Cool Tools. Thursday, November 9, :00pm 4:00pm Michael Hostad and Scott Owczarek

Developing an Interoperable Blackboard Proxy Tool

WIRIS quizzes web services Getting started with PHP and Java

apiomat Enterprise Mobile Enterprise Application Platform the Next Generation

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON

Authenticate and authorize API with Apigility. by Enrico Zimuel Software Engineer Apigility and ZF2 Team

How To Build A Web App

CAREER OPPORTUNITIES

Armedia. Drupal and PhoneGap Building Mobile Apps

Case Study. Data Governance Portal Brainvire Infotech Pvt Ltd Page 1 of 1

Armedia. Drupal and PhoneGap Building Mobile Apps

COMPANY PROFILE MISSION VISION. Code Enterprise is a Web & Mobile Application company with its roots deeply imbued in the European affiliate market.

Vincent Gabriel. Summary. Experience. Senior Software Developer at Landmark Network

IBM Digital Experience. Using Modern Web Development Tools and Technology with IBM Digital Experience

THE BUSINESS CASE FOR HYBRID HTML5 MOBILE APPS

ICAPRG409A Develop mobile applications

Operational Decision Manager Worklight Integration

How to Choose Right Mobile Development Platform BROWSER, HYBRID, OR NATIVE

Server-Side Scripting and Web Development. By Susan L. Miertschin

The full setup includes the server itself, the server control panel, Firebird Database Server, and three sample applications with source code.

Develop a Native App (ios and Android) for a Drupal Website without Learning Objective-C or Java. Drupaldelphia 2014 By Joe Roberts

SOA, case Google. Faculty of technology management Information Technology Service Oriented Communications CT30A8901.

Human Resources Department.

4/25/2016 C. M. Boyd, Practical Data Visualization with JavaScript Talk Handout

Web Cloud Architecture

ANDROID INTRODUCTION TO ANDROID

Appscend Mobile Platform Whitepaper

Budget Event Management Design Document

Pete Helgren Ruby On Rails on i

Programming. Languages & Frameworks. Hans- Pe(er Halvorsen, M.Sc. h(p://home.hit.no/~hansha/?page=sodware_development

Building native mobile apps for Digital Factory

tibbr Now, the Information Finds You.

Our Technology.NET Development services by Portweb Inc.

Accessing External Databases from Mobile Applications

How To Use Titanium Studio

System Requirements for Microsoft Dynamics NAV 2016

Example of Standard API

Cloud Elements! Events Management BETA! API Version 2.0

Automatic vs. Manual Code Analysis

Architecture Workshop

Take full advantage of IBM s IDEs for end- to- end mobile development

Administering Jive Mobile Apps

MOBILIZING ORACLE APPLICATIONS ERP. An Approach for Building Scalable Mobility Solutions. A RapidValue Solutions Whitepaper

Cloud Services MDM. Control Panel Provisioning Guide

Platform Independent Mobile Application Development

System Requirements for Microsoft Dynamics NAV 2016

Transcription:

Develop PHP mobile apps with Zend Framework Enrico Zimuel Senior PHP Engineer, Zend Technologies Zend Framework Core Team http://framework.zend.com http://www.zend.com

About me Enrico Zimuel (@ezimuel) Software Engineer since 1996 @ezimuel Assembly 80x86, C/C++, Java, Perl, PHP PHP Engineer and Software Architect at Zend Technologies since 2008 Zend Framework Core Team from 2011 enrico@zend.com Research Programmer at the Informatics Institute of the University of Amsterdam International speaker and author of books about computer programming

Mobile web applications

Mobile web application It is a web application optimized for mobile devices Main differences with a standard web app: Different size of the screen Different interaction Different usability Reuse the standard technologies of the web (i.e. HTML, Javascript, PHP, etc) More effort to HTML5 to offer a similar interface to the UI of native apps

Mobile web vs. Native App Mobile web Native App Device access limited complete Development costs low medium/high Open technologies yes sometimes Revenue 100% depends Approval none depends Time to market instant 1-2 weeks Coding HTML + anything (i.e. PHP) depends

Mobile web vs. Native App (2) People never cared about the Web vs. apps and devices... They want free stuff, entertainment, and services when they want them, and on the device they have in front of them Source: Pew Internet Project (March, 2012)

Mobile web with ZF

Zend Framework Framework for PHP applications Open source license, new BSD like Versions 1.11.11 (PHP 5.2) 2.0.0.beta3 (PHP 5.3) Official web site: http://framework.zend.com Zend Technologies Ltd.

ZF for mobile web Zend_Http_UserAgent BrowsCap Tera-WURFL DeviceAtlas Context Switching Zend_Mobile Available from ZF 1.12 (coming soon!)

BrowsCap get_browser(), internal function of PHP Configuration: Usage: Download the file browscap.ini from: http://browsers.garykeith.com/downloads Edit php.ini and add the following line: browscap=/path/to/browscap.ini get_browser ([ string $user_agent [, bool $return_array = false ]] )

Tera-WURFL Tera-WURFL is a PHP library + device database available in MySQL, MSSQL, and MongoDB Download: http://dbapi.scientiamobile.com

DeviceAtlas Mobile device detection library Available for different languages: PHP, Java,.NET, Python, Ruby Commercial license Download: http://deviceatlas.com/resourcecentre/get+started/enterprise+api

Zend_Http_UserAgent Mobile device detection Can be used in a ZF application anywhere: Plugin (bootstrap) Controller View

Zend_Http_UserAgent (2) Plugin (bootstrap) $bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap'); $useragent = $bootstrap->getresource('useragent'); Controller $bootstrap = $this->getinvokearg('bootstrap'); $useragent = $bootstrap->getresource('useragent'); View $useragent = $this->useragent();

Some methods of UserAgent getdevice() getbrowsertype() getallfeatures() hasflashsupport() haspdfsupport() hasphonenumber() httpssupport() getmaximageheight() getmaximagewidth()...

Context switching ContextSwitching is an action helper that manage differents output based on the request context For instance, a web service needs to manage different outputs: Json and XML Define custom contents Add suffix to the view Change the HTTP header Define callbacks

Example (Context switch + UserAgent) class Application_Plugin_Mobile extends Zend_Controller_Plugin_Abstract { public function dispatchloopstartup( Zend_Controller_Request_Abstract $request) { $contextswitch = Zend_Controller_Action_HelperBroker::getStaticHelper('ContextSwitch'); $contextswitch->clearcontexts() ->setcontext('iphone', array( 'suffix' => 'iphone', 'headers' => array( 'Content-Type' => 'text/html;charset=utf-8'), )) ->setcontext('html', array( 'suffix' => 'html', 'headers' => array( 'Content-Type' => 'text/html;charset=utf-8'), )) ->setautodisablelayout(false) ->setdefaultcontext('html') ->initcontext();

Example (2) } } $bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap'); $useragent = $bootstrap->getresource('useragent'); switch($useragent->getdevice()->getfeature('device')) { case 'iphone': $request->setparam('format','iphone'); break; default: $request->setparam('format','html'); }

Example (3) class IndexController extends Zend_Controller_Action { public function init() { $this->_helper->contextswitch() ->addactioncontext('index', 'iphone') ->initcontext(); } } index.phtml index.iphone.phtml View

Zend_Mobile Zend_Mobile_Push Zend_Mobile_Push provides the ability for sending push notifications to the vendor specific notification servers APNS (itouch/ipad/iphone) C2DM (Google Android) MPNS (Windows Phone)

Example: APNS Zend_Mobile

Example $message = new Zend_Mobile_Push_Message_Apns(); $message->setalert('zend Mobile Push Example'); $message->setbadge(1); $message->setsound('default'); $message->setid(time()); $message->settoken('abcdef0123456789'); $apns = new Zend_Mobile_Push_Apns(); $apns->setcertificate('/path/to/provisioning-certificate.pem'); // if you have a passphrase on your certificate: // $apns->setcertificatepassphrase('foobar');...

Example (2) try { $apns->connect(zend_mobile_push_apns::server_sandbox_uri); } catch (Zend_Mobile_Push_Exception_ServerUnavailable $e) { // you can either attempt to reconnect here or try again later exit(1); } catch (Zend_Mobile_Push_Exception $e) { echo 'APNS Connection Error:'. $e->getmessage(); exit(1); } try { $apns->send($message); } catch (Zend_Mobile_Push_Exception_InvalidToken $e) { echo $e->getmessage(); } catch (Zend_Mobile_Push_Exception $e) { echo $e->getmessage(); } $apns->close();

References M. Willbanks, Mobile: Push for Sync & Notifications, ZendCon 2011 K. Schroeder, Mobile development using Zend Framework and Zend Studio J. Anderson, L. Rainie, The Future of Apps and Web, March 2012, Pew Internet & American Life Project Zend Framework Context Switch, ZF Reference Guide Zend Framework UserAgent, ZF Reference Guide Apple Push Notification Service (APNS) Android Cloud to Device Messaging Framework (C2DM) Push Notifications Overview for Windows Phone

Questions?

Call for Papers is now open! Submit your talks by May 21, 2012 Join us at ZendCon The premier PHP conference! October 22-25, 2012 Santa Clara, CA Conference Themes PHP in 2012 - The latest PHP technologies and tools Learn how to leverage the latest mobile, HTML 5, testing and PHP best practices Zend Framework 2 - Hit the ground running Learn how to build faster, more modular and more expandable applications Conference Highlights Sessions focused on how to best develop and deploy PHP Sessions designed for all knowledge levels Intensive tutorials for accelerated learning PHP Certification crash courses and testing Exhibit hall showcasing the latest products Development & The Cloud A love story Learn how the latest developments in cloud-based services, infrastructure and best practices can benefit you www.zendcon.com Special networking opportunities during meals and events

Thank you! For more information: http://framework.zend.com/ http://www.zend.com