diff --git a/plugins/.classpath b/plugins/.classpath new file mode 100644 index 00000000..e4bcec4c --- /dev/null +++ b/plugins/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/plugins/.project b/plugins/.project new file mode 100644 index 00000000..5d814ceb --- /dev/null +++ b/plugins/.project @@ -0,0 +1,33 @@ + + + ponygap + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/plugins/AndroidManifest.xml b/plugins/AndroidManifest.xml new file mode 100644 index 00000000..26942144 --- /dev/null +++ b/plugins/AndroidManifest.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/plugins/build.properties b/plugins/build.properties new file mode 100644 index 00000000..edc7f230 --- /dev/null +++ b/plugins/build.properties @@ -0,0 +1,17 @@ +# This file is used to override default values used by the Ant build system. +# +# This file must be checked in Version Control Systems, as it is +# integral to the build system of your project. + +# This file is only used by the Ant script. + +# You can use this to override default values such as +# 'source.dir' for the location of your java source folder and +# 'out.dir' for the location of your output folder. + +# You can also use it define how the release builds are signed by declaring +# the following properties: +# 'key.store' for the location of your keystore and +# 'key.alias' for the name of the key to use. +# The password will be asked during the build when you use the 'release' target. + diff --git a/plugins/build.xml b/plugins/build.xml new file mode 100644 index 00000000..56da6a1f --- /dev/null +++ b/plugins/build.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/libs/phonegap.jar b/plugins/libs/phonegap.jar new file mode 100644 index 00000000..239a443f Binary files /dev/null and b/plugins/libs/phonegap.jar differ diff --git a/plugins/local.properties b/plugins/local.properties new file mode 100644 index 00000000..546578e0 --- /dev/null +++ b/plugins/local.properties @@ -0,0 +1,10 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must *NOT* be checked in Version Control Systems, +# as it contains information specific to your local configuration. + +# location of the SDK. This is only used by Ant +# For customization when using a Version Control System, please read the +# header note. +sdk.dir=/home/bowserj/android-sdk-linux_x86-1.6_r1 diff --git a/plugins/res/layout/main.xml b/plugins/res/layout/main.xml new file mode 100644 index 00000000..633b0d3c --- /dev/null +++ b/plugins/res/layout/main.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/plugins/res/values/strings.xml b/plugins/res/values/strings.xml new file mode 100644 index 00000000..55f1fc2a --- /dev/null +++ b/plugins/res/values/strings.xml @@ -0,0 +1,4 @@ + + + ponygap + diff --git a/plugins/src/com/phonegap/plugins/TtsManager.java b/plugins/src/com/phonegap/plugins/TtsManager.java new file mode 100644 index 00000000..c34adeea --- /dev/null +++ b/plugins/src/com/phonegap/plugins/TtsManager.java @@ -0,0 +1,34 @@ +package com.phonegap.plugins; + +import android.content.Context; +import android.speech.tts.TextToSpeech; +import android.webkit.WebView; + +public class TtsManager { + + TextToSpeech voice; + Context mCtx; + WebView appView; + + TtsManager(WebView view, Context ctx) + { + mCtx = ctx; + appView = view; + voice = new TextToSpeech(mCtx, ttsInitListener); + } + + public void say(String text) + { + voice.speak(text, 1, null); + } + + //I have no idea why you would use this? Do you have predefined speech? + + private TextToSpeech.OnInitListener ttsInitListener = new TextToSpeech.OnInitListener() { + public void onInit(int status) { + + } + }; + + +} diff --git a/plugins/src/com/phonegap/plugins/ponygap.java b/plugins/src/com/phonegap/plugins/ponygap.java new file mode 100644 index 00000000..659ddd2a --- /dev/null +++ b/plugins/src/com/phonegap/plugins/ponygap.java @@ -0,0 +1,21 @@ +package com.phonegap.plugins; + +import android.os.Bundle; + +import com.phonegap.*; + +public class ponygap extends DroidGap +{ + /* Declare plugins here */ + TtsManager tts; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + tts = new TtsManager(super.appView, this); + + super.appView.addJavascriptInterface(tts, "ttsHook"); + } +}