forked from organicmaps/organicmaps
[android, test] Test dedicated project.
This commit is contained in:
parent
5a460a99b4
commit
f87a0fc96b
14 changed files with 426 additions and 8 deletions
|
@ -38,10 +38,6 @@
|
|||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<!-- Used by instrumentation tests only. Do not include in production apps unless necessary! -->
|
||||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
|
||||
<supports-screens
|
||||
android:largeScreens="true"
|
||||
android:xlargeScreens="true" />
|
||||
|
|
209
android/MapsWithMeTest/AndroidManifest.xml
Normal file
209
android/MapsWithMeTest/AndroidManifest.xml
Normal file
|
@ -0,0 +1,209 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mapswithme.maps.pro"
|
||||
android:installLocation="preferExternal"
|
||||
android:sharedUserId="com.mapswithme"
|
||||
android:sharedUserLabel="@string/shared_user_label"
|
||||
android:versionCode="243"
|
||||
android:versionName="2.4.3" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="7"
|
||||
android:targetSdkVersion="17" />
|
||||
|
||||
<uses-feature
|
||||
android:glEsVersion="0x00020000"
|
||||
android:required="true" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.touchscreen"
|
||||
android:required="true" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.wifi"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.location"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.location.network"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.location.gps"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<!-- Used by instrumentation tests only. Do not include in production apps unless necessary! -->
|
||||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
|
||||
<supports-screens
|
||||
android:largeScreens="true"
|
||||
android:xlargeScreens="true" />
|
||||
|
||||
<application
|
||||
android:name="com.mapswithme.maps.MWMApplication"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/MWMMain" >
|
||||
<activity
|
||||
android:name="com.mapswithme.maps.DownloadResourcesActivity"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="behind"
|
||||
android:theme="@style/MWMMain.NoBar" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- standard "geo" scheme -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" >
|
||||
</action>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:scheme="geo" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" >
|
||||
</action>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:scheme="ge0" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" >
|
||||
</action>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:host="ge0.me"
|
||||
android:scheme="http" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- API CALL -->
|
||||
<intent-filter>
|
||||
<action android:name="com.mapswithme.maps.api.request" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data
|
||||
android:host="*"
|
||||
android:mimeType="application/vnd.google-earth.kmz" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data
|
||||
android:host="*"
|
||||
android:mimeType="application/vnd.google-earth.kml+xml" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data
|
||||
android:host="*"
|
||||
android:pathPattern=".*\\.kmz"
|
||||
android:scheme="file" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data
|
||||
android:host="*"
|
||||
android:pathPattern=".*\\.kml"
|
||||
android:scheme="file" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.mapswithme.maps.MWMActivity"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="behind"
|
||||
android:theme="@style/MWMMain.NoBar" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.mapswithme.maps.DownloadUI"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/download_maps"
|
||||
android:noHistory="true"
|
||||
android:screenOrientation="behind" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.mapswithme.maps.SearchActivity"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/search_map"
|
||||
android:noHistory="true"
|
||||
android:screenOrientation="behind" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.mapswithme.maps.settings.SettingsActivity"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/settings"
|
||||
android:screenOrientation="behind" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.mapswithme.maps.settings.StoragePathActivity"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/maps_storage"
|
||||
android:screenOrientation="behind" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.mapswithme.maps.bookmarks.ChooseBookmarkCategoryActivity"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/bookmark_sets"
|
||||
android:screenOrientation="behind"
|
||||
android:theme="@style/MWMTheme.Dialog.Light"
|
||||
android:windowSoftInputMode="stateUnspecified|adjustResize" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.mapswithme.maps.bookmarks.BookmarkCategoriesActivity"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/bookmarks"
|
||||
android:screenOrientation="behind" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.mapswithme.maps.bookmarks.BookmarkListActivity"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/bookmarks"
|
||||
android:screenOrientation="behind" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.mapswithme.maps.bookmarks.BookmarkActivity"
|
||||
android:configChanges="orientation|screenLayout|screenSize"
|
||||
android:label="@string/bookmarks"
|
||||
android:screenOrientation="behind" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.mapswithme.maps.MapObjectActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="behind" >
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
96
android/MapsWithMeTest/build.xml
Normal file
96
android/MapsWithMeTest/build.xml
Normal file
|
@ -0,0 +1,96 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="MapsWithMePro" default="help">
|
||||
|
||||
<property name="mwm.tools.dir" value="../../tools"/>
|
||||
<property name="mwm.data.dir" value="../../../data"/>
|
||||
<property name="renderscript.opt.level" value="O0"/>
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<property file="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- if sdk.dir was not set from one of the property file, then
|
||||
get it from the ANDROID_HOME env var.
|
||||
This must be done before we load project.properties since
|
||||
the proguard config can use sdk.dir -->
|
||||
<property environment="env" />
|
||||
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
|
||||
<isset property="env.ANDROID_HOME" />
|
||||
</condition>
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
<!--
|
||||
Import per project custom build rules if present at the root of the project.
|
||||
This is the place to put custom intermediary targets such as:
|
||||
-pre-build
|
||||
-pre-compile
|
||||
-post-compile (This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir})
|
||||
-post-package
|
||||
-post-build
|
||||
-pre-clean
|
||||
-->
|
||||
<import file="custom_rules.xml" optional="true" />
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
|
||||
</project>
|
68
android/MapsWithMeTest/custom_rules.xml
Normal file
68
android/MapsWithMeTest/custom_rules.xml
Normal file
|
@ -0,0 +1,68 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="MapsWithMe" default="help">
|
||||
|
||||
<target name="-set-production-mode" depends="android_rules.-set-mode-check">
|
||||
<property name="out.packaged.file" location="${out.absolute.dir}/${ant.project.name}-production-unsigned.apk" />
|
||||
<property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}-production.apk" />
|
||||
<property name="build.is.mode.set" value="true" />
|
||||
|
||||
<!-- record the current build target -->
|
||||
<property name="build.target" value="production" />
|
||||
|
||||
<property name="build.is.instrumented" value="false" />
|
||||
|
||||
<!-- production mode is only valid if the manifest does not explicitly
|
||||
set debuggable to true. default is false. -->
|
||||
<xpath input="AndroidManifest.xml" expression="/manifest/application/@android:debuggable"
|
||||
output="build.is.packaging.debug" default="false"/>
|
||||
|
||||
<!-- signing mode: production -->
|
||||
<property name="build.is.signing.debug" value="false" />
|
||||
|
||||
<if condition="${build.is.packaging.debug}">
|
||||
<then>
|
||||
<echo>*************************************************</echo>
|
||||
<echo>**** Android Manifest has debuggable=true ****</echo>
|
||||
<echo>** Doing DEBUG packaging with PRODUCTION keys ***</echo>
|
||||
<echo>*************************************************</echo>
|
||||
</then>
|
||||
<else>
|
||||
<!-- property only set in release mode.
|
||||
Useful for if/unless attributes in target node
|
||||
when using Ant before 1.8 -->
|
||||
<property name="build.is.mode.release" value="true"/>
|
||||
</else>
|
||||
</if>
|
||||
</target>
|
||||
|
||||
<target name="production" depends="-exclude-text-drules, -set-production-mode,
|
||||
android_rules.-release-obfuscation-check, android_rules.-package, android_rules.-release-prompt-for-password, android_rules.-release-nosign"
|
||||
if="has.keystore" description="Production target - almost the same as release, but with real word config.">
|
||||
<!-- only create apk if *not* a library project -->
|
||||
<do-only-if-not-library elseText="Library project: do not create apk..." >
|
||||
<sequential>
|
||||
<property name="out.unaligned.file" location="${out.absolute.dir}/${ant.project.name}-production-unaligned.apk" />
|
||||
<!-- Signs the APK -->
|
||||
<echo>Signing final apk...</echo>
|
||||
<signjar
|
||||
jar="${out.packaged.file}"
|
||||
signedjar="${out.unaligned.file}"
|
||||
keystore="${key.store}"
|
||||
storepass="${key.store.password}"
|
||||
alias="${key.alias}"
|
||||
keypass="${key.alias.password}"
|
||||
verbose="${verbose}" />
|
||||
|
||||
<!-- Zip aligns the APK -->
|
||||
<zipalign-helper in.package="${out.unaligned.file}"
|
||||
out.package="${out.final.file}" />
|
||||
<echo>Release Package: ${out.final.file}</echo>
|
||||
</sequential>
|
||||
</do-only-if-not-library>
|
||||
<record-build-info />
|
||||
</target>
|
||||
|
||||
<import file="../common_custom_rules.xml"/>
|
||||
|
||||
</project>
|
||||
|
20
android/MapsWithMeTest/proguard-project.txt
Normal file
20
android/MapsWithMeTest/proguard-project.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
# To enable ProGuard in your project, edit project.properties
|
||||
# to define the proguard.config property as described in that file.
|
||||
#
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in ${sdk.dir}/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the ProGuard
|
||||
# include property in project.properties.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
15
android/MapsWithMeTest/project.properties
Normal file
15
android/MapsWithMeTest/project.properties
Normal file
|
@ -0,0 +1,15 @@
|
|||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system edit
|
||||
# "ant.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
#
|
||||
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
|
||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||
|
||||
# Project target.
|
||||
target=android-17
|
||||
android.library.reference.1=..
|
BIN
android/MapsWithMeTest/res/drawable-hdpi/ic_launcher.png
Normal file
BIN
android/MapsWithMeTest/res/drawable-hdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.5 KiB |
BIN
android/MapsWithMeTest/res/drawable-ldpi/ic_launcher.png
Normal file
BIN
android/MapsWithMeTest/res/drawable-ldpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
BIN
android/MapsWithMeTest/res/drawable-mdpi/ic_launcher.png
Normal file
BIN
android/MapsWithMeTest/res/drawable-mdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5 KiB |
BIN
android/MapsWithMeTest/res/drawable-xhdpi/ic_launcher.png
Normal file
BIN
android/MapsWithMeTest/res/drawable-xhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
4
android/MapsWithMeTest/res/values-v13/styles.xml
Normal file
4
android/MapsWithMeTest/res/values-v13/styles.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="MWMMain.NoBar" parent="@android:style/Theme.Holo.Light.NoActionBar"/>
|
||||
</resources>
|
5
android/MapsWithMeTest/res/values/strings.xml
Normal file
5
android/MapsWithMeTest/res/values/strings.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<resources>
|
||||
<string name="app_name">Maps With Me Pro</string>
|
||||
<string name="flurry_app_key">***REMOVED***</string>
|
||||
</resources>
|
5
android/MapsWithMeTest/res/values/styles.xml
Normal file
5
android/MapsWithMeTest/res/values/styles.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<resources>
|
||||
|
||||
<style name="AppTheme" parent="android:Theme.Light" />
|
||||
|
||||
</resources>
|
|
@ -32,17 +32,17 @@ public class SpoonInstrumentationTestRunner extends InstrumentationTestRunner
|
|||
try
|
||||
{
|
||||
// Unlock the device so that the tests can input keystrokes.
|
||||
((KeyguardManager) app.getSystemService(KEYGUARD_SERVICE)) //
|
||||
.newKeyguardLock(simpleName) //
|
||||
((KeyguardManager) app.getSystemService(KEYGUARD_SERVICE))
|
||||
.newKeyguardLock(simpleName)
|
||||
.disableKeyguard();
|
||||
// Wake up the screen.
|
||||
((PowerManager) app.getSystemService(POWER_SERVICE)) //
|
||||
.newWakeLock(FULL_WAKE_LOCK | ACQUIRE_CAUSES_WAKEUP | ON_AFTER_RELEASE, simpleName) //
|
||||
.newWakeLock(FULL_WAKE_LOCK | ACQUIRE_CAUSES_WAKEUP | ON_AFTER_RELEASE, simpleName)
|
||||
.acquire();
|
||||
}
|
||||
catch (SecurityException e)
|
||||
{
|
||||
// because of kinlde we could just have this exception thrown
|
||||
// because of Kinlde we could just have this exception thrown
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue