diff options
Diffstat (limited to 'branches/sca-java-1.x/samples/calculator-android/src/calculator/android')
-rw-r--r-- | branches/sca-java-1.x/samples/calculator-android/src/calculator/android/CalculatorClient.class | bin | 0 -> 920 bytes | |||
-rw-r--r-- | branches/sca-java-1.x/samples/calculator-android/src/calculator/android/CalculatorClient.java | 77 | ||||
-rw-r--r-- | branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$attr.class | bin | 0 -> 340 bytes | |||
-rw-r--r-- | branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$drawable.class | bin | 0 -> 400 bytes | |||
-rw-r--r-- | branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$layout.class | bin | 0 -> 394 bytes | |||
-rw-r--r-- | branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$string.class | bin | 0 -> 427 bytes | |||
-rw-r--r-- | branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R.class | bin | 0 -> 489 bytes | |||
-rw-r--r-- | branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R.java | 23 |
8 files changed, 100 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/CalculatorClient.class b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/CalculatorClient.class Binary files differnew file mode 100644 index 0000000000..20b588f972 --- /dev/null +++ b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/CalculatorClient.class diff --git a/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/CalculatorClient.java b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/CalculatorClient.java new file mode 100644 index 0000000000..2bc8b3eb1d --- /dev/null +++ b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/CalculatorClient.java @@ -0,0 +1,77 @@ +package calculator.android; + +import java.net.URL; + +import org.apache.tuscany.sca.contribution.Contribution; +import org.apache.tuscany.sca.contribution.service.ContributionService; +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; + +import android.app.Activity; +import android.os.Bundle; +import android.widget.TextView; +import calculator.CalculatorService; + +public class CalculatorClient extends Activity { + private EmbeddedSCADomain domain; + private CalculatorService calculatorService; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + String calculationResult = "Error !"; + try { + + SCADomain scaDomain = SCADomain.newInstance("Calculator.composite"); + + CalculatorService calculatorService = + scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent"); + + // Calculate + System.out.println("3 + 2=" + calculatorService.add(3, 2)); + System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); + System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); + System.out.println("3 / 2=" + calculatorService.divide(3, 2)); + + scaDomain.close(); + + } catch(Exception e) { + e.printStackTrace(); + } + + + + TextView tv = new TextView(this); + tv.setText("3 + 2 =" + calculationResult); + setContentView(tv); + + } + + @Override + protected void onDestroy() { + super.onDestroy(); + + try { + //scaDomain.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public void onContentChanged() { + super.onContentChanged(); + /* + // Calculate + System.out.println("3 + 2=" + calculatorService.add(3, 2)); + System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); + System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); + System.out.println("3 / 2=" + calculatorService.divide(3, 2)); + */ + + } + + +}
\ No newline at end of file diff --git a/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$attr.class b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$attr.class Binary files differnew file mode 100644 index 0000000000..4d7e121ddc --- /dev/null +++ b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$attr.class diff --git a/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$drawable.class b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$drawable.class Binary files differnew file mode 100644 index 0000000000..842aa47958 --- /dev/null +++ b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$drawable.class diff --git a/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$layout.class b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$layout.class Binary files differnew file mode 100644 index 0000000000..2b7eadeac8 --- /dev/null +++ b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$layout.class diff --git a/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$string.class b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$string.class Binary files differnew file mode 100644 index 0000000000..fd104e6c86 --- /dev/null +++ b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R$string.class diff --git a/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R.class b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R.class Binary files differnew file mode 100644 index 0000000000..7bca04a8a4 --- /dev/null +++ b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R.class diff --git a/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R.java b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R.java new file mode 100644 index 0000000000..a338c98c3a --- /dev/null +++ b/branches/sca-java-1.x/samples/calculator-android/src/calculator/android/R.java @@ -0,0 +1,23 @@ +/* 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 calculator.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 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; + } +} |