Jelly Bean似乎不喜欢maxlength用于文本输入的HTML属性.它肯定会限制输入字符的数量,但是当您尝试键入超出允许的字符数时,文本框将失败.现在,您将无法键入任何其他文本框,也无法在该文本框中删除已输入的字符.
如果您还没有遇到过这种情况,那么请在简单的HTML上自行尝试并检查.请告诉我你是否有解决这个问题的线索.
我有一个应用程序正在播放可在公共URL上获得的MP3文件.不幸的是,服务器不支持流媒体,但Android使用户体验完全可以接受.
除了JellyBean之外,它对所有平台都可以正常工作.在请求MP3时,JB请求范围标题10次.只有在第10次尝试之后,它才会恢复到原来的行为.看起来这已经报道了问题.
我找到了另一个SO线程,推荐的解决方案是使用Tranfer-Encoding:chunked header.但就在下面有评论说这不起作用.
目前我无法控制任何提供上述响应标题,但在我能够做到这一点之前,我想在客户端搜索替代方案.(即便如此,我只能返回包含从0到Content-Length的索引的Content-Range - 1. Ex.Content-Range:bytes 0-3123456/3123457).
我试图做的是通过以下方式在客户端实现伪流:
可以在那里找到进行解码的代码段,我只修改了它以便接收一个InputStream:
public byte[] decode(InputStream inputStream, int startMs, int maxMs) throws IOException {
ByteArrayOutputStream outStream = new ByteArrayOutputStream(1024);
float totalMs = 0;
boolean seeking = true;
try {
Bitstream bitstream = new Bitstream(inputStream);
Decoder decoder = new Decoder();
boolean done = false;
while (!done) {
Header frameHeader = bitstream.readFrame();
if (frameHeader == null) {
done = true;
} else { …Run Code Online (Sandbox Code Playgroud) 我刚刚将Ecipse的ADT插件更新为v21,但重启后它无法正常工作.
不知何故,该插件是版本21.0.0.v201210310015-519525,但SDK验证告诉我,我在v20.2.v201207191942-407447并强迫我更新.
我已经尝试删除插件,但这不可能通过帮助>关于>安装详细信息.恢复旧版安装让我重新安装更新,但结果相同.
我正在使用Eclipse Juno 20120614-1722
任何人都可以指出我解决这个问题的方向吗?
更新:
事实证明,Windows 7 UAC在这里发挥作用.我以为我是以管理员的身份运行eclipse,但我不是.奇怪的是,Eclipse试图安装更新但却没有提及它没有管理权限更改文件的权利.下次启动时,安装认为它已更新但文件不是.
解:
有些设备(如三星Galaxy S3)预先安装了由Vlingo驱动的三星,而不是谷歌语音搜索.
在我的应用程序中,我想以编程方式覆盖要使用的语音识别引擎,以便我的应用程序始终使用Google语音搜索.
所以我的问题是:
帮助将不胜感激
我想开发自定义StatusBar.我知道我不是唯一有此要求的人.但还是想知道意见.
经过对StackOverflow的大量搜索,我发现人们已经使用工具修改了状态栏,但这不是我需要的.
我正在研究自己的状态栏的开发方向,我自己的品牌和系统图标的布局.
此外,我在谷歌游戏商店看到有一个自定义状态栏应用程序,如欧米茄状态栏和更多.我正在寻找相同的实现.我还了解到,这些应用程序安装在非root设备上,我需要的方式并使用"禁用或修改状态栏"权限.
我还为状态栏创建了一些基本布局,但不知道如何进一步制作我的状态栏应用程序并覆盖默认状态栏(Systemui.apk)
总结 - 如何在Android中以编程方式开发自己的状态栏应用程序?
帮助感谢!
我正在玩我的平板电脑并测试我的程序,当有通知表明已经捕获了错误报告以及我是否愿意分享它.之前我没有看过这条消息所以我点击了Yes,然后我在警告对话框中单击了OK,要求我只与我信任的人分享.之后打开了gmail应用程序,其中包含我的平板电脑的屏幕截图,以及附加到其上的文件bugreport<some numbers, date and time I think>.txt.我没有发送错误报告,因为我不确定它是什么以及它会去哪里.不过我的问题是,
这个错误报告究竟是什么?
它是由我测试的代码生成的吗?或者它是由android系统本身生成的?
当我按下硬件按钮时,我是否在不知不觉中触发了某些内容(平板电脑只有3个硬件按钮,音量增大/减小和电量)?
我一直在尝试,但我无法再显示该消息,当我使用我的文件查看器应用程序搜索bug*.txt时,我找不到该文件.哪个附加到错误报告的.txt文件保存在我的平板电脑上?
我试图使用果冻豆释放的新systrace,但没有运气.
我在开发设置中启用了图形和视图跟踪,例如在I/O会话上,并试图调用systrace,我得到的就是这个.
$ ./systrace.py
error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/sched/sched_switch/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/power/cpu_frequency/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/power/cpu_idle/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/buffer_size_kb: No such file or directory (2)
error opening /sys/kernel/debug/tracing/trace_clock: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/workqueue/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/ext4/ext4_sync_file_enter/enable: No …Run Code Online (Sandbox Code Playgroud) 我有一个AccessibilityService,它将读出任何传入的通知.它在ICS及以下版本中运行良好,但已停止使用JB.
以下是清单和代码:
<service
android:name=".Services.InstantMessengerJb"
android:enabled="@bool/is_post_jb"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
tools:ignore="ExportedService" >
<meta-data
android:name="android.accessibilityservice"
android:resource="@xml/accessibility_service_config" />
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>
</service>
Run Code Online (Sandbox Code Playgroud)
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
SettingsClass.logMe(tag, "New event!");
new AccessibilityProcessing(this, event);
}
@Override
protected void onServiceConnected() {
if (isInit) {
return;
}
SettingsClass.logMe(tag, "We are connected!");
AccessibilityServiceInfo info = new AccessibilityServiceInfo();
info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
info.feedbackType = AccessibilityServiceInfo.FEEDBACK_SPOKEN;
setServiceInfo(info);
isInit = true;
}
Run Code Online (Sandbox Code Playgroud)
如前所述,它确实适用于所有preJB设备,如魅力,但在JB上服务启动(我得到"我们已连接"),但没有一个事件被触发.
代码有什么问题吗?
我可以使用httpurlconnection成功连接,发送和接收数据.但是在我的手机(三星s4,4.2)和Android 4.2模拟器上加载所有数据需要很长时间.但是在Android 2.3.x模拟器上加载图片需要大约1-2秒(这是非常快的).在http连接上比我的galaxy s4更快.
我正在使用AsyncTask,我的代码在两者上运行良好.它在android 4.2s上速度很慢.我尝试删除chunkedStreaming,保持活着,更改超时值等但仍然没有成功
这是我的代码
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestMethod("POST");
urlConnection.setDoOutput(true);
urlConnection.setDoInput(true);
urlConnection.setUseCaches(false);
urlConnection.setChunkedStreamingMode(0);
urlConnection.setRequestProperty("Connection", "Keep-Alive");
urlConnection.setConnectTimeout(6000);
urlConnection.setReadTimeout(6000);
urlConnection.setRequestProperty("Content-Type", "multipart/form-data;charset=UTF-8;boundary="+boundary);
urlConnection.connect();
Run Code Online (Sandbox Code Playgroud)
4.2和2.3.x的httpurlconnections之间有什么区别吗?这里错了
UPDATE!
我通过使用Log.e()来测试哪一行占用了大部分时间.
///// other staff
////......
Log.e("HTTP","3");
if (isCancelled())
return (null); // don't forget to terminate this method
Log.e("HTTP","3");
//Output
DataOutputStream outputStream = new DataOutputStream( urlConnection.getOutputStream() );
//Send Passcode
Log.e("HTTP","4");
Run Code Online (Sandbox Code Playgroud)
在3到4之间,线上有5-6秒的传球
DataOutputStream outputStream = new DataOutputStream( urlConnection.getOutputStream() );
Run Code Online (Sandbox Code Playgroud)
UPDATE!
等待时间(参见上一次更新)与urlConnection.setConnectTimeout(6000)相关;
当我使超时1000,然后快速连接响应(等待1秒的线路)
DataOutputStream outputStream = new DataOutputStream( urlConnection.getOutputStream() );
Run Code Online (Sandbox Code Playgroud)
不知道为什么会这样
android httpurlconnection android-2.3-gingerbread android-4.2-jelly-bean
我在我的应用程序中添加了两个按钮,设置为目标API级别8.问题是两个按钮显示为两个大的灰色按钮,与其余通知完全不同.我已经在Nexus 7和Galaxy Nexus上测试了它.

我见过的所有例子都有漂亮的黑色按钮,如来电通知:http: //www.androidng.com/wp-content/uploads/2012/07/android-jelly-bean-notifications.jpeg
我猜这很容易,但今天没有这样的运气.有谁知道我可能走错了路?下面是我的代码片段,它使用最新的支持库生成通知.
NotificationManager nm = (NotificationManager) this
.getSystemService(Context.NOTIFICATION_SERVICE);
android.support.v4.app.NotificationCompat.Builder builder = new android.support.v4.app.NotificationCompat.Builder(this);
builder.setContentIntent(contentIntent)
.setSmallIcon(R.drawable.ic_stat_radio)
.setContentTitle(message)
.setTicker(message)
.setPriority(android.support.v4.app.NotificationCompat.PRIORITY_HIGH)
.setWhen(System.currentTimeMillis())
.setAutoCancel(false)
.addAction(android.R.drawable.ic_btn_speak_now, "Play", contentIntent)
.addAction(android.R.drawable.ic_dialog_map, "Stop", contentIntent)
.setContentText(message);
Notification n = builder.build();
//nm.notify(0, n);
startForeground(1, n);
Run Code Online (Sandbox Code Playgroud)