SlideShare ist ein Scribd-Unternehmen logo
1 von 54
Downloaden Sie, um offline zu lesen
移动应用开发
PhoneGap + JQuery + Dreamweaver
very much!
But,   less than 7yue
MOBILE HTML
Web App
    or
Hybrid App
    or
Native App
?MOBILE HTML




               http://mobilehtml5.org/
摄像头
        设备API     Web font    音视频
运动传感器
        部件           图形、图像、特效
指南针

设备信息               CSS 3


 GPS

 通知              JavaScript


网络状态

                HTML标记和语义
 …
浏览器
摄像头
        设备API     Web font    音视频
运动传感器
        部件           图形、图像、特效
指南针

设备信息               CSS 3


 GPS

 通知              JavaScript


网络状态

                HTML标记和语义
 …
Native Wrapper

                   浏览器
摄像头
        设备API      Web font      音视频
运动传感器
        部件             图形、图像、特效
指南针

设备信息                 CSS 3


 GPS

 通知                JavaScript


网络状态

                 HTML标记和语义
 …
Native Wrapper
PhoneGap              WebView
  摄像头
             设备API      Web font    音视频
运动传感器
              部件              图形、图像、特效
  指南针

 设备信息                       CSS 3


  GPS

  通知                   JavaScript


 网络状态

                     HTML标记和语义
   …
Web App & Hybrid App


         使用
HTML + JavaScript + CSS3
    开发的移动应用
 (基于浏览器+可安装的)
Framework?

  Tools?
JQuery mobile
  (http://jquerymobile.com/)



创建面向现代智能移动设备的
    跨平台UI框架
构建于JQuery Core
跨平台
(iOS, Android, Blackberry, Palm WebOS, Nokia/Symbian,
Windows Phone 7, MeeGo, Opera Mobile/Mini, Firefox
Mobile, Kindle, Nook, 所有现代浏览器)


HTML5标记配置
轻量级
模块化架构
触摸和鼠标事件支持
强大的主题框架
统一的、可扩充的UI组件
<body>

<div data-role="page" id="page">
        <div data-role="header">
        <h1>Page One</h1>                                               Page
        </div>
        <div data-role="content">
        <ul data-role="listview">
                 <li><a href="#page2">Page Two</a></li>
                             <li><a href="#page3">Page Three</a></li>
                 <li><a href="#page4">Page Four</a></li>
        </ul>
        </div>
        <div data-role="footer">
        <h4>Page Footer</h4>
        </div>
</div>
<div data-role="page" id="page2">
            <div data-role="header">
            <h1>Page Two</h1>
            </div>
            <div data-role="content">
            Content
            </div>
            <div data-role="footer">
            <h4>Page Footer</h4>
            </div>
</div>
准备div:interactive

<div data-role="page" id="page2" >
    <div data-role="header" id="page2Header" data-position="fixed" >
    1 <a href="#page1" data-role="button" data-icon="home">home</a>
       <h1>PIE</h1>
   </div>
2 <div data-role="content">
     <div id="interactive" class="graph" ></div>
  </div>
   <div data-role="footer" data-position="fixed" id="page2Footer">
      <h4>Page Footer</h4>
  </div>
</div>



                                                            jquery.flot.js
准备数据
$(function () {
      var data=[];
      var series = Math.floor(Math.random()*5)+5;
      for( var i = 0; i<series; i++)
      {
      data[i] = { label: "Series"+(i+1),
                     data: Math.floor(Math.random()*100)+1 }
      }
…




                                                       jquery.flot.js
$.plot($("#interactive"), data,
                                                使用Jquery plugin
          {                                     plot在interactive
          series: {                                div上绘制
                  pie: {
                  show: true,
                  innerRadius: 0.4
                  }
          },
          grid: {
                  hoverable: false,
                  clickable: true
          },
          legend: {
                  show: false
          }
          });
          $("#interactive").bind("plotclick", pieClick);
});
                                                           jquery.flot.js
listview
<div data-role="page" id="page3">
  <div data-role="header">
    <a href="#page4" data-role="button" data-icon="back">返回
</a>
      <h1>LIST</h1>
  </div>
  <div data-role="content">
    <ul data-role="listview" data-theme="d" id="listAfterMax"
                              data-inset="true">
    </ul>
 </div>
 <div data-role="footer">
    <h4>Page Footer</h4>
 </div>
</div>
数据
var itemData = [
       {imgURL: "images/flowing-rock.jpg" ,
            label: "Series1",
            desc: 10,
            price: 120, stock:1200},
       {imgURL: "images/grass-blades.jpg" ,
            label: "Series2",
            desc: 30,
            price: 220,
            ck:200},
       …… ];
“itemrenderer”
<script id="newsItem" type="text/x-jquery-tmpl">
  <li data-messageId="${label}" class="newsItem">
          <img src="${imgURL}" class="itemImageWrapper" />
              <h3>
              <a href="#page4" onClick="activeGallery()">${label}</a>
              </h3>
    <p class="subItem"><strong>Price ${price}元 </strong></p>
    <div class="ui-li-aside">
       <p><strong>${stock} 部</strong></p>
    </div>
  </li>
</script>
使用Jquery
                                           plugin: tmpl 构
var newsList = $( "#listAfterMax" );            建list

newsList.empty();

$( "#newsItem" ).tmpl( itemData).appendTo( newsList );

newsList.listview( "refresh" );
My Stupid Demo
MORE…   http://www.markus-falk.com/mobile-frameworks-comparison-chart/
MORE…   http://www.markus-falk.com/mobile-frameworks-comparison-chart/




                      http://www.markus-falk.com/mobile-frameworks-comparison-chart/
PhoneGap
使用HTML5、CSS3、JavaScript构建
APP


访问移动设备本地特性


phoneGap plugin



打包部署到多种平台
打包
public class CirclesActivity 	
     	     	extends DroidGap {	
    	
    @Override	
    public void onCreate(Bundle savedInstanceState) {	
        super.onCreate(savedInstanceState);	
      super.loadUrl("file:///android_asset/
www/circles.html");	
      }	
}	




Native Wrapper with PhoneGap
在dreamweaver中构建
PhoneGap : Build
PhoneGap Build
   Compile in the cloud
PhoneGap plugin
定制PhoneGap Plugin
    (IOS 和 Android)

一个JavaScript与匹配的Java



一个JavaScript与匹配的.h和.m
PhoneGap如何工作?
PhoneGap架构


             Web App                                      PhoneGap Plug-ins
        HTML5+JavaScript+CSS3                      摄像头        运动传感器             设备信息


                                                   指南针           GPS             通知
HTML5                           PhoneGap
 API                              JS API
                                                  网络状态            …

                                     PhoneGap
                                     Native API
          HTML Engine                                         定制plugin

        (WebView、UIWebView…)


                      OS API                                           OS API



                                              Mobile OS
android activity

HTML5项目


phonegap.jar

plugins.xml

AndroidManifest.xml
public class CirclesActivity 	
     	     	extends DroidGap {	
    	
    @Override	
    public void onCreate(Bundle savedInstanceState) {	
        super.onCreate(savedInstanceState);	
      super.loadUrl("file:///android_asset/
www/index.html");	
      }	
}	




Native Wrapper with PhoneGap
public class callsPGPlugin extends Plugin {                       Java定制plugin
          // List Actions
         public static final String ACTION="list";
         @Override
         public PluginResult execute(String action, JSONArray data, String callbackId) {

         PluginResult result=null;

         if(ACTION.equals(action)){
                  CallLogAI callLogAI = new CallLogAI(ctx);
                  JSONObject callsHistory=callLogAI.fetchCallLogs(null);
                  Log.d("RESULT=", callsHistory.toString());
                  result=new PluginResult(Status.OK,callsHistory);
         }else{
                  result=new PluginResult(Status.INVALID_ACTION);
                  Log.d("CallsPlugin","Invalidate action:" + action);
         }
         return result;
         }
}
注册plugin
<?xml version="1.0" encoding="UTF-8"?>
<plugins>
  <plugin name="App" value="com.phonegap.App"/>
  <plugin name="Geolocation" value="com.phonegap.GeoBroker"/>
  <plugin name="Device" value="com.phonegap.Device"/>
  ……
  <plugin name="Temperature" value="com.phonegap.TempListener"/>
  <plugin name="FileTransfer" value="com.phonegap.FileTransfer"/>
  <plugin name="Capture" value="com.phonegap.Capture"/>


  <plugin name="CallsHistoryPlugin"
value="com.mark.phonegap.plugin.callsPGPlugin" />

</plugins>
Javascript接口
var CallsListing=function(){};

CallsListing.prototype.list=function(successCallback,failureCallback){
        return PhoneGap.exec(successCallback,
                                            failureCallback,
                                            'CallsHistoryPlugin',
                                            'list',['test']
                                     );
};

PhoneGap.addConstructor(function(){
     PhoneGap.addPlugin("callsListing",new CallsListing);
});
Javascript 调用plugin


    window.plugins.callsListing.list(	
        	function(r){printResult(r)},	
        	function(e){console.log(e)}	
    );
window.plugins.callsListing.list(	
        	function(r){printResult(r)},	
        	function(e){console.log(e)}	
   );	

  CallsListing.prototype.list=function
  (successCallback,failureCallback){	
        	return PhoneGap.exec(successCallback,	
        	failureCallback,	
        	'CallsHistoryPlugin',	
        	'list',['test’]);	
  };	
                                             public class callsPGPlugin extends Plugin {
                                                       // List Actions
<plugin name="CallsHistoryPlugin"                     public static final String ACTION="lis
value="com.mark.phonegap.plugin.callsPGPlu            @Override
                                                      public PluginResult execute(String
gin" />
                                             action, JSONArray data, String callbackId) {
PhoneGap的
  小秘密
addJavaScriptInterface



WebChromClient: onJsPrompt


CallbackServer:XmlHttpRequestsever
CallsListing.prototype.list=function
(successCallback,failureCallback){	
      	return PhoneGap.exec(successCallback,	
      	failureCallback,	
      	'CallsHistoryPlugin',	
      	'list',['test’]);	
};	




PhoneGap.exec = function(success, fail, service, action, args) {
…
var r = prompt(JSON.stringify(args), "gap:"+JSON.stringify([service,
action, callbackId, true]));
…
Droidgap.java

    public boolean onJsPrompt(WebView view, String url, String message, String
    defaultValue, JsPromptResult result) {
    ……

     String r = pluginManager.exec(service, action, callbackId, message, async);

    ……
    }

Pluginmanager.java

public String exec(final String service, final String action, final String callbackId, final
String jsonArgs, final boolean async) {
         ……
         cr = plugin.execute(action, args, callbackId);
         ctx.sendJavascript(cr.toErrorCallbackString(callbackId));

           ……
}
Pluginmanager.java

      ctx.sendJavascript(cr.toErrorCallbackString(callbackId));



          CallbackServer.java : XHR server


PhoneGap.Channel.join(function() {

 // Start listening for XHR callbacks
 setTimeout(function() {
      if (PhoneGap.UsePolling) {
         PhoneGap.JSCallbackPolling();
      }
…
Appcelerator Titanium

        Native?
        JavaScriptCore
        Mozilla Rhino
Mark Dong
Developer Evangelist
dong@adobe.com
weibo.com/donglongfei

Weitere ähnliche Inhalte

Was ist angesagt?

Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Chris Alfano
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web developmentJohannes Brodwall
 
Before there was Hoop Dreams, there was McDonald's: Strange and Beautiful
Before there was Hoop Dreams, there was McDonald's: Strange and BeautifulBefore there was Hoop Dreams, there was McDonald's: Strange and Beautiful
Before there was Hoop Dreams, there was McDonald's: Strange and Beautifulchicagonewsonlineradio
 
Windows 8 metro applications
Windows 8 metro applicationsWindows 8 metro applications
Windows 8 metro applicationsAlex Golesh
 
Create a mobile web app with Sencha Touch
Create a mobile web app with Sencha TouchCreate a mobile web app with Sencha Touch
Create a mobile web app with Sencha TouchJames Pearce
 
Java Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreJava Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreIMC Institute
 
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...OPITZ CONSULTING Deutschland
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitIMC Institute
 
TurboGears2 Pluggable Applications
TurboGears2 Pluggable ApplicationsTurboGears2 Pluggable Applications
TurboGears2 Pluggable ApplicationsAlessandro Molina
 
2012 SVCodeCamp: In App Payments with HTML5
2012 SVCodeCamp: In App Payments with HTML52012 SVCodeCamp: In App Payments with HTML5
2012 SVCodeCamp: In App Payments with HTML5Jonathan LeBlanc
 
Mashing up JavaScript – Advanced Techniques for modern Web Apps
Mashing up JavaScript – Advanced Techniques for modern Web AppsMashing up JavaScript – Advanced Techniques for modern Web Apps
Mashing up JavaScript – Advanced Techniques for modern Web AppsBastian Hofmann
 
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
 
Laravel 로 배우는 서버사이드 #5
Laravel 로 배우는 서버사이드 #5Laravel 로 배우는 서버사이드 #5
Laravel 로 배우는 서버사이드 #5성일 한
 
Rails 6 frontend frameworks
Rails 6 frontend frameworksRails 6 frontend frameworks
Rails 6 frontend frameworksEric Guo
 

Was ist angesagt? (18)

Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
 
Before there was Hoop Dreams, there was McDonald's: Strange and Beautiful
Before there was Hoop Dreams, there was McDonald's: Strange and BeautifulBefore there was Hoop Dreams, there was McDonald's: Strange and Beautiful
Before there was Hoop Dreams, there was McDonald's: Strange and Beautiful
 
Basics of AngularJS
Basics of AngularJSBasics of AngularJS
Basics of AngularJS
 
Windows 8 metro applications
Windows 8 metro applicationsWindows 8 metro applications
Windows 8 metro applications
 
Create a mobile web app with Sencha Touch
Create a mobile web app with Sencha TouchCreate a mobile web app with Sencha Touch
Create a mobile web app with Sencha Touch
 
Java Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreJava Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : Datastore
 
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
 
Sane Async Patterns
Sane Async PatternsSane Async Patterns
Sane Async Patterns
 
TurboGears2 Pluggable Applications
TurboGears2 Pluggable ApplicationsTurboGears2 Pluggable Applications
TurboGears2 Pluggable Applications
 
HTML,CSS Next
HTML,CSS NextHTML,CSS Next
HTML,CSS Next
 
2012 SVCodeCamp: In App Payments with HTML5
2012 SVCodeCamp: In App Payments with HTML52012 SVCodeCamp: In App Payments with HTML5
2012 SVCodeCamp: In App Payments with HTML5
 
Mashing up JavaScript – Advanced Techniques for modern Web Apps
Mashing up JavaScript – Advanced Techniques for modern Web AppsMashing up JavaScript – Advanced Techniques for modern Web Apps
Mashing up JavaScript – Advanced Techniques for modern Web Apps
 
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)
 
Laravel 로 배우는 서버사이드 #5
Laravel 로 배우는 서버사이드 #5Laravel 로 배우는 서버사이드 #5
Laravel 로 배우는 서버사이드 #5
 
Angular js
Angular jsAngular js
Angular js
 
Rails 6 frontend frameworks
Rails 6 frontend frameworksRails 6 frontend frameworks
Rails 6 frontend frameworks
 

Ähnlich wie 移动应用开发PhoneGap + JQuery + Dreamweaver

PhoneGap:你应该知道的12件事
PhoneGap:你应该知道的12件事PhoneGap:你应该知道的12件事
PhoneGap:你应该知道的12件事longfei.dong
 
Phone gap 12 things you should know
Phone gap 12 things you should knowPhone gap 12 things you should know
Phone gap 12 things you should knowISOCHK
 
BlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksBlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksmwbrooks
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology updateDoug Domeny
 
E3 appspresso hands on lab
E3 appspresso hands on labE3 appspresso hands on lab
E3 appspresso hands on labNAVER D2
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CNjojule
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoRob Bontekoe
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best PracticesYekmer Simsek
 
Relevance trilogy may dream be with you! (dec17)
Relevance trilogy  may dream be with you! (dec17)Relevance trilogy  may dream be with you! (dec17)
Relevance trilogy may dream be with you! (dec17)Woonsan Ko
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on MobileAdam Lu
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretssmueller_sandsmedia
 
Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesMichael Galpin
 
Client-side Rendering with AngularJS
Client-side Rendering with AngularJSClient-side Rendering with AngularJS
Client-side Rendering with AngularJSDavid Lapsley
 
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJSMozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJSRobert Nyman
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of usOSCON Byrum
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - MozillaRobert Nyman
 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WAREFermin Galan
 

Ähnlich wie 移动应用开发PhoneGap + JQuery + Dreamweaver (20)

PhoneGap:你应该知道的12件事
PhoneGap:你应该知道的12件事PhoneGap:你应该知道的12件事
PhoneGap:你应该知道的12件事
 
Phone gap 12 things you should know
Phone gap 12 things you should knowPhone gap 12 things you should know
Phone gap 12 things you should know
 
BlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksBlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorks
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
 
E3 appspresso hands on lab
E3 appspresso hands on labE3 appspresso hands on lab
E3 appspresso hands on lab
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
 
mobl
moblmobl
mobl
 
Relevance trilogy may dream be with you! (dec17)
Relevance trilogy  may dream be with you! (dec17)Relevance trilogy  may dream be with you! (dec17)
Relevance trilogy may dream be with you! (dec17)
 
前端概述
前端概述前端概述
前端概述
 
G* on GAE/J 挑戦編
G* on GAE/J 挑戦編G* on GAE/J 挑戦編
G* on GAE/J 挑戦編
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on Mobile
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
 
Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and Smartphones
 
Client-side Rendering with AngularJS
Client-side Rendering with AngularJSClient-side Rendering with AngularJS
Client-side Rendering with AngularJS
 
Mozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJSMozilla Web Apps - Super-VanJS
Mozilla Web Apps - Super-VanJS
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of us
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WARE
 

Mehr von yangdj

磊友科技CTO 赵霏演讲
磊友科技CTO 赵霏演讲磊友科技CTO 赵霏演讲
磊友科技CTO 赵霏演讲yangdj
 
黎明帝国发布会By黄何
黎明帝国发布会By黄何黎明帝国发布会By黄何
黎明帝国发布会By黄何yangdj
 
黎明帝国
黎明帝国黎明帝国
黎明帝国yangdj
 
海豚浏览器CTO刘铁锋:Web App发展现状
海豚浏览器CTO刘铁锋:Web App发展现状海豚浏览器CTO刘铁锋:Web App发展现状
海豚浏览器CTO刘铁锋:Web App发展现状yangdj
 
快!快!快! 互联网第一条军规
快!快!快! 互联网第一条军规快!快!快! 互联网第一条军规
快!快!快! 互联网第一条军规yangdj
 
面孔演讲词
面孔演讲词面孔演讲词
面孔演讲词yangdj
 
面孔网张路:Julia开源框架
面孔网张路:Julia开源框架面孔网张路:Julia开源框架
面孔网张路:Julia开源框架yangdj
 
微游戏Ceo徐城:HTML5的移动互联网时代
微游戏Ceo徐城:HTML5的移动互联网时代微游戏Ceo徐城:HTML5的移动互联网时代
微游戏Ceo徐城:HTML5的移动互联网时代yangdj
 
Adobe董龙飞:关于PhoneGap的12件事
Adobe董龙飞:关于PhoneGap的12件事Adobe董龙飞:关于PhoneGap的12件事
Adobe董龙飞:关于PhoneGap的12件事yangdj
 
【项目分享】赶集移动Web App开发总结
【项目分享】赶集移动Web App开发总结 【项目分享】赶集移动Web App开发总结
【项目分享】赶集移动Web App开发总结 yangdj
 
赶集团购开发总结4
赶集团购开发总结4赶集团购开发总结4
赶集团购开发总结4yangdj
 
混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaveryangdj
 
iOS5 开发新特性
iOS5 开发新特性iOS5 开发新特性
iOS5 开发新特性yangdj
 
CSDN移动电子刊第三期
CSDN移动电子刊第三期CSDN移动电子刊第三期
CSDN移动电子刊第三期yangdj
 
Csdn移动电子刊 9月
Csdn移动电子刊 9月Csdn移动电子刊 9月
Csdn移动电子刊 9月yangdj
 
淘宝无线电子商务数据报告Marked
淘宝无线电子商务数据报告Marked淘宝无线电子商务数据报告Marked
淘宝无线电子商务数据报告Markedyangdj
 
Csdn移动电子刊第一期
Csdn移动电子刊第一期Csdn移动电子刊第一期
Csdn移动电子刊第一期yangdj
 
字霸一点通2003
字霸一点通2003字霸一点通2003
字霸一点通2003yangdj
 
友盟2011第一季度国内android数据报告
友盟2011第一季度国内android数据报告友盟2011第一季度国内android数据报告
友盟2011第一季度国内android数据报告yangdj
 
应用汇,Android
应用汇,Android应用汇,Android
应用汇,Androidyangdj
 

Mehr von yangdj (20)

磊友科技CTO 赵霏演讲
磊友科技CTO 赵霏演讲磊友科技CTO 赵霏演讲
磊友科技CTO 赵霏演讲
 
黎明帝国发布会By黄何
黎明帝国发布会By黄何黎明帝国发布会By黄何
黎明帝国发布会By黄何
 
黎明帝国
黎明帝国黎明帝国
黎明帝国
 
海豚浏览器CTO刘铁锋:Web App发展现状
海豚浏览器CTO刘铁锋:Web App发展现状海豚浏览器CTO刘铁锋:Web App发展现状
海豚浏览器CTO刘铁锋:Web App发展现状
 
快!快!快! 互联网第一条军规
快!快!快! 互联网第一条军规快!快!快! 互联网第一条军规
快!快!快! 互联网第一条军规
 
面孔演讲词
面孔演讲词面孔演讲词
面孔演讲词
 
面孔网张路:Julia开源框架
面孔网张路:Julia开源框架面孔网张路:Julia开源框架
面孔网张路:Julia开源框架
 
微游戏Ceo徐城:HTML5的移动互联网时代
微游戏Ceo徐城:HTML5的移动互联网时代微游戏Ceo徐城:HTML5的移动互联网时代
微游戏Ceo徐城:HTML5的移动互联网时代
 
Adobe董龙飞:关于PhoneGap的12件事
Adobe董龙飞:关于PhoneGap的12件事Adobe董龙飞:关于PhoneGap的12件事
Adobe董龙飞:关于PhoneGap的12件事
 
【项目分享】赶集移动Web App开发总结
【项目分享】赶集移动Web App开发总结 【项目分享】赶集移动Web App开发总结
【项目分享】赶集移动Web App开发总结
 
赶集团购开发总结4
赶集团购开发总结4赶集团购开发总结4
赶集团购开发总结4
 
混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver混搭移动开发:PhoneGap+JQurey+Dreamweaver
混搭移动开发:PhoneGap+JQurey+Dreamweaver
 
iOS5 开发新特性
iOS5 开发新特性iOS5 开发新特性
iOS5 开发新特性
 
CSDN移动电子刊第三期
CSDN移动电子刊第三期CSDN移动电子刊第三期
CSDN移动电子刊第三期
 
Csdn移动电子刊 9月
Csdn移动电子刊 9月Csdn移动电子刊 9月
Csdn移动电子刊 9月
 
淘宝无线电子商务数据报告Marked
淘宝无线电子商务数据报告Marked淘宝无线电子商务数据报告Marked
淘宝无线电子商务数据报告Marked
 
Csdn移动电子刊第一期
Csdn移动电子刊第一期Csdn移动电子刊第一期
Csdn移动电子刊第一期
 
字霸一点通2003
字霸一点通2003字霸一点通2003
字霸一点通2003
 
友盟2011第一季度国内android数据报告
友盟2011第一季度国内android数据报告友盟2011第一季度国内android数据报告
友盟2011第一季度国内android数据报告
 
应用汇,Android
应用汇,Android应用汇,Android
应用汇,Android
 

Kürzlich hochgeladen

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Kürzlich hochgeladen (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

移动应用开发PhoneGap + JQuery + Dreamweaver

  • 2.
  • 4. But, less than 7yue
  • 6. Web App or Hybrid App or Native App
  • 7. ?MOBILE HTML http://mobilehtml5.org/
  • 8. 摄像头 设备API Web font 音视频 运动传感器 部件 图形、图像、特效 指南针 设备信息 CSS 3 GPS 通知 JavaScript 网络状态 HTML标记和语义 …
  • 9. 浏览器 摄像头 设备API Web font 音视频 运动传感器 部件 图形、图像、特效 指南针 设备信息 CSS 3 GPS 通知 JavaScript 网络状态 HTML标记和语义 …
  • 10. Native Wrapper 浏览器 摄像头 设备API Web font 音视频 运动传感器 部件 图形、图像、特效 指南针 设备信息 CSS 3 GPS 通知 JavaScript 网络状态 HTML标记和语义 …
  • 11. Native Wrapper PhoneGap WebView 摄像头 设备API Web font 音视频 运动传感器 部件 图形、图像、特效 指南针 设备信息 CSS 3 GPS 通知 JavaScript 网络状态 HTML标记和语义 …
  • 12. Web App & Hybrid App 使用 HTML + JavaScript + CSS3 开发的移动应用 (基于浏览器+可安装的)
  • 14.
  • 15. JQuery mobile (http://jquerymobile.com/) 创建面向现代智能移动设备的 跨平台UI框架
  • 16. 构建于JQuery Core 跨平台 (iOS, Android, Blackberry, Palm WebOS, Nokia/Symbian, Windows Phone 7, MeeGo, Opera Mobile/Mini, Firefox Mobile, Kindle, Nook, 所有现代浏览器) HTML5标记配置 轻量级 模块化架构 触摸和鼠标事件支持 强大的主题框架 统一的、可扩充的UI组件
  • 17. <body> <div data-role="page" id="page"> <div data-role="header"> <h1>Page One</h1> Page </div> <div data-role="content"> <ul data-role="listview"> <li><a href="#page2">Page Two</a></li> <li><a href="#page3">Page Three</a></li> <li><a href="#page4">Page Four</a></li> </ul> </div> <div data-role="footer"> <h4>Page Footer</h4> </div> </div> <div data-role="page" id="page2"> <div data-role="header"> <h1>Page Two</h1> </div> <div data-role="content"> Content </div> <div data-role="footer"> <h4>Page Footer</h4> </div> </div>
  • 18. 准备div:interactive <div data-role="page" id="page2" > <div data-role="header" id="page2Header" data-position="fixed" > 1 <a href="#page1" data-role="button" data-icon="home">home</a> <h1>PIE</h1> </div> 2 <div data-role="content"> <div id="interactive" class="graph" ></div> </div> <div data-role="footer" data-position="fixed" id="page2Footer"> <h4>Page Footer</h4> </div> </div> jquery.flot.js
  • 19. 准备数据 $(function () { var data=[]; var series = Math.floor(Math.random()*5)+5; for( var i = 0; i<series; i++) { data[i] = { label: "Series"+(i+1), data: Math.floor(Math.random()*100)+1 } } … jquery.flot.js
  • 20. $.plot($("#interactive"), data, 使用Jquery plugin { plot在interactive series: { div上绘制 pie: { show: true, innerRadius: 0.4 } }, grid: { hoverable: false, clickable: true }, legend: { show: false } }); $("#interactive").bind("plotclick", pieClick); }); jquery.flot.js
  • 21. listview <div data-role="page" id="page3"> <div data-role="header"> <a href="#page4" data-role="button" data-icon="back">返回 </a> <h1>LIST</h1> </div> <div data-role="content"> <ul data-role="listview" data-theme="d" id="listAfterMax" data-inset="true"> </ul> </div> <div data-role="footer"> <h4>Page Footer</h4> </div> </div>
  • 22. 数据 var itemData = [ {imgURL: "images/flowing-rock.jpg" , label: "Series1", desc: 10, price: 120, stock:1200}, {imgURL: "images/grass-blades.jpg" , label: "Series2", desc: 30, price: 220, ck:200}, …… ];
  • 23. “itemrenderer” <script id="newsItem" type="text/x-jquery-tmpl"> <li data-messageId="${label}" class="newsItem"> <img src="${imgURL}" class="itemImageWrapper" /> <h3> <a href="#page4" onClick="activeGallery()">${label}</a> </h3> <p class="subItem"><strong>Price ${price}元 </strong></p> <div class="ui-li-aside"> <p><strong>${stock} 部</strong></p> </div> </li> </script>
  • 24. 使用Jquery plugin: tmpl 构 var newsList = $( "#listAfterMax" ); 建list newsList.empty(); $( "#newsItem" ).tmpl( itemData).appendTo( newsList ); newsList.listview( "refresh" );
  • 26. MORE… http://www.markus-falk.com/mobile-frameworks-comparison-chart/
  • 27. MORE… http://www.markus-falk.com/mobile-frameworks-comparison-chart/ http://www.markus-falk.com/mobile-frameworks-comparison-chart/
  • 30.
  • 32. public class CirclesActivity extends DroidGap { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.loadUrl("file:///android_asset/ www/circles.html"); } } Native Wrapper with PhoneGap
  • 35. PhoneGap Build Compile in the cloud
  • 36.
  • 38. 定制PhoneGap Plugin (IOS 和 Android) 一个JavaScript与匹配的Java 一个JavaScript与匹配的.h和.m
  • 40. PhoneGap架构 Web App PhoneGap Plug-ins HTML5+JavaScript+CSS3 摄像头 运动传感器 设备信息 指南针 GPS 通知 HTML5 PhoneGap API JS API 网络状态 … PhoneGap Native API HTML Engine 定制plugin (WebView、UIWebView…) OS API OS API Mobile OS
  • 42. public class CirclesActivity extends DroidGap { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.loadUrl("file:///android_asset/ www/index.html"); } } Native Wrapper with PhoneGap
  • 43. public class callsPGPlugin extends Plugin { Java定制plugin // List Actions public static final String ACTION="list"; @Override public PluginResult execute(String action, JSONArray data, String callbackId) { PluginResult result=null; if(ACTION.equals(action)){ CallLogAI callLogAI = new CallLogAI(ctx); JSONObject callsHistory=callLogAI.fetchCallLogs(null); Log.d("RESULT=", callsHistory.toString()); result=new PluginResult(Status.OK,callsHistory); }else{ result=new PluginResult(Status.INVALID_ACTION); Log.d("CallsPlugin","Invalidate action:" + action); } return result; } }
  • 44. 注册plugin <?xml version="1.0" encoding="UTF-8"?> <plugins> <plugin name="App" value="com.phonegap.App"/> <plugin name="Geolocation" value="com.phonegap.GeoBroker"/> <plugin name="Device" value="com.phonegap.Device"/> …… <plugin name="Temperature" value="com.phonegap.TempListener"/> <plugin name="FileTransfer" value="com.phonegap.FileTransfer"/> <plugin name="Capture" value="com.phonegap.Capture"/> <plugin name="CallsHistoryPlugin" value="com.mark.phonegap.plugin.callsPGPlugin" /> </plugins>
  • 45. Javascript接口 var CallsListing=function(){}; CallsListing.prototype.list=function(successCallback,failureCallback){ return PhoneGap.exec(successCallback, failureCallback, 'CallsHistoryPlugin', 'list',['test'] ); }; PhoneGap.addConstructor(function(){ PhoneGap.addPlugin("callsListing",new CallsListing); });
  • 46. Javascript 调用plugin window.plugins.callsListing.list( function(r){printResult(r)}, function(e){console.log(e)} );
  • 47. window.plugins.callsListing.list( function(r){printResult(r)}, function(e){console.log(e)} ); CallsListing.prototype.list=function (successCallback,failureCallback){ return PhoneGap.exec(successCallback, failureCallback, 'CallsHistoryPlugin', 'list',['test’]); }; public class callsPGPlugin extends Plugin { // List Actions <plugin name="CallsHistoryPlugin" public static final String ACTION="lis value="com.mark.phonegap.plugin.callsPGPlu @Override public PluginResult execute(String gin" /> action, JSONArray data, String callbackId) {
  • 50. CallsListing.prototype.list=function (successCallback,failureCallback){ return PhoneGap.exec(successCallback, failureCallback, 'CallsHistoryPlugin', 'list',['test’]); }; PhoneGap.exec = function(success, fail, service, action, args) { … var r = prompt(JSON.stringify(args), "gap:"+JSON.stringify([service, action, callbackId, true])); …
  • 51. Droidgap.java public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) { …… String r = pluginManager.exec(service, action, callbackId, message, async); …… } Pluginmanager.java public String exec(final String service, final String action, final String callbackId, final String jsonArgs, final boolean async) { …… cr = plugin.execute(action, args, callbackId); ctx.sendJavascript(cr.toErrorCallbackString(callbackId)); …… }
  • 52. Pluginmanager.java ctx.sendJavascript(cr.toErrorCallbackString(callbackId)); CallbackServer.java : XHR server PhoneGap.Channel.join(function() { // Start listening for XHR callbacks setTimeout(function() { if (PhoneGap.UsePolling) { PhoneGap.JSCallbackPolling(); } …
  • 53. Appcelerator Titanium Native? JavaScriptCore Mozilla Rhino