mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-30 00:00:04 +08:00
Merge branch 'master' of git://github.com/Indeed/phonegap into phonegap2
Conflicts: android/assets/gap.js android/assets/index.html android/bin/DroidGap.apk android/bin/classes.dex android/bin/com/nitobi/phonegap/PhoneGap$1.class android/bin/com/nitobi/phonegap/PhoneGap$2.class android/bin/com/nitobi/phonegap/PhoneGap.class android/bin/resources.ap_ android/src/com/nitobi/phonegap/PhoneGap.java
This commit is contained in:
@@ -307,6 +307,7 @@ var Device = {
|
||||
window.DroidGap.httpGet(url, file);
|
||||
}
|
||||
},
|
||||
|
||||
storage: {
|
||||
result: "",
|
||||
testSDCard: function(){
|
||||
@@ -330,6 +331,30 @@ var Device = {
|
||||
return Device.storage.result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
audio: {
|
||||
startRecording: function(file) {
|
||||
window.DroidGap.startRecordingAudio(file);
|
||||
},
|
||||
stopRecording: function() {
|
||||
window.DroidGap.stopRecordingAudio();
|
||||
},
|
||||
startPlaying: function(file) {
|
||||
window.DroidGap.startPlayingAudio(file);
|
||||
},
|
||||
stopPlaying: function() {
|
||||
window.DroidGap.stopPlayingAudio();
|
||||
},
|
||||
getCurrentPosition: function() {
|
||||
return window.DroidGap.getCurrentPositionAudio();
|
||||
},
|
||||
getDuration: function(file) {
|
||||
return window.DroidGap.getDurationAudio(file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function gotLocation(lat, lon) {
|
||||
|
||||
+63
-1
@@ -105,9 +105,10 @@ function onReceiveSms(number, message)
|
||||
http = function(func)
|
||||
{
|
||||
if (func == 'get') {
|
||||
Device.http.get($('httpGetUrl').value, $('httpGetFile').value)
|
||||
Device.http.get($('httpGetUrl').value, $('httpGetFile').value);
|
||||
}
|
||||
}
|
||||
|
||||
fileManagement = function(x){
|
||||
if (x == 'testSDCard'){
|
||||
$('file_status').value = Device.storage.testSDCard();
|
||||
@@ -125,6 +126,31 @@ fileManagement = function(x){
|
||||
$('file_status').value = Device.storage.delDir($('deldir').value);
|
||||
}
|
||||
}
|
||||
=======
|
||||
|
||||
audio = function(func)
|
||||
{
|
||||
if (func == 'startPlaying') {
|
||||
Device.audio.startPlaying($('audioFile').value);
|
||||
} else
|
||||
if (func == 'stopPlaying') {
|
||||
Device.audio.stopPlaying();
|
||||
} else
|
||||
if (func == 'startRecording') {
|
||||
Device.audio.startRecording($('audioFile').value);
|
||||
} else
|
||||
if (func == 'stopRecording') {
|
||||
Device.audio.stopRecording();
|
||||
} else
|
||||
if (func == 'getCurrentPosition') {
|
||||
$('posdur').value = Device.audio.getCurrentPosition();
|
||||
} else
|
||||
if (func == 'getDuration') {
|
||||
$('posdur').value = Device.audio.getDuration($('audioFile').value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
addLoadEvent(initGap);
|
||||
@@ -146,6 +172,7 @@ addLoadEvent(initGap);
|
||||
<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>
|
||||
<li><a href="#http" onclick="http();">HTTP...</a></li>
|
||||
<li><a href="#esm" onclick="">External Storage</a></li>
|
||||
@@ -333,4 +360,39 @@ addLoadEvent(initGap);
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="audio" title="audio" class="panel">
|
||||
<h2>Audio</h2>
|
||||
<fieldset>
|
||||
<div class="row">
|
||||
<label>AudioFile:</label>
|
||||
<input type=text name="audioFile" id="audioFile" size=60 maxlength=2048 value="/hullophonegap.mp3" style="width: 30ex"></input>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<div class="row">
|
||||
<a class="button leftButton" type="submit" onclick="audio('startRecording');">startRecording</a>
|
||||
<a class="button blueButton" type="submit" onclick="audio('stopRecording');">stopRecording</a>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<div class="row">
|
||||
<a class="button leftButton" type="submit" onclick="audio('startPlaying');">startPlaying</a>
|
||||
<a class="button blueButton" type="submit" onclick="audio('stopPlaying');">stopPlaying</a>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<div class="row">
|
||||
<label>info:</label>
|
||||
<input disabled="enabled" id="posdur" type="text" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<div class="row">
|
||||
<a class="button leftButton" type="submit" onclick="audio('getDuration');">getDuration</a>
|
||||
<a class="button blueButton" type="submit" onclick="audio('getCurrentPosition');">getPosition</a>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="preloader"></div></body></html>
|
||||
|
||||
Reference in New Issue
Block a user