Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9e0f26a

Browse files
committed
Added example app and updated android support library for API 20
1 parent f502b12 commit 9e0f26a

26 files changed

+499
-8
lines changed

.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,15 @@
3030
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
3131
<nature>org.eclipse.jdt.core.javanature</nature>
3232
</natures>
33+
<filteredResources>
34+
<filter>
35+
<id>1404450049798</id>
36+
<name></name>
37+
<type>26</type>
38+
<matcher>
39+
<id>org.eclipse.ui.ide.multiFilter</id>
40+
<arguments>1.0-projectRelativePath-matches-true-false-examples</arguments>
41+
</matcher>
42+
</filter>
43+
</filteredResources>
3344
</projectDescription>

build.gradle

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
buildscript {
2-
repositories {
3-
mavenCentral()
4-
}
5-
dependencies {
6-
classpath 'com.android.tools.build:gradle:0.12.+'
7-
}
8-
}
91
apply plugin: 'android-library'
102

113
dependencies {

examples/app/.classpath

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="src" path="gen"/>
5+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
6+
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
7+
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
8+
<classpathentry kind="output" path="bin/classes"/>
9+
</classpath>

examples/app/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/gen
2+
/bin

examples/app/.project

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>android-upload-service-demo</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.jdt.core.javabuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
31+
<nature>org.eclipse.jdt.core.javanature</nature>
32+
</natures>
33+
</projectDescription>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3+
org.eclipse.jdt.core.compiler.compliance=1.6
4+
org.eclipse.jdt.core.compiler.source=1.6

examples/app/AndroidManifest.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.alexbbb.uploadservice.demo"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-sdk
8+
android:minSdkVersion="10"
9+
android:targetSdkVersion="20" />
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.WAKE_LOCK" />
14+
15+
<application
16+
android:allowBackup="true"
17+
android:icon="@drawable/ic_launcher"
18+
android:label="@string/app_name"
19+
android:theme="@style/AppTheme" >
20+
<activity
21+
android:name="com.alexbbb.uploadservice.demo.MainActivity"
22+
android:screenOrientation="portrait"
23+
android:label="@string/app_name" >
24+
<intent-filter>
25+
<action android:name="android.intent.action.MAIN" />
26+
27+
<category android:name="android.intent.category.LAUNCHER" />
28+
</intent-filter>
29+
</activity>
30+
31+
<service
32+
android:name="com.alexbbb.uploadservice.UploadService"
33+
android:enabled="true"
34+
android:exported="false" >
35+
<intent-filter>
36+
<action android:name="com.alexbbb.uploadservice.action.upload"/>
37+
</intent-filter>
38+
</service>
39+
40+
</application>
41+
42+
</manifest>

examples/app/build.gradle

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apply plugin: 'android'
2+
3+
dependencies {
4+
compile fileTree(dir: 'libs', include: '*.jar')
5+
compile project(':android-upload-service')
6+
compile project(':appcompat_v7')
7+
}
8+
9+
android {
10+
compileSdkVersion 19
11+
buildToolsVersion "20.0.0"
12+
13+
sourceSets {
14+
main {
15+
manifest.srcFile 'AndroidManifest.xml'
16+
java.srcDirs = ['src']
17+
resources.srcDirs = ['src']
18+
aidl.srcDirs = ['src']
19+
renderscript.srcDirs = ['src']
20+
res.srcDirs = ['res']
21+
assets.srcDirs = ['assets']
22+
}
23+
24+
// Move the tests to tests/java, tests/res, etc...
25+
instrumentTest.setRoot('tests')
26+
27+
// Move the build types to build-types/<type>
28+
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
29+
// This moves them out of them default location under src/<type>/... which would
30+
// conflict with src/ being used by the main source set.
31+
// Adding new build types or product flavors should be accompanied
32+
// by a similar customization.
33+
debug.setRoot('build-types/debug')
34+
release.setRoot('build-types/release')
35+
}
36+
}

examples/app/ic_launcher-web.png

273 KB
Loading
741 KB
Binary file not shown.

examples/app/proguard-project.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}

examples/app/project.properties

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system edit
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
#
10+
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11+
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12+
13+
# Project target.
14+
target=android-19
15+
android.library.reference.1=../..
16+
android.library.reference.2=../../../appcompat_v7
10.1 KB
Loading
4.85 KB
Loading
16.4 KB
Loading
32.9 KB
Loading
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:id="@+id/container"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:orientation="vertical"
7+
android:layout_margin="8sp"
8+
tools:context="com.alexbbb.uploadservice.demo.MainActivity" >
9+
10+
<TextView
11+
android:id="@+id/textView3"
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"
14+
android:text="@string/upload_progress" />
15+
16+
<ProgressBar
17+
android:id="@+id/uploadProgress"
18+
style="?android:attr/progressBarStyleHorizontal"
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content" />
21+
22+
<TextView
23+
android:id="@+id/textView1"
24+
android:layout_width="wrap_content"
25+
android:layout_height="wrap_content"
26+
android:paddingTop="10sp"
27+
android:text="@string/server_script_url" />
28+
29+
<EditText
30+
android:id="@+id/serverURL"
31+
android:inputType="textUri"
32+
android:hint="@string/server_url_hint"
33+
android:layout_width="match_parent"
34+
android:layout_height="wrap_content"
35+
android:ems="10" >
36+
37+
<requestFocus />
38+
</EditText>
39+
40+
<TextView
41+
android:id="@+id/textView4"
42+
android:layout_width="wrap_content"
43+
android:layout_height="wrap_content"
44+
android:paddingTop="10sp"
45+
android:text="@string/file_to_upload_path" />
46+
47+
<EditText
48+
android:id="@+id/fileToUpload"
49+
android:inputType="textUri"
50+
android:hint="@string/file_path_hint"
51+
android:layout_width="match_parent"
52+
android:layout_height="wrap_content"
53+
android:ems="10" />
54+
55+
<TextView
56+
android:id="@+id/textView5"
57+
android:layout_width="wrap_content"
58+
android:layout_height="wrap_content"
59+
android:paddingTop="10sp"
60+
android:text="@string/parameter_name" />
61+
62+
<EditText
63+
android:id="@+id/parameterName"
64+
android:inputType="textUri"
65+
android:hint="@string/parameter_name_hint"
66+
android:layout_width="match_parent"
67+
android:layout_height="wrap_content"
68+
android:ems="10" />
69+
70+
<Button
71+
android:id="@+id/uploadButton"
72+
android:layout_width="wrap_content"
73+
android:layout_height="wrap_content"
74+
android:layout_gravity="center_horizontal"
75+
android:text="@string/upload" />
76+
77+
</LinearLayout>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<resources>
2+
3+
<!--
4+
Base application theme for API 11+. This theme completely replaces
5+
AppBaseTheme from res/values/styles.xml on API 11+ devices.
6+
-->
7+
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
8+
<!-- API 11 theme customizations can go here. -->
9+
</style>
10+
11+
</resources>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<resources>
2+
3+
<!--
4+
Base application theme for API 14+. This theme completely replaces
5+
AppBaseTheme from BOTH res/values/styles.xml and
6+
res/values-v11/styles.xml on API 14+ devices.
7+
-->
8+
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
9+
<!-- API 14 theme customizations can go here. -->
10+
</style>
11+
12+
</resources>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<resources>
2+
3+
<!--
4+
Example customization of dimensions originally defined in res/values/dimens.xml
5+
(such as screen margins) for screens with more than 820dp of available width. This
6+
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
7+
-->
8+
<dimen name="activity_horizontal_margin">64dp</dimen>
9+
10+
</resources>

examples/app/res/values/dimens.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<resources>
2+
3+
<!-- Default screen margins, per the Android Design guidelines. -->
4+
<dimen name="activity_horizontal_margin">16dp</dimen>
5+
<dimen name="activity_vertical_margin">16dp</dimen>
6+
7+
</resources>

examples/app/res/values/strings.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<string name="app_name">Upload Service</string>
5+
<string name="upload">Upload</string>
6+
<string name="server_script_url">Server script URL</string>
7+
<string name="file_to_upload_path">Path of the file to upload</string>
8+
<string name="parameter_name">File parameter name</string>
9+
<string name="parameter_name_hint">E.g. uploaded_file</string>
10+
<string name="accept_self_signed_certs">Accept self-signed certificates</string>
11+
<string name="upload_progress">Upload progress</string>
12+
<string name="uploading">Uploading</string>
13+
<string name="upload_success">Upload completed successfully</string>
14+
<string name="upload_error">Error while uploading</string>
15+
<string name="file_does_not_exist">The file to upload does not exist!</string>
16+
<string name="provide_valid_server_url">Please provide a valid server URL</string>
17+
<string name="provide_file_to_upload">Please provide a full path to a file to upload</string>
18+
<string name="provide_param_name">Please provide the name of the form parameter that will contain file\'s data</string>
19+
<string name="server_url_hint">http://company.com/path/to/script</string>
20+
<string name="file_path_hint">/path/to/your/file.ext</string>
21+
22+
</resources>

examples/app/res/values/styles.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<resources>
2+
3+
<!--
4+
Base application theme, dependent on API level. This theme is replaced
5+
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
6+
-->
7+
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
8+
<!--
9+
Theme customizations available in newer API levels can go in
10+
res/values-vXX/styles.xml, while customizations related to
11+
backward-compatibility can go here.
12+
-->
13+
</style>
14+
15+
<!-- Application theme. -->
16+
<style name="AppTheme" parent="AppBaseTheme">
17+
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
18+
</style>
19+
20+
</resources>

0 commit comments

Comments
 (0)