Skip to content

Commit

Permalink
Add ServiceLayerTester.
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Oct 2, 2013
1 parent 47fc323 commit 651fa20
Show file tree
Hide file tree
Showing 25 changed files with 1,080 additions and 0 deletions.
30 changes: 30 additions & 0 deletions samples/ServiceLayerTester/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gieseckedevrient.android.servicelayertester"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="18" />
<uses-permission android:name="org.simalliance.openmobileapi.SMARTCARD" />

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name="com.gieseckedevrient.android.servicelayertester.MainActivity"
android:label="@string/app_name" android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.gieseckedevrient.android.servicelayertester.TestActivity" android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden">
</activity>

<uses-library android:name="org.simalliance.openmobileapi" android:required="true"/>
</application>

</manifest>
Binary file added samples/ServiceLayerTester/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions samples/ServiceLayerTester/proguard-project.txt
Original file line number Diff line number Diff line change
@@ -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 *;
#}
14 changes: 14 additions & 0 deletions samples/ServiceLayerTester/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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=Giesecke & Devrient GmbH:Open Mobile API (with SL):18
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions samples/ServiceLayerTester/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

<Button
android:id="@+id/discoveryButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:onClick="onClickDiscovery"
android:text="@string/discovery_api" />

<Button
android:id="@+id/authenticationButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/discoveryButton"
android:layout_centerHorizontal="true"
android:onClick="onClickAuthentication"
android:text="@string/auth_provider_api" />

<Button
android:id="@+id/fileviewButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/authenticationButton"
android:layout_centerHorizontal="true"
android:onClick="onClickFileView"
android:text="@string/fileview_provider_api" />

<Button
android:id="@+id/securestorageButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/fileviewButton"
android:layout_centerHorizontal="true"
android:onClick="onClickSecureStorageProvider"
android:text="@string/secure_storage_api" />

<Button
android:id="@+id/pkcs15Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/securestorageButton"
android:layout_centerHorizontal="true"
android:onClick="onClickPKCS15"
android:text="@string/pkcs15_api" />

</RelativeLayout>
24 changes: 24 additions & 0 deletions samples/ServiceLayerTester/res/layout/test_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<Button
android:id="@+id/start_test"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:onClick="startTest"
android:text="@string/start_test" />

<TextView
android:id="@+id/log"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/start_test"
android:layout_marginBottom="10dp"
android:text="" />

</RelativeLayout>
9 changes: 9 additions & 0 deletions samples/ServiceLayerTester/res/menu/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

<item
android:id="@+id/menu_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/menu_settings"/>

</menu>
11 changes: 11 additions & 0 deletions samples/ServiceLayerTester/res/values-v11/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<resources>

<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
<!-- API 11 theme customizations can go here. -->
</style>

</resources>
12 changes: 12 additions & 0 deletions samples/ServiceLayerTester/res/values-v14/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<resources>

<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>

</resources>
15 changes: 15 additions & 0 deletions samples/ServiceLayerTester/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">Service Layer Tester</string>
<string name="menu_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="discovery_api">Discovery API</string>
<string name="fileview_provider_api">File Management API</string>
<string name="pkcs15_api">PKCS15 API</string>
<string name="auth_provider_api">Authentication API</string>
<string name="secure_storage_api">Secure Storage API</string>
<string name="end">End</string>
<string name="start_test">Start test</string>

</resources>
20 changes: 20 additions & 0 deletions samples/ServiceLayerTester/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<resources>

<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* Copyright 2013 Giesecke & Devrient GmbH.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

package com.gieseckedevrient.android.servicelayertester;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;

/**
*
* Main activity of the Application.
*/
public class MainActivity extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
// getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}

/**
*
* Method called when Discovery Provider API button is pressed.
*
* @param view View responsible of this event.
*/
public void onClickDiscovery(View view) {
Intent i = new Intent(this, TestActivity.class);
i.putExtra("providerType", ProviderType.DISCOVERY);
startActivity(i);
}

/**
*
* Method called when Secure Storage Provider API button is pressed.
*
* @param view View responsible of this event.
*/
public void onClickSecureStorageProvider(View view) {
Intent i = new Intent(this, TestActivity.class);
i.putExtra("providerType", ProviderType.SECURE_STORAGE);
startActivity(i);
}

/**
*
* Method called when PKCS15 Provider API button is pressed.
*
* @param view View responsible of this event.
*/
public void onClickPKCS15(View view) {
Intent i = new Intent(this, TestActivity.class);
i.putExtra("providerType", ProviderType.PKCS15);
startActivity(i);
}

/**
*
* Method called when File View Provider API button is pressed.
*
* @param view View responsible of this event.
*/
public void onClickFileView(View view) {
Intent i = new Intent(this, TestActivity.class);
i.putExtra("providerType", ProviderType.FILE_MANAGEMENT);
startActivity(i);
}

/**
*
* Method called when Authentication API button is pressed.
*
* @param view View responsible of this event.
*/
public void onClickAuthentication(View view) {
Intent i = new Intent(this, TestActivity.class);
i.putExtra("providerType", ProviderType.AUTHENTICATION);
startActivity(i);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2013 Giesecke & Devrient GmbH.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

package com.gieseckedevrient.android.servicelayertester;

/**
*
* Class used to identify the different types of API Provider Tests.
*
* @author openmobileapis
*
*/
public final class ProviderType {

/** Id used for Discovery Provider API Test. */
public static final int DISCOVERY = 0;
/** Id used for Authentication Provider API Test. */
public static final int AUTHENTICATION = 1;
/** Id used for File View Provider API Test. */
public static final int FILE_MANAGEMENT = 2;
/** Id used for PKCS15 Provider API Test. */
public static final int PKCS15 = 3;
/** Id used for Secure Storage Provider API Test. */
public static final int SECURE_STORAGE = 4;

/**
*
* Constructor of the class.
*
*/
private ProviderType() {
}
}
Loading

0 comments on commit 651fa20

Please sign in to comment.