Removing cruft before restarting the work on the new android API

This commit is contained in:
Joe Bowser 2009-03-26 16:51:19 -07:00
parent 2a38423855
commit 08691b73c2
3 changed files with 1 additions and 65 deletions

View File

@ -15,7 +15,7 @@
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true">
<activity android:name=".DroidGap"

View File

@ -186,13 +186,8 @@ addLoadEvent(initGap);
<ul id="home" title="Main" selected="true">
<li><a href="#system" onclick="updateSettings();return false;">System...</a></li>
<li><a href="#geo" onclick="">Change Location...</a></li>
<li><a href="#readgeo" onclick="readLocation();">Read Location...</a></li>
<li><a href="#setintervals" onclick="">Set user Intervals...</a></li>
<!-- <li><a href="#geo" onclick="updateLocation();">Geo-Location...</a></li> -->
<li><a href="#accel" onclick="updateAccel();">Accelerometer...</a></li>
<li><a href="#vibration" onclick="Device.vibrate();">Vibration</a></li>
<li><a href="#vibration" onclick="Device.playSound('on.mp3")">Play Sound</a></li>
<li><a href="#photo" onclick="Device.Image.getFromPhotoLibrary();">Photo...</a></li>
<li><a href="#audio" onclick="audio();">Audio...</a></li>
<li><a href="#notification" onclick="notification();">Notification...</a></li>

View File

@ -114,65 +114,6 @@ public class PhoneGap{
});
}
public void playSound(final String filename)
{
MediaPlayer mp = new MediaPlayer();
try {
// MediaServer does not allow reading of urls out of app data folder
// thus we grab raw file and submit via file descriptor
// instead
// InputStream is = mCtx.getAssets().open(filename);
// work around cannot play audio streams
// to get around security restriction on MediaPlayer
// until Android sdk 1.1
// thus these changes and the playSound js
// needs moved to Dev.x so that we can if statement out
// via the sdk number
if(getSDKVersion() == "1")
{
// The hack way audio stored in R.raw.filename
// and we if statement check our way through
// to match the window.DroidGap.playSound(filename.mp3)
////call on the html side
int oursound;
if (filename == "bird.mp3") {
mp.create(mCtx, R.raw.bird);
}
if (filename == "on.mp3") {
mp.create(mCtx, R.raw.on);
}
if (filename == "off.mp3"){
mp.create(mCtx, R.raw.off);
}
}
if(getSDKVersion() == "1.1")
{
//TODO: do right way here when Google fixes it
// as we have a security exception preventing
// playing audio file form file:///android_asset/ location
mp.setDataSource("file:///android_asset/" + filename);
mp.prepare();
mp.start();
}
//mp.setDataSource("file:///android_asset/" + filename);
//mp.setDataSource("http://ventrix.nsdc.gr/stuff/TERMITES_SKONH.mp3");
mp.prepare();
mp.start();
} catch (IllegalArgumentException e) {
//TO-DO: Load a Javascript Exception thrower
} catch (IllegalStateException e) {
//TO-DO: Load a Javascript Exception thrower
} catch (IOException e) {
//TO-DO: Load a Javascript Exception thrower
}
}
public String outputText(){
String test = "<p>Test</p>";