summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.5/samples/store-android
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-05-18 05:20:42 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-05-18 05:20:42 +0000
commit0daf5fae551097b7ab396b3b1c739986eda1208c (patch)
treeae9cbc4e6b87db0f0ca4e3cdcac19ec0002f9649 /branches/sca-java-1.5/samples/store-android
parent8c750d3140ad9cfd8b7af778c50fbbf526a6d198 (diff)
Remove samples not in build
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@775813 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--branches/sca-java-1.5/samples/store-android/.classpath6
-rw-r--r--branches/sca-java-1.5/samples/store-android/.project33
-rw-r--r--branches/sca-java-1.5/samples/store-android/AndroidManifest.xml18
-rw-r--r--branches/sca-java-1.5/samples/store-android/res/drawable/icon.pngbin3180 -> 0 bytes
-rw-r--r--branches/sca-java-1.5/samples/store-android/res/layout/main.xml47
-rw-r--r--branches/sca-java-1.5/samples/store-android/res/values/strings.xml5
-rw-r--r--branches/sca-java-1.5/samples/store-android/src/services/Catalog.java24
-rw-r--r--branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java71
-rw-r--r--branches/sca-java-1.5/samples/store-android/src/services/Item.java51
-rw-r--r--branches/sca-java-1.5/samples/store-android/src/services/ShoppingCartProxy.java68
-rw-r--r--branches/sca-java-1.5/samples/store-android/src/services/json/rpc/JSONRpc.java63
-rw-r--r--branches/sca-java-1.5/samples/store-android/src/store/android/R.java29
-rw-r--r--branches/sca-java-1.5/samples/store-android/src/store/android/catalog.java101
13 files changed, 0 insertions, 516 deletions
diff --git a/branches/sca-java-1.5/samples/store-android/.classpath b/branches/sca-java-1.5/samples/store-android/.classpath
deleted file mode 100644
index ef7c361cff..0000000000
--- a/branches/sca-java-1.5/samples/store-android/.classpath
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/branches/sca-java-1.5/samples/store-android/.project b/branches/sca-java-1.5/samples/store-android/.project
deleted file mode 100644
index 616abf1df0..0000000000
--- a/branches/sca-java-1.5/samples/store-android/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>store-android</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ApkBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/branches/sca-java-1.5/samples/store-android/AndroidManifest.xml b/branches/sca-java-1.5/samples/store-android/AndroidManifest.xml
deleted file mode 100644
index b89d86270a..0000000000
--- a/branches/sca-java-1.5/samples/store-android/AndroidManifest.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="store.android"
- android:versionCode="1"
- android:versionName="1.0.0">
- <application android:icon="@drawable/icon" android:label="@string/app_name">
- <activity android:name=".store"
- android:label="@string/app_name">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-<uses-permission android:name="android.permission.INTERNET"></uses-permission>
-
-</manifest> \ No newline at end of file
diff --git a/branches/sca-java-1.5/samples/store-android/res/drawable/icon.png b/branches/sca-java-1.5/samples/store-android/res/drawable/icon.png
deleted file mode 100644
index 75024841d3..0000000000
--- a/branches/sca-java-1.5/samples/store-android/res/drawable/icon.png
+++ /dev/null
Binary files differ
diff --git a/branches/sca-java-1.5/samples/store-android/res/layout/main.xml b/branches/sca-java-1.5/samples/store-android/res/layout/main.xml
deleted file mode 100644
index f7494f5a3a..0000000000
--- a/branches/sca-java-1.5/samples/store-android/res/layout/main.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@android:id/tabhost"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <TabWidget
- android:id="@android:id/tabs"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
- <FrameLayout
- android:id="@android:id/tabcontent"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
-
-
- <ListView android:id="@+id/ListView01"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- />
-
- <LinearLayout
- android:id="@+id/tab02"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
-
- <ListView android:id="@+id/ListView02"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- />
-
- <TextView
- android:id="@+id/txtTotal"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- />
-
- </LinearLayout>
- </FrameLayout>
- </LinearLayout>
-
-</TabHost>
-
diff --git a/branches/sca-java-1.5/samples/store-android/res/values/strings.xml b/branches/sca-java-1.5/samples/store-android/res/values/strings.xml
deleted file mode 100644
index 02b55ae85a..0000000000
--- a/branches/sca-java-1.5/samples/store-android/res/values/strings.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string name="hello">Hello World, catalog</string>
- <string name="app_name">store</string>
-</resources>
diff --git a/branches/sca-java-1.5/samples/store-android/src/services/Catalog.java b/branches/sca-java-1.5/samples/store-android/src/services/Catalog.java
deleted file mode 100644
index 9105f1047c..0000000000
--- a/branches/sca-java-1.5/samples/store-android/src/services/Catalog.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 services;
-
-public interface Catalog {
- Item[] get();
-}
diff --git a/branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java b/branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java
deleted file mode 100644
index 40aeb6f0ae..0000000000
--- a/branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 services;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import services.json.rpc.JSONRpc;
-
-public class CatalogProxy implements Catalog {
- private static final String jsonRPCServiceURI = "http://192.168.1.102:8080/Catalog";
- private static final String jsonRPCRequest = "{\"id\": 3, \"method\": \"Service.get\", \"params\": []}";
-
- private List<Item> catalog = new ArrayList<Item>();
-
- public CatalogProxy() {
- initialize();
- }
-
- public void initialize() {
- JSONObject json = null;
-
- try {
- json = JSONRpc.invoke(jsonRPCServiceURI, jsonRPCRequest);
-
- if(json == null) {
- return;
- }
-
- JSONArray result = json.getJSONArray("result");
- for(int i = 0; i < result.length(); i++) {
- Item item = new Item();
- item.setName(result.getJSONObject(i).getString("name"));
- item.setPrice(result.getJSONObject(i).getString("price"));
-
- catalog.add(item);
- }
-
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-
- public Item[] get() {
- Item[] catalogArray = new Item[catalog.size()];
- catalog.toArray(catalogArray);
- return catalogArray;
- }
-
-}
diff --git a/branches/sca-java-1.5/samples/store-android/src/services/Item.java b/branches/sca-java-1.5/samples/store-android/src/services/Item.java
deleted file mode 100644
index 27abd4f016..0000000000
--- a/branches/sca-java-1.5/samples/store-android/src/services/Item.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 services;
-
-
-public class Item {
- private String name;
- private String price;
-
- public Item() {
- }
-
- public Item(String name, String price) {
- this.name = name;
- this.price = price;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getPrice() {
- return price;
- }
-
- public void setPrice(String price) {
- this.price = price;
- }
-
-}
diff --git a/branches/sca-java-1.5/samples/store-android/src/services/ShoppingCartProxy.java b/branches/sca-java-1.5/samples/store-android/src/services/ShoppingCartProxy.java
deleted file mode 100644
index 6a3addc55d..0000000000
--- a/branches/sca-java-1.5/samples/store-android/src/services/ShoppingCartProxy.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 services;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.util.Log;
-
-import services.json.rpc.JSONRpc;
-
-public class ShoppingCartProxy {
- private static final String jsonRPCTotalServiceURI = "http://192.168.1.102:8080/ShoppingCart/Total";
- private static final String jsonRPCTotalRequest = "{\"id\": 4, \"method\": \"Service.getTotal\", \"params\": []}";
-
- public Item[] getItems() {
- return null;
- }
-
- public void addItem(Item item) {
-
- }
-
- public void removeItem(Item item) {
-
- }
-
- public void checkOut() {
-
- }
-
- public String getTotal() {
- String total = "";
- JSONObject json = null;
- Log.e("TUSC", "getting total");
-
- try {
- json = JSONRpc.invoke(jsonRPCTotalServiceURI, jsonRPCTotalRequest);
- Log.e("TUSC", "Request OK");
-
- if(json != null) {
- total = json.getString("result");
- Log.e("TUSC", "Total: "+total);
- }
- } catch (JSONException e) {
- Log.e("TUSC",e.getMessage());
- }
-
- return total;
- }
-}
diff --git a/branches/sca-java-1.5/samples/store-android/src/services/json/rpc/JSONRpc.java b/branches/sca-java-1.5/samples/store-android/src/services/json/rpc/JSONRpc.java
deleted file mode 100644
index b5bd1fc905..0000000000
--- a/branches/sca-java-1.5/samples/store-android/src/services/json/rpc/JSONRpc.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 services.json.rpc;
-
-import java.io.IOException;
-
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.util.EntityUtils;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-public class JSONRpc {
-
- protected JSONRpc() {
-
- }
-
- public static JSONObject invoke(String serviceURI, String rpcRequest) throws JSONException{
- HttpClient httpClient = new DefaultHttpClient();
- HttpPost httpPost = new HttpPost(serviceURI);
-
- JSONObject result = null;
- try {
- httpPost.setHeader("Content-Type", "text/xml");
- httpPost.setEntity(new StringEntity(rpcRequest));
-
- HttpResponse httpResponse = httpClient.execute(httpPost);
- if (httpResponse.getStatusLine().getStatusCode() == 200) {
- String jsonResult = EntityUtils.toString(httpResponse.getEntity());
- result = new JSONObject(jsonResult);
- } else {
- String errorMessage = httpResponse.getStatusLine()
- .getReasonPhrase();
- System.out.println(errorMessage);
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return result;
- }
-}
diff --git a/branches/sca-java-1.5/samples/store-android/src/store/android/R.java b/branches/sca-java-1.5/samples/store-android/src/store/android/R.java
deleted file mode 100644
index cb6917a2c4..0000000000
--- a/branches/sca-java-1.5/samples/store-android/src/store/android/R.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* AUTO-GENERATED FILE. DO NOT MODIFY.
- *
- * This class was automatically generated by the
- * aapt tool from the resource data it found. It
- * should not be modified by hand.
- */
-
-package store.android;
-
-public final class R {
- public static final class attr {
- }
- public static final class drawable {
- public static final int icon=0x7f020000;
- }
- public static final class id {
- public static final int ListView01=0x7f050000;
- public static final int ListView02=0x7f050002;
- public static final int tab02=0x7f050001;
- public static final int txtTotal=0x7f050003;
- }
- public static final class layout {
- public static final int main=0x7f030000;
- }
- public static final class string {
- public static final int app_name=0x7f040001;
- public static final int hello=0x7f040000;
- }
-}
diff --git a/branches/sca-java-1.5/samples/store-android/src/store/android/catalog.java b/branches/sca-java-1.5/samples/store-android/src/store/android/catalog.java
deleted file mode 100644
index d2d5ddb97a..0000000000
--- a/branches/sca-java-1.5/samples/store-android/src/store/android/catalog.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 store.android;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import services.Catalog;
-import services.CatalogProxy;
-import services.Item;
-import services.ShoppingCartProxy;
-import android.app.ListActivity;
-import android.os.Bundle;
-import android.util.SparseBooleanArray;
-import android.view.View;
-import android.widget.ArrayAdapter;
-import android.widget.Button;
-import android.widget.ListView;
-
-public class catalog extends ListActivity {
- private Catalog catalogProxy = new CatalogProxy();
- private ShoppingCartProxy shoppingCartProxy = new ShoppingCartProxy();
-
- private String[] getCatalogItems() {
- List<String> catalog = new ArrayList<String>();
-
- for(Item item : catalogProxy.get()) {
- catalog.add(item.getName() + " - " + item.getPrice());
- }
-
- String[] catalogArray = new String[catalog.size()];
- catalog.toArray(catalogArray);
-
- return catalogArray;
- }
-
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
-
- setListAdapter(new ArrayAdapter<String>(this,
- android.R.layout.simple_list_item_multiple_choice, this.getCatalogItems()));
-
- Button addToCart = (Button) findViewById(1);
- /*
- addToCart.setOnClickListener(new View.OnClickListener() {
- public void onCLick(View v) {
- this.
- }
- });
- */
-
-
- final ListView listView = getListView();
-
- listView.setItemsCanFocus(false);
- listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
- }
-
- @Override
- protected void onListItemClick(ListView l, View v, int position, long id) {
- super.onListItemClick(l, v, position, id);
-
- String item = this.getCatalogItems()[position];
- System.out.println("Item clicked : " + item);
-
- System.out.println("Selected items:");
- SparseBooleanArray checkedItems = l.getCheckedItemPositions();
- for(int i = 0; i < checkedItems.size(); i++) {
- if(checkedItems.valueAt(i) == true) {
- System.out.println(">>>" + this.getCatalogItems()[checkedItems.keyAt(i)]);
- }
- }
- System.out.println("Total: " + shoppingCartProxy.getTotal());
-
- //l.getCheckedItemPosition();
- //Intent webIntent = new Intent("android.intent.action.VIEW", Uri.parse("http://192.168.1.104:8080/ShoppingCart/Cart"));
- //startActivity(webIntent);
- }
-
-
-} \ No newline at end of file