wangxl лет назад: 9
Родитель
Сommit
d29786bff6

+ 1 - 1
display-client/AndroidManifest.xml

@ -59,7 +59,7 @@
59 59
            android:name="com.amap.api.v2.apikey"
60 60
            android:value="6afee5dced4c3b3a43c0feb11399bded"/>
61 61
        <activity
62
            android:name="com.ai.mobile.display.MainActivity"
62
            android:name="com.ai.ipu.display.MainActivity"
63 63
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
64 64
            android:label="@string/app_name"
65 65
            android:screenOrientation="portrait"

+ 1 - 1
display-client/assets/mobile-action.xml

@ -131,7 +131,7 @@
131 131
	<action name="screenUnlock" class="com.wade.mobile.func.MobileScreenLock" method="screenUnlock"></action>
132 132

133 133
    <!--OpenApp-->
134
	<action name="openNative" class="com.ai.mobile.func.MobileOpenApp" method="openNative"></action>
134
	<action name="openNative" class="com.ai.ipu.func.MobileOpenApp" method="openNative"></action>
135 135
	
136 136
	<!--ScanQR -->
137 137
	<action name="scanQrCode" class="com.ipu.scan.func.IpuScan" method="scanSingle"></action>

+ 44 - 0
display-client/build.properties

@ -0,0 +1,44 @@
1
#log路径
2
logPath=D:\\123\\build.log
3
4
#工程路径
5
app.source.path=D:\\ipu-work\\android-share\\display-client
6
7
#JDK路径
8
jdk.home=C:\\Program Files (x86)\\Java\\jdk1.6.0_10
9
bin.dir=${jdk.home}\\bin
10
11
#Android SDK路径
12
sdk.home=D:\\Android\\sdk
13
sdk.folder=${sdk.home}\\platforms\\${target}
14
apk.tools=${sdk.home}\\tools
15
android.tools=${sdk.home}\\build-tools\\19.1.0
16
17
#Ant工具路径
18
ant.path=D:\\Program Files\\apache-ant-1.9.4\\lib
19
20
#输出目录
21
output.dir=out
22
23
#App名字
24
appname=display-client
25
#编译的target
26
target=android-19
27
#Android版本
28
android_version=4.4
29
30
#设置签名密钥的存储路径 
31
key.store=${app.source.path}\\display.keystore
32
key.alias=display
33
key.store.password=display
34
key.alias.password=display
35
36
##如果依赖library,设置library的路径##
37
#wade-mobile-common
38
library-1=D:\\ipu-work\\android-share\\wade-mobile-common
39
library-1-libs=${library-1}\\libs
40
#wade-mobile-lib
41
library-2=D:\\ipu-work\\android-share\\wade-mobile-lib
42
library-2-libs=${library-2}\\libs
43
44

+ 90 - 106
display-client/build/build.xml

@ -1,19 +1,10 @@
1 1
<?xml version="1.0" encoding="UTF-8"?>
2 2
<project name="apkTargets" default="zipalign"  basedir=".">
3
	<record name="D:\123\build.log" loglevel="info" append="no" action="start" />
4
	
5
	<!-- 根据本地环境设置变量 -->
6
	<property name="app.source.path" value="D:\quickStart\111\ipu-client" />
7
	<property name="jdk.home" value="C:\Program Files (x86)\Java\jdk1.6.0_10" />
8
	<property name="sdk.home" value="D:\Android\sdk" />
9
	<property name="ant.path" value="D:\Program Files\apache-ant-1.9.4\lib" />
10
	
11
	<!-- 如果依赖library,设置library的路径 -->
12
	<property name="library-1" value="D:\quickStart\111\wade-mobile-common"/>
13
	<property name="library-1-libs" value="${library-1}/libs"/>
14
	
15
	<property name="library-2" value="D:\quickStart\111\wade-mobile-lib"/>
16
	<property name="library-2-libs" value="${library-2}/libs"/>
3
	<!--     指定配置文件      -->  
4
    <property file="build.properties" /> 
5
    
6
    <record name="${logPath}" loglevel="info" append="no" action="start" />
7
17 8
	<!-- 
18 9
		1. 在Target- aapt_gererateR 中添加library 
19 10
		2. 在Target- compile 中添加library 
@ -21,35 +12,6 @@
21 12
		4. 在Target- aapt-package-res 中添加library 
22 13
		5. 在Target- apkbuilder 中添加library 
23 14
	 -->
24
  
25
	<!-- app名字,编译版本 -->
26
	<property name="appname" value="ipu-client" />
27
	<property name="target" value="android-19" />
28
	<property name="android_version" value="4.4" />
29
	
30
	<!-- 设置SDK地路径 -->
31
	<property name="bin.dir" value="${jdk.home}/bin" />
32
	<property name="sdk.folder" value="${sdk.home}/platforms/${target}" />
33
	<property name="apk.tools" value="${sdk.home}/tools" />
34
	<property name="android.tools" value="${sdk.home}/build-tools/19.1.0" />
35
	
36
	<!-- 设置密钥的存储路径 -->
37
	<property name="key.store" value="${app.source.path}/shelomi.keystore" />
38
	<property name="key.alias" value="mykey" />
39
	<property name="key.store.password" value="1234567890" />
40
	<property name="key.alias.password" value="1234567890" />
41
	  
42
	<property name="output.dir" value="out" />
43
44
    <!-- 导入ant指令(If)需要用到第三方jar包ant-contrib.jar -->
45
    <!-- <path id="ant.contrib.lib">
46
        <fileset dir="${ant.path}">
47
            <include name="ant-contrib.jar" />
48
        </fileset>
49
    </path>
50
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
51
        <classpath refid="ant.contrib.lib" />
52
    </taskdef> -->
53 15
54 16
	<!-- 识别编译环境 -->
55 17
	<condition property="exe" value=".exe" else=""><os family="windows" /></condition>
@ -70,51 +32,43 @@
70 32
    <property name="proguard-home" value="${sdk.home}/tools/proguard/lib" />
71 33
72 34
    <!-- some file directory exclude "bin" file, because "bin" file will be changed each loop -->
73
    <property name="outdir-gen" value="gen" />
35
    <property name="gen-dir" value="gen" />
36
    <property name="src-dir" value="src" />
37
    <property name="libs-dir" value="libs" />
74 38
    <property name="resource-dir" value="res" />
75 39
    <property name="asset-dir" value="assets" />
40
    <property name="bin-dir" value="bin" />
76 41
    <property name="manifest-xml" value="AndroidManifest.xml" />
77 42
78
	<property name="srcdir" value="src" />
79
	<property name="srcdir-ospath" value="${basedir}/${srcdir}" />
43
    <!-- 主工程各个目录 -->
44
    <property name="host-gen" value="${basedir}/${gen-dir}" />
45
	<property name="host-src" value="${basedir}/${src-dir}" />
46
	<property name="host-libs" value="${basedir}/${libs-dir}" />
80 47
81
	<property name="external-libs" value="libs" />
82
	<property name="external-libs-ospath" value="${basedir}/${external-libs}" />
83
	
84
	<property name="outdir" value="bin" />
85
	<property name="outdir-classes" value="${outdir}/classes" />
86
	<property name="outdir-classes-ospath" value="${basedir}/${outdir-classes}" />
48
	<property name="host-classes" value="${basedir}/${bin-dir}/classes" />
87 49
88 50
    <property name="dex-file" value="classes.dex" />
89
	<property name="intermediate-dex" value="${outdir}/${appname}/${dex-file}" />
90
	<property name="intermediate-dex-ospath" value="${basedir}/${intermediate-dex}" />
51
	<property name="intermediate-dex" value="${basedir}/${bin-dir}/${appname}/${dex-file}" />
91 52
92 53
    <!-- The final package file to generate -->
93
	<property name="resources-package" value="${outdir}/${appname}/${appname}.ap_" />
94
	<property name="resources-package-ospath" value="${basedir}/${resources-package}" />
95
96
    <!-- The final apk file to generate when use the debug key  -->
97
	<property name="out-debug-package" value="${outdir}/${appname}-debug.apk" />
98
	<property name="out-debug-package-ospath" value="${basedir}/${out-debug-package}" />
54
	<property name="resources-package" value="${basedir}/${bin-dir}/${appname}/${appname}.ap_" />
99 55
	
100
	<property name="out-unsigned-package" value="${outdir}/${appname}/${appname}-unsigned.apk" />
101
	<property name="out-unsigned-package-ospath" value="${basedir}/${out-unsigned-package}" />
56
	<property name="out-unsigned-package" value="${basedir}/${bin-dir}/${appname}/${appname}-unsigned.apk" />
102 57
	
103
	<property name="out-signed-package" value="${outdir}/${appname}/${appname}-signed.apk" />
104
	<property name="out-signed-package-ospath" value="${basedir}/${out-signed-package}" />
58
	<property name="out-signed-package" value="${basedir}/${bin-dir}/${appname}/${appname}-signed.apk" />
105 59
	
106
	<property name="zipalign-package-ospath" value="${basedir}/${output.dir}/${appname}_for_android_${android_version}_${output.dir}.apk" />
60
	<property name="zipalign-package" value="${basedir}/${output.dir}/${appname}_for_android_${android_version}_${output.dir}.apk" />
107 61
	
108 62
109 63
	<!--1 初始化-->
110 64
	<target name="init">
111
		<delete dir="${outdir-gen}" />
112
		<delete dir="${outdir}" />
65
		<delete dir="${host-gen}" />
66
		<delete dir="${bin-dir}" />
113 67
		<delete file="${basedir}/proguardMapping.txt" />
114 68
		
115
		<mkdir dir="${outdir-gen}" />
116
		<mkdir dir="${outdir-classes}" />
117
		<mkdir dir="${outdir}/${appname}" />
69
		<mkdir dir="${host-gen}" />
70
		<mkdir dir="${host-classes}" />
71
		<mkdir dir="${bin-dir}/${appname}" />
118 72
		<mkdir dir="${basedir}/${output.dir}" />
119 73
	</target>
120 74
@ -124,7 +78,7 @@
124 78
			<arg value="package" />
125 79
			<arg value="-m" />
126 80
			<arg value="-J" />
127
			<arg value="${outdir-gen}" />
81
			<arg value="${host-gen}" />
128 82
			<arg value="-M" />
129 83
			<arg value="${manifest-xml}" />
130 84
			<arg value="-S" />
@ -132,10 +86,10 @@
132 86
			<!-- 同时需要调用Library的res -->
133 87
			<arg value="-S" />
134 88
			<arg value="${library-1}/${resource-dir}" /><!-- 注意点:同时需要调用Library的res-->
135
			
89
136 90
			<arg value="-S" />
137 91
			<arg value="${library-2}/${resource-dir}" />
138
			      
92
139 93
			<arg value="-I" />
140 94
			<arg value="${android-jar}" />
141 95
			<arg value="--auto-add-overlay" /> <!-- 这个重要,覆盖资源,不然报错-->
@ -157,7 +111,7 @@
157 111
            <arg value="-I" />
158 112
            <arg value="${android-jar}" />
159 113
        </exec>
160
        
114
161 115
        <!-- 编译Libray2 的R文件 -->
162 116
        <exec executable="${aapt}" failonerror="true">
163 117
            <arg value="package" />
@ -181,9 +135,9 @@
181 135
  	<target name="aidl" depends="aapt_gererateR">
182 136
    	<apply executable="${aidl}" failonerror="true">
183 137
            <arg value="-p${android-framework}" />
184
            <arg value="-I${t-srcdir}" />
185
            <arg value="-o${outdir-gen}" />
186
            <fileset dir="${t-srcdir}">
138
            <arg value="-I${host-t-src}" />
139
            <arg value="-o${host-gen}" />
140
            <fileset dir="${host-t-src}">
187 141
                <include name="**/*.aidl" />
188 142
            </fileset>
189 143
        </apply>
@ -192,7 +146,7 @@
192 146
	<!--4 编译java文件为class文件-->
193 147
	<target name="compile" depends="aidl">
194 148
		<path id="project.libs">
195
	        <fileset dir="${external-libs}">
149
	        <fileset dir="${libs-dir}">
196 150
	            <include name="*.so" />
197 151
	            <include name="**/*.so" />
198 152
	            <include name="*/*.so" />
@ -222,12 +176,12 @@
222 176
	    </path>
223 177
	    
224 178
		<javac debug="true" extdirs="" srcdir="." includeantruntime="on" 
225
	         destdir="${outdir-classes}" bootclasspath="${android-jar}" encoding="UTF-8">
179
	         destdir="${host-classes}" bootclasspath="${android-jar}" encoding="UTF-8">
226 180
	          <compilerarg line="-encoding UTF-8 " />
227
	          <src path="${library-1}/${srcdir}" /><!-- Library1的src文件 -->
228
	          <src path="${library-2}/${srcdir}" /><!-- Library2的src文件 -->
229
	          <src path="${t-srcdir}" />
230
	          <src path="${outdir-gen}" />
181
	          <src path="${library-1}/${src-dir}" /><!-- Library1的src文件 -->
182
	          <src path="${library-2}/${src-dir}" /><!-- Library2的src文件 -->
183
	          <src path="${host-t-src}" />
184
	          <src path="${host-gen}" />
231 185
			  <!-- jar文件 -->          
232 186
	          <classpath refid="library-1.libs" />
233 187
	          <classpath refid="library-2.libs" />
@ -237,7 +191,7 @@
237 191
	  
238 192
	<!--5 混淆-->
239 193
	<target name="obfuscate" depends="compile">
240
		<jar basedir="${outdir-classes}" destfile="temp.jar" />
194
		<jar basedir="${host-classes}" destfile="temp.jar" />
241 195
	
242 196
		<java jar="${proguard-home}/proguard.jar" fork="true" failonerror="true">
243 197
	        <jvmarg value="-Dmaximum.inlined.code.length=32" />
@ -248,22 +202,22 @@
248 202
	        <arg value="@proguard-project.txt" />
249 203
		</java>
250 204
	    <delete file="temp.jar" />
251
	    <delete dir="${outdir-classes}" />
252
	    <mkdir dir="${outdir-classes}" />
253
		<unzip src="optimized.jar" dest="${outdir-classes}" />
205
	    <delete dir="${host-classes}" />
206
	    <mkdir dir="${host-classes}" />
207
		<unzip src="optimized.jar" dest="${host-classes}" />
254 208
	    <delete file="optimized.jar" />
255 209
	</target>	
256 210
257 211
	<!--6 把class文件转换为dex文件-->
258
	<target name="dex" depends="compile">
212
	<target name="dex" depends="obfuscate">
259 213
	    <echo>Packaging dex...</echo>
260 214
		<apply executable="${dx}" failonerror="true" parallel="true">
261 215
		    <arg value="--dex" />
262
		    <arg value="--output=${intermediate-dex-ospath}" />
263
		    <arg path="${outdir-classes-ospath}" />
264
		    <arg path="${external-libs-ospath}" />
216
		    <arg value="--output=${intermediate-dex}" />
217
		    <arg path="${host-classes}" />
218
		    <arg path="${host-libs}" />
265 219
		    
266
		    <fileset dir="${external-libs}" />
220
		    <fileset dir="${libs-dir}" />
267 221
		    <!-- Library1 -->
268 222
		    <fileset dir="${library-1-libs}" />
269 223
		    <!-- Library2 -->
@ -301,27 +255,27 @@
301 255
302 256
	<!--8 apkbuilder打包成apk文件-->
303 257
	<target name="apkbuilder" depends="aapt-package-res">
304
		<echo>${out-unsigned-package-ospath}</echo>
258
		<echo>${out-unsigned-package}</echo>
305 259
        <exec executable="${apk-builder}" failonerror="true">
306
            <arg value="${out-unsigned-package-ospath}" /><!-- 输出 -->
260
            <arg value="${out-unsigned-package}" /><!-- 输出 -->
307 261
            <arg value="-u" /><!-- 创建未签名的包 -->
308 262
            <arg value="-z" /><!-- 资源压缩包 -->
309
            <arg value="${resources-package-ospath}" />
263
            <arg value="${resources-package}" />
310 264
            <arg value="-f" /><!-- dex文件 -->
311
            <arg value="${intermediate-dex-ospath}" />
265
            <arg value="${intermediate-dex}" />
312 266
            
313 267
            <arg value="-rf" /><!-- Adds the java resources found in that folder -->
314
            <arg value="${srcdir-ospath}" />
268
            <arg value="${host-src}" />
315 269
            
316 270
            <arg value="-nf" /><!-- add native libraries -->
317
            <arg value="${external-libs-ospath}" />
271
            <arg value="${host-libs}" />
318 272
            <arg value="-nf" />
319 273
            <arg value="${library-1-libs}" />
320 274
            <arg value="-nf" />
321 275
            <arg value="${library-2-libs}" />
322 276
            
323 277
            <arg value="-rj" /><!-- Adds the java resources found in the jar file(s) -->
324
            <arg value="${basedir}/${external-libs}" />
278
            <arg value="${host-libs}" />
325 279
            <arg value="-rj" />
326 280
            <arg value="${library-1-libs}" />
327 281
            <arg value="-rj" />
@ -329,6 +283,36 @@
329 283
        </exec>
330 284
    </target>
331 285
    
286
	<target name="apkbuilder2" >
287
	    <java classpath="${apk.tools}/lib/sdklib.jar"
288
	        classname="com.android.sdklib.build.ApkBuilderMain" fork="true" failonerror="true">
289
            <sysproperty key="file.encoding" value="UTF-8" />
290
	        <arg value="${out-unsigned-package}" />
291
	        <arg value="-u" /><!-- 创建未签名的包 -->
292
            <arg value="-z" />
293
            <arg value="${resources-package}" />
294
            <arg value="-f" /><!-- dex文件 -->
295
            <arg value="${intermediate-dex}" />
296
            
297
            <arg value="-rf" /><!-- Adds the java resources found in that folder -->
298
            <arg value="${host-src}" />
299
            
300
            <arg value="-nf" /><!-- add native libraries -->
301
            <arg value="${host-libs}" />
302
            <arg value="-nf" />
303
            <arg value="${library-1-libs}" />
304
            <arg value="-nf" />
305
            <arg value="${library-2-libs}" />
306
            
307
            <arg value="-rj" /><!-- Adds the java resources found in the jar file(s) -->
308
            <arg value="${host-libs}" />
309
            <arg value="-rj" />
310
            <arg value="${library-1-libs}" />
311
            <arg value="-rj" />
312
            <arg value="${library-2-libs}" />
313
	    </java>
314
	</target>
315
	
332 316
	<!--9 签名apk文件-->
333 317
	<target name="jarsigner" depends="apkbuilder">
334 318
        <exec executable="${jarsigner}" failonerror="true">
@ -340,8 +324,8 @@
340 324
            <arg value="-keypass" />
341 325
            <arg value="${key.alias.password}" />
342 326
            <arg value="-signedjar" />
343
            <arg value="${out-signed-package-ospath}" />
344
            <arg value="${out-unsigned-package-ospath}" />
327
            <arg value="${out-signed-package}" />
328
            <arg value="${out-unsigned-package}" />
345 329
            <arg value="${key.alias}" />
346 330
347 331
            <arg value="-digestalg" />
@ -351,16 +335,16 @@
351 335
        </exec>
352 336
    </target>
353 337
    
354
   <!--10 对apk文件进行zipalign对齐-->
338
    <!--10 对apk文件进行zipalign对齐-->
355 339
	<target name="zipalign" depends="jarsigner">
356 340
		<exec executable="${zipalign}" failonerror="true">
357 341
            <arg value="-v" />
358 342
            <arg value="-f" />
359 343
            <arg value="4" />
360
            <arg value="${out-signed-package-ospath}" />
361
            <arg value="${zipalign-package-ospath}" />
344
            <arg value="${out-signed-package}" />
345
            <arg value="${zipalign-package}" />
362 346
        </exec>
363
        <echo>打包完成:${zipalign-package-ospath}</echo>
347
        <echo>打包完成:${zipalign-package}</echo>
364 348
	</target>
365
    
349
366 350
</project>

+ 15 - 73
display-client/proguard-project.txt

@ -1,85 +1,27 @@
1
# This is a configuration file for ProGuard.
2
# http://proguard.sourceforge.net/index.html#manual/usage.html
1
-keeppackagenames
2
-keepattributes Exceptions
3
-keepattributes Signature
4
-keepattributes InnerClasses
5
-keepattributes Deprecated
3 6

4
-dontusemixedcaseclassnames
5
-dontskipnonpubliclibraryclasses
6
-verbose
7

8
# Optimization is turned off by default. Dex does not like code run
9
# through the ProGuard optimize and preverify steps (and performs some
10
# of these optimizations on its own).
11
-dontoptimize
12
-dontpreverify
13
# Note that if you want to enable optimization, you cannot just
14
# include optimization flags in your own project configuration file;
15
# instead you will need to point to the
16
# "proguard-android-optimize.txt" file instead of this one from your
17
# project.properties file.
18

19
-keepattributes *Annotation*
20
-keep public class com.google.vending.licensing.ILicensingService
21
-keep public class com.android.vending.licensing.ILicensingService
22

23
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
24
-keepclasseswithmembernames class * {
25
    native <methods>;
26
}
27

28
# keep setters in Views so that animations can still work.
29
# see http://proguard.sourceforge.net/manual/examples.html#beans
30
-keepclassmembers public class * extends android.view.View {
31
   void set*(***);
32
   *** get*();
33
}
34

35
# We want to keep methods in Activity that could be used in the XML attribute onClick
36
-keepclassmembers class * extends android.app.Activity {
37
   public void *(android.view.View);
38
}
39

40
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
41
-keepclassmembers enum * {
42
    public static **[] values();
43
    public static ** valueOf(java.lang.String);
7
-keep class android.** {
8
	public protected *;
44 9
}
45 10

46
-keep class * implements android.os.Parcelable {
47
  public static final android.os.Parcelable$Creator *;
11
-keep class net.** {
12
	public protected *;
48 13
}
49 14

50
-keepclassmembers class **.R$* {
51
    public static <fields>;
15
-keep class org.** {
16
	public protected *;
52 17
}
53 18

54
# The support library contains references to newer platform versions.
55
# Don't warn about those in case this app is linking against an older
56
# platform version.  We know about them, and they are safe.
57
-dontwarn android.support.**
58
-dontwarn **.**
59

60
-keepclasseswithmembers class *{
61
    public *;
19
-keep public class com.** {
20
	public protected *;
62 21
}
63 22

64
# To enable ProGuard in your project, edit project.properties
65
# to define the proguard.config property as described in that file.
66
#
67
# Add project specific ProGuard rules here.
68
# By default, the flags in this file are appended to flags specified
69
# in ${sdk.dir}/tools/proguard/proguard-android.txt
70
# You can edit the include path and order by changing the ProGuard
71
# include property in project.properties.
72
#
73
# For more details, see
74
#   http://developer.android.com/guide/developing/tools/proguard.html
75

76
# Add any project specific keep options here:
23
-dontoptimize
77 24

78
# If your project uses WebView with JS, uncomment the following
79
# and specify the fully qualified class name to the JavaScript interface
80
# class:
81
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
82
   public *;
83
}
25
-dontwarn **.*
84 26

85 27


+ 67 - 67
display-client/src/com/ai/mobile/display/MainActivity.java

@ -1,67 +1,67 @@
1
package com.ai.mobile.display;
2

3
import android.os.Bundle;
4

5
import com.ai.ipu.mobile.app.AppInfoUtil;
6
import com.ai.ipu.mobile.app.ApplicationManager;
7
import com.ai.ipu.mobile.app.MobileCheck;
8
import com.ai.ipu.mobile.app.MobileOperation;
9
import com.umeng.analytics.MobclickAgent;
10
import com.wade.mobile.app.AppRecord;
11
import com.wade.mobile.frame.activity.TemplateMainActivity;
12
import com.wade.mobile.ui.comp.dialog.ConfirmBlockDialog;
13

14
public class MainActivity extends TemplateMainActivity {
15
	@Override
16
	public void onCreate(Bundle savedInstanceState) {
17
		ApplicationManager.initApplication(getApplication());
18
		if(AppInfoUtil.getOsVersionNumber() > 8){			
19
			setTheme(android.R.style.Theme_Holo_Light_NoActionBar);
20
		}else {
21
			setTheme(android.R.style.Theme_Light);
22
		}
23

24
		if (AppRecord.isFirst(this) && !MobileCheck.checkWifiActive()) {
25
			ConfirmBlockDialog dialog = new ConfirmBlockDialog(this, "下载提醒",
26
					"即将下载应用资源,连接wifi将为您节省流量,是否继续下载");
27
			dialog.show();
28
			
29
			if (dialog.getResult() == ConfirmBlockDialog.Result.OK) {
30
				super.onCreate(savedInstanceState);
31
			} else {
32
				MobileOperation.exitApp();
33
			}
34
		} else {
35
			super.onCreate(savedInstanceState);
36
		}
37
	}
38
	
39
	@Override
40
	protected LoadingDialogStyle getLoadingDialogStyle() {
41
		// TODO Auto-generated method stub
42
		return LoadingDialogStyle.HORIZONTAL;
43
	}
44
	
45
	@Override
46
	protected void onResume() {
47
		// TODO Auto-generated method stub
48
		super.onResume();
49
		//Umeng统计
50
		MobclickAgent.onResume(this);
51
	}
52
	
53
	@Override
54
	protected void onPause() {
55
		// TODO Auto-generated method stub
56
		super.onPause();
57
		//Umeng统计
58
		MobclickAgent.onPause(this);
59
	}
60
	
61
//	@Override
62
//	protected void initActivity() throws Exception {
63
//		MobileScreenLock plugin = getPluginManager().getPlugin(
64
//				MobileScreenLock.class);
65
//		plugin.screeUnlock("0", "Index");
66
//	}
67
}
1
package com.ai.ipu.display;
2
3
import android.os.Bundle;
4
5
import com.ai.ipu.mobile.app.AppInfoUtil;
6
import com.ai.ipu.mobile.app.ApplicationManager;
7
import com.ai.ipu.mobile.app.MobileCheck;
8
import com.ai.ipu.mobile.app.MobileOperation;
9
import com.umeng.analytics.MobclickAgent;
10
import com.wade.mobile.app.AppRecord;
11
import com.wade.mobile.frame.activity.TemplateMainActivity;
12
import com.wade.mobile.ui.comp.dialog.ConfirmBlockDialog;
13
14
public class MainActivity extends TemplateMainActivity {
15
	@Override
16
	public void onCreate(Bundle savedInstanceState) {
17
		ApplicationManager.initApplication(getApplication());
18
		if(AppInfoUtil.getOsVersionNumber() > 8){			
19
			setTheme(android.R.style.Theme_Holo_Light_NoActionBar);
20
		}else {
21
			setTheme(android.R.style.Theme_Light);
22
		}
23
24
		if (AppRecord.isFirst(this) && !MobileCheck.checkWifiActive()) {
25
			ConfirmBlockDialog dialog = new ConfirmBlockDialog(this, "下载提醒",
26
					"即将下载应用资源,连接wifi将为您节省流量,是否继续下载");
27
			dialog.show();
28
			
29
			if (dialog.getResult() == ConfirmBlockDialog.Result.OK) {
30
				super.onCreate(savedInstanceState);
31
			} else {
32
				MobileOperation.exitApp();
33
			}
34
		} else {
35
			super.onCreate(savedInstanceState);
36
		}
37
	}
38
	
39
	@Override
40
	protected LoadingDialogStyle getLoadingDialogStyle() {
41
		// TODO Auto-generated method stub
42
		return LoadingDialogStyle.HORIZONTAL;
43
	}
44
	
45
	@Override
46
	protected void onResume() {
47
		// TODO Auto-generated method stub
48
		super.onResume();
49
		//Umeng统计
50
		MobclickAgent.onResume(this);
51
	}
52
	
53
	@Override
54
	protected void onPause() {
55
		// TODO Auto-generated method stub
56
		super.onPause();
57
		//Umeng统计
58
		MobclickAgent.onPause(this);
59
	}
60
	
61
//	@Override
62
//	protected void initActivity() throws Exception {
63
//		MobileScreenLock plugin = getPluginManager().getPlugin(
64
//				MobileScreenLock.class);
65
//		plugin.screeUnlock("0", "Index");
66
//	}
67
}

+ 21 - 21
display-client/src/com/ai/mobile/display/MainActivity.java.local

@ -1,21 +1,21 @@
1
package com.ai.mobile.display;
2

3
import android.os.Bundle;
4

5
import com.wade.mobile.frame.activity.TemplateMobileActivity;
6
import com.wade.mobile.frame.template.TemplateManager;
7

8
public class MainActivity extends TemplateMobileActivity {
9
	@Override
10
	public void onCreate(Bundle savedInstanceState) {
11
		setTheme(R.style.Theme_Sherlock_Light);
12
		//设置本地的密钥
13
		try {
14
			TemplateManager.initResKey("77777777");
15
		} catch (Exception e) {
16
			// TODO Auto-generated catch block
17
			e.printStackTrace();
18
		}
19
		super.onCreate(savedInstanceState);
20
	}
21
}
1
package com.ai.mobile.display;
2
3
import android.os.Bundle;
4
5
import com.wade.mobile.frame.activity.TemplateMobileActivity;
6
import com.wade.mobile.frame.template.TemplateManager;
7
8
public class MainActivity extends TemplateMobileActivity {
9
	@Override
10
	public void onCreate(Bundle savedInstanceState) {
11
		setTheme(R.style.Theme_Sherlock_Light);
12
		//设置本地的密钥
13
		try {
14
			TemplateManager.initResKey("77777777");
15
		} catch (Exception e) {
16
			// TODO Auto-generated catch block
17
			e.printStackTrace();
18
		}
19
		super.onCreate(savedInstanceState);
20
	}
21
}

+ 51 - 51
display-client/src/com/ai/mobile/display/MainActivity.java.net

@ -1,51 +1,51 @@
1
package com.ai.mobile.display;
2

3
import android.content.pm.ActivityInfo;
4
import android.os.Bundle;
5

6
import com.wade.mobile.app.AppInfoUtil;
7
import com.wade.mobile.app.MobileOperation;
8
import com.wade.mobile.frame.activity.NetMobileActivity;
9
import com.wade.mobile.frame.net.NetWebView;
10
import com.wade.mobile.ui.comp.dialog.ConfirmBlockDialog;
11
import com.wade.mobile.util.Messages;
12

13
public class MainActivity extends NetMobileActivity {
14
	@Override
15
	public void onCreate(Bundle savedInstanceState) {
16
		setTheme(R.style.Theme_Sherlock_Light);
17
		MobileAppInfo appInfo = MobileAppInfo.getInstance(this);
18
		if(appInfo.isTablet()){
19
			setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
20
		}else{
21
			setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
22
		}
23
		super.onCreate(savedInstanceState);
24
	}
25
	
26
	@Override
27
	public void onBackPressed() {
28
		getWadeMobileClient().shutdownByConfirm(Messages.CONFIRM_CLOSE);
29
	}
30
	
31
	@Override
32
	public void loadingError(final NetWebView webView, final int errorCode,
33
			final String description, final String failingUrl) {
34
		MainActivity.this.runOnUiThread(new Runnable() {
35
			@Override
36
			public void run() {
37
				try {
38
					webView.loadAssetHtml("html/welcome.html");
39
				} catch (Exception e) {
40
					e.printStackTrace();
41
				}finally{
42
					ConfirmBlockDialog dialog = new ConfirmBlockDialog(MainActivity.this, "异常", "资源加载异常,请检查网络与防火墙设置。即将退出应用……" , "确定" , null);
43
					dialog.show();
44
					if(dialog.getResult() == ConfirmBlockDialog.Result.OK ){
45
						MobileOperation.exitApp();
46
					}
47
				}
48
			}
49
		});
50
	}
51
}
1
package com.ai.mobile.display;
2
3
import android.content.pm.ActivityInfo;
4
import android.os.Bundle;
5
6
import com.wade.mobile.app.AppInfoUtil;
7
import com.wade.mobile.app.MobileOperation;
8
import com.wade.mobile.frame.activity.NetMobileActivity;
9
import com.wade.mobile.frame.net.NetWebView;
10
import com.wade.mobile.ui.comp.dialog.ConfirmBlockDialog;
11
import com.wade.mobile.util.Messages;
12
13
public class MainActivity extends NetMobileActivity {
14
	@Override
15
	public void onCreate(Bundle savedInstanceState) {
16
		setTheme(R.style.Theme_Sherlock_Light);
17
		MobileAppInfo appInfo = MobileAppInfo.getInstance(this);
18
		if(appInfo.isTablet()){
19
			setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
20
		}else{
21
			setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
22
		}
23
		super.onCreate(savedInstanceState);
24
	}
25
	
26
	@Override
27
	public void onBackPressed() {
28
		getWadeMobileClient().shutdownByConfirm(Messages.CONFIRM_CLOSE);
29
	}
30
	
31
	@Override
32
	public void loadingError(final NetWebView webView, final int errorCode,
33
			final String description, final String failingUrl) {
34
		MainActivity.this.runOnUiThread(new Runnable() {
35
			@Override
36
			public void run() {
37
				try {
38
					webView.loadAssetHtml("html/welcome.html");
39
				} catch (Exception e) {
40
					e.printStackTrace();
41
				}finally{
42
					ConfirmBlockDialog dialog = new ConfirmBlockDialog(MainActivity.this, "异常", "资源加载异常,请检查网络与防火墙设置。即将退出应用……" , "确定" , null);
43
					dialog.show();
44
					if(dialog.getResult() == ConfirmBlockDialog.Result.OK ){
45
						MobileOperation.exitApp();
46
					}
47
				}
48
			}
49
		});
50
	}
51
}

+ 50 - 50
display-client/src/com/ai/mobile/func/MobileOpenApp.java

@ -1,50 +1,50 @@
1
package com.ai.mobile.func;
2

3
import org.json.JSONArray;
4

5
import android.content.ComponentName;
6
import android.content.Intent;
7

8
import com.ai.ipu.mobile.app.MobileCheck;
9
import com.ai.ipu.mobile.app.SimpleUpdate;
10
import com.ailk.common.data.IData;
11
import com.ailk.common.data.impl.DataMap;
12
import com.umeng.analytics.MobclickAgent;
13
import com.umeng.analytics.MobclickAgent.EScenarioType;
14
import com.wade.mobile.frame.IWadeMobile;
15
import com.wade.mobile.frame.plugin.Plugin;
16
import com.wade.mobile.ui.helper.HintHelper;
17

18
public class MobileOpenApp extends Plugin {
19

20
	public MobileOpenApp(IWadeMobile wademobile) {
21
		super(wademobile);
22
		// TODO Auto-generated constructor stub
23
		//集成友盟基本统计分析功能(普通统计模式)
24
		MobclickAgent.setScenarioType(context, EScenarioType.E_UM_NORMAL);
25
	}
26

27
	public void openNative(JSONArray param) throws Exception {
28
		String appStr = param.getString(0);
29
		IData appInfo = new DataMap(appStr);
30
		String packageName = appInfo.getString("packageName", "");
31
		String className = appInfo.getString("className", "");
32
		String downloadUrl = appInfo.getString("downloadUrl", "");
33

34
		if (MobileCheck.checkActivityExist(packageName, className)) {// 应用的Activity是否存在
35
			ComponentName cn = new ComponentName(packageName, className);
36
			Intent intent = new Intent();
37
			intent.setComponent(cn);
38
			startActivityForResult(intent, 0);
39
		} else {
40
			HintHelper.tip(context, "正在下载,请稍后...", 1);
41

42
			/* 如果应用不存在则需要下载,配置需要下载应用 */
43
			SimpleUpdate simpleUpdate = new SimpleUpdate(context, downloadUrl);
44
			simpleUpdate.update();
45

46
		}
47

48
	}
49

50
}
1
package com.ai.ipu.func;
2
3
import org.json.JSONArray;
4
5
import android.content.ComponentName;
6
import android.content.Intent;
7
8
import com.ai.ipu.mobile.app.MobileCheck;
9
import com.ai.ipu.mobile.app.SimpleUpdate;
10
import com.ailk.common.data.IData;
11
import com.ailk.common.data.impl.DataMap;
12
import com.umeng.analytics.MobclickAgent;
13
import com.umeng.analytics.MobclickAgent.EScenarioType;
14
import com.wade.mobile.frame.IWadeMobile;
15
import com.wade.mobile.frame.plugin.Plugin;
16
import com.wade.mobile.ui.helper.HintHelper;
17
18
public class MobileOpenApp extends Plugin {
19
20
	public MobileOpenApp(IWadeMobile wademobile) {
21
		super(wademobile);
22
		// TODO Auto-generated constructor stub
23
		//集成友盟基本统计分析功能(普通统计模式)
24
		MobclickAgent.setScenarioType(context, EScenarioType.E_UM_NORMAL);
25
	}
26
27
	public void openNative(JSONArray param) throws Exception {
28
		String appStr = param.getString(0);
29
		IData appInfo = new DataMap(appStr);
30
		String packageName = appInfo.getString("packageName", "");
31
		String className = appInfo.getString("className", "");
32
		String downloadUrl = appInfo.getString("downloadUrl", "");
33
34
		if (MobileCheck.checkActivityExist(packageName, className)) {// 应用的Activity是否存在
35
			ComponentName cn = new ComponentName(packageName, className);
36
			Intent intent = new Intent();
37
			intent.setComponent(cn);
38
			startActivityForResult(intent, 0);
39
		} else {
40
			HintHelper.tip(context, "正在下载,请稍后...", 1);
41
42
			/* 如果应用不存在则需要下载,配置需要下载应用 */
43
			SimpleUpdate simpleUpdate = new SimpleUpdate(context, downloadUrl);
44
			simpleUpdate.update();
45
46
		}
47
48
	}
49
50
}

wade-mobile-common/res/drawable/nfc_bg.png → wade-mobile-common/res/drawable/nfc_bg.jpg