1 package huang.namespace; 2 3 /*import android.app.Activity*/; 4 import android.os.Bundle; 5 import com.phonegap.*; 6 public class FirstAppActivity extends DroidGap { 7 /** Called when the activity is first created. */ 8 @Override 9 public void onCreate(Bundle savedInstanceState) { 10 super.onCreate(savedInstanceState); 11 // setContentView(R.layout.main); 12 super.loadUrl("file:///android_asset/www/index.html"); 13 } 14 }
1 /**
2 * @author huanghuang
3 */
4 Ext.application({
5 // name:'LocatCam',
6 launch:function(){
7 Ext.create('Ext.Container', {
8 fullscreen: true,
9 padding: 4,
10 // width:'50%',
11 items: [
12 {
13 xtype:'button',
14 ui: 'normal',
15 text: 'photo',
16 width:80,
17 handler:function(){
18 // alert('hello my name is huanghuang!');
19 // 等待加载PhoneGap
20 document.addEventListener("deviceready", onDeviceReady, false);
21
22 // PhoneGap加载完毕
23 function onDeviceReady() {
24 // 空
25 }
26
27 // 警告对话框被忽视
28 function alertDismissed() {
29 // 进行处理
30 }
31 navigator.notification.alert(
32 'You are the winner!', // 显示信息
33 alertDismissed, // 警告被忽视的回调函数
34 'Game Over', // 标题
35 'Done' // 按钮名称
36 );
37 }
38 }
39 ]
40 });
41 }
42 });
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
3 "http://www.w3.org/TR/html4/strict.dtd">
4
5 <html>
6
7 <head>
8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
9 <title>Capture Photo</title>
10
11 <!--import touch css and js -->
12 <link rel="stylesheet" href="resources/css/android.css" type="text/css" />
13
14 <script type="text/javascript" src="js/sencha-touch-all.js"></script>
15
16 <script type="text/javascript" charset="utf-8" src="js/phonegap-1.3.0.js"></script>
17
18 <script type="text/javascript" src="js/LocatCam.js"></script>
19
20 </head>
21
22 <body>
23
24 </body>
25
26 </html>