Skip to content

Commit 04508c0

Browse files
committed
Merge pull request #19 from Shao-Feng/android_service
Enable tinyweb running in android service
2 parents c6a8bc6 + 5807edc commit 04508c0

File tree

18 files changed

+398
-318
lines changed

18 files changed

+398
-318
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ language: android
22
jdk: oraclejdk7
33
android:
44
components:
5-
- build-tools-19.1.0
6-
- android-19
5+
- build-tools-21.0.1
6+
- android-21
77
- extra
88
before_script:
99
- sudo apt-get update

android/AndroidManifest.xml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,34 @@
77
<uses-sdk
88
android:minSdkVersion="8"
99
android:targetSdkVersion="19" />
10-
<uses-permission android:name="android.permission.INTERNET"/>
11-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
12-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
10+
11+
<uses-permission android:name="android.permission.INTERNET" />
12+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
13+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
14+
15+
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
1316

1417
<application
1518
android:allowBackup="true"
1619
android:icon="@drawable/ic_launcher"
1720
android:label="@string/app_name"
18-
android:theme="@style/AppTheme" >
21+
android:launchMode="singleTask" >
1922
<activity
20-
android:name="com.intel.tinywebtestservice.FullscreenActivity"
23+
android:name=".FullscreenActivity"
2124
android:configChanges="orientation|keyboardHidden|screenSize"
22-
android:label="@string/app_name"
23-
android:theme="@style/FullscreenTheme" >
25+
android:label="@string/app_name" >
2426
<intent-filter>
2527
<action android:name="android.intent.action.MAIN" />
2628

2729
<category android:name="android.intent.category.LAUNCHER" />
2830
</intent-filter>
2931
</activity>
32+
33+
<service
34+
android:name=".TinywebService"
35+
android:enabled="true"
36+
android:exported="true" >
37+
</service>
3038
</application>
3139

3240
</manifest>

android/build.gradle

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
}
55

66
dependencies {
7-
classpath 'com.android.tools.build:gradle:1.1.3'
7+
classpath 'com.android.tools.build:gradle:1.3.0'
88
}
99
}
1010

@@ -23,8 +23,8 @@ android {
2323
assets.srcDirs = ['assets']
2424
}
2525
}
26-
compileSdkVersion 19
27-
buildToolsVersion "19.1.0"
26+
compileSdkVersion 21
27+
buildToolsVersion "21.0.1"
2828

2929
if (multiarch) {
3030
productFlavors {
@@ -55,3 +55,8 @@ android {
5555
abortOnError false
5656
}
5757
}
58+
59+
dependencies {
60+
compile 'com.android.support:appcompat-v7:22.1.1'
61+
}
62+

android/gradle.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#systemProp.http.proxyHost=child-prc.intel.com
2+
#systemProp.http.proxyPort=913
3+
#systemProp.https.proxyHost=child-prc.intel.com
4+
#systemProp.https.proxyPort=913
5+
android.useDeprecatedNdk=true
7.48 KB
Loading
50.2 KB
Loading

android/res/layout/activity_fullscreen.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
<LinearLayout
3333
android:id="@+id/fullscreen_content_controls"
34-
style="?buttonBarStyle"
3534
android:layout_width="match_parent"
3635
android:layout_height="wrap_content"
3736
android:layout_gravity="bottom|center_horizontal"
@@ -40,23 +39,20 @@
4039
tools:ignore="UselessParent" >
4140
<Button
4241
android:id="@+id/start_button"
43-
style="?buttonBarButtonStyle"
4442
android:layout_width="0dp"
4543
android:layout_height="wrap_content"
4644
android:layout_weight="1"
4745
android:text="@string/start_button"
48-
android:onClick="startService"/>
46+
android:onClick="startTinywebService"/>
4947
<Button
5048
android:id="@+id/stop_button"
51-
style="?buttonBarButtonStyle"
5249
android:layout_width="0dp"
5350
android:layout_height="wrap_content"
5451
android:layout_weight="1"
5552
android:text="@string/stop_button"
56-
android:onClick="stopService"/>
53+
android:onClick="stopTinywebService"/>
5754
<Button
5855
android:id="@+id/refresh_button"
59-
style="?buttonBarButtonStyle"
6056
android:layout_width="0dp"
6157
android:layout_height="wrap_content"
6258
android:layout_weight="1"
3.34 KB
Loading
2.15 KB
Loading
4.73 KB
Loading

0 commit comments

Comments
 (0)