手机移动端开发问题sencha touch 和phonegap结合实现语音记录如何实现问题 phonegapsencha手机移动 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Android安卓移动开发 42569436 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="0.39" android:orientation="vertical" > <WebView android:id="@+id/appView" android:layout_width="fill_parent" android:layout_height="match_parent" /> <Button android:id="@+id/recordbutton" android:layout_width="fill_parent" android:layout_height="wrap_content" android:ems="10" android:focusableInTouchMode="true" android:gravity="center" android:keepScreenOn="true" android:text="按住说话" android:textColor="#fff" android:textSize="18sp" android:layout_gravity="bottom" /> </FrameLayout></LinearLayout> document.getElementById("recordBtn").addEventListener('click',function(e){ e.preventDefault(); var screenHeight = document.body.clientHeight; console.log(screenHeight); var buttonVar = "<div style='z-index: 3010;top: 397px;left: 0px;right: 0px;bottom: 0px;position: absolute;opacity: 1.3;background: #222;'><input id='lis' type='button' value='按住说话'/></div>"; document.body.innerHTML = document.body.innerHTML + buttonVar; document.getElementById("lis").addEventListener('touchstart' , function(e) { e.preventDefault(); console.log("start record "); // 开始录制音频 mediaRec.startRecord(); // 10秒钟后停止录制 var recTime = 0; var recInterval = setInterval(function() { recTime = recTime + 1; console.log("start record "+ recTime + "sec"); //setAudioPosition(recTime + " sec"); if (recTime >= 5) { console.log("end record "+ recTime + "sec"); clearInterval(recInterval); mediaRec.stopRecord(); } }, 1000); }); document.getElementById("lis").addEventListener('touchmove' , function(e) { e.preventDefault(); }); document.getElementById("lis").addEventListener('touchend' , function(e) { e.preventDefault(); console.log("end record "); mediaRec.stopRecord(); }); }); appView.setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View arg0) { return true; } }); PC客户端与Android服务端的USB同步通信 哪位能告诉一下,在ubuntu安装gitolite时,在最后一步骤gl-setup为什么失败? 网站客户端怎么做? CSDN中国移动开发者大会,有同去的请联系我 如何判断虚拟键盘状态 请教怎么绘制实时地图 为什么android不用swing的控件 AlertDialog中执行调用消息机制操作意外停止!!!!????? 新人求教,android要掌握到什么程度可以出去找工作 求一段动态添加imageview的代码 如何获取三星公司某一款手机的android源码 在WebView中通过flash插件播放swf文件,如何得到播放结束事件
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" > <FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.39"
android:orientation="vertical" > <WebView
android:id="@+id/appView"
android:layout_width="fill_parent"
android:layout_height="match_parent" /> <Button
android:id="@+id/recordbutton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:focusableInTouchMode="true"
android:gravity="center"
android:keepScreenOn="true"
android:text="按住说话"
android:textColor="#fff"
android:textSize="18sp"
android:layout_gravity="bottom"
/> </FrameLayout></LinearLayout>
document.getElementById("recordBtn").addEventListener('click',function(e){
e.preventDefault();
var screenHeight = document.body.clientHeight;
console.log(screenHeight);
var buttonVar = "<div style='z-index: 3010;top: 397px;left: 0px;right: 0px;bottom: 0px;position: absolute;opacity: 1.3;background: #222;'><input id='lis' type='button' value='按住说话'/></div>";
document.body.innerHTML = document.body.innerHTML + buttonVar;
document.getElementById("lis").addEventListener('touchstart' , function(e) {
e.preventDefault();
console.log("start record ");
// 开始录制音频
mediaRec.startRecord();
// 10秒钟后停止录制
var recTime = 0;
var recInterval = setInterval(function() {
recTime = recTime + 1;
console.log("start record "+ recTime + "sec");
//setAudioPosition(recTime + " sec");
if (recTime >= 5) {
console.log("end record "+ recTime + "sec");
clearInterval(recInterval);
mediaRec.stopRecord();
}
}, 1000);
});
document.getElementById("lis").addEventListener('touchmove' , function(e) {
e.preventDefault();
}); document.getElementById("lis").addEventListener('touchend' , function(e) {
e.preventDefault();
console.log("end record ");
mediaRec.stopRecord();
});
});
@Override
public boolean onLongClick(View arg0) {
return true;
}
});