Skip to main content

Home/ Android Dev/ Group items tagged bug

Rss Feed Group items tagged

Vincent Tsao

How to handle screen orientation change when progress dialog and background thread acti... - 0 views

  • When you switch orientations, Android will create a new View. You're probably getting crashes because your background thread is trying to change the state on the old one. (It may also be having trouble because your background thread isn't on the UI thread) I'd suggest making that mHandler volatile and updating it when the orientation changes.
Vincent Tsao

最封闭的开源系统,话说Android的八宗罪 | ifanr 爱范儿 ♂专注于拇指设备的小众讨论 - 0 views

  • 没错,Google 的移动平台是当前最聪明的利用开源来驱动商业议程的实现
  • 虽然早期饱受质疑,Google 的 Android 移动平台已经在移动行业得到了营运商和手机厂商的广泛支持,仅剩固执的诺基亚。Android 从 08 年的一款机型发展到 10 年的 50 多款,发展之快让绝大多数的业内观察家们吃惊
  • 话说回来,Android 用开源来做市场宣传,非常成功的搅乱了整个行业,导致了诺基亚对 Symbian 的收购以及 Windows Mobile 的全面崩溃(不过译者觉得 iPhone OS 4 的多重任务机制的发布让 WP7 真正成了杯具帝)。不过更重要的是,利用开源的名号和 Google 的魅力,Android 吸引了成千上万的开发者,虽然 Android 并不能让开发者们赚到很多钱,而且 Android 手机的数量不到苹果产品的十分之一(连支持收费的国家都比苹果少6倍)。
  • ...3 more annotations...
  • 进化的速度. Google 对 Android 的创新的速度是移动行业内绝无仅有的,他们在 18 个月里发布了四个大版本。想在 Android 上面做文章的 OEM 厂商只得紧跟 Google 的步伐(这里想起了移动杯具的 OMS),不然就跟不上新功能的发布和 bug 修复。Nexus One、Droid、G1 和其它带有 Google体验应用的手机给 Google 提供了创新的测试场
    • Vincent Tsao
       
      HTC也很杯具,2.1直到几周前才完全ready,而这时2.2也将要井喷了
  • 借用亨利福特在 Model-T 相关的书里的一句话:“任何人都可以自由挑选 Android 的颜色,只要那是黑色”(anyone can have Android in their own colour as long as it’s black)。Android 是一个绝好的商业案例——展现一家公司是如何用开源来赢得关注和社区参与,而且同时保持一个非常严密的商业运作。
  • 手握 Android,Google 的目标是为自己产生收入的服务提供一个稳定的平台。在当前,这个广告生意。但未来,Google 的目标在语音服务(几十亿没有数据服务的用户)和 Google Checkout(比如变成移动领域的 visa 卡)。但不管 Google 的终极目标是什么,我们应该意识到 Android 和 Windows Mobile、Mac OSX 或 PalmOS 相比,并没有开放多少。Android 是用开源来驱动商业议程的最聪明的案例之一。Android 骨子里并没有我们潜意识里所灌输的那么多不作恶思想。
  •  
    关于Android的其他声音,猛的发现还是Hong大哥翻译的
Vincent Tsao

Using the Android Search Dialog | Android Developers - 0 views

  • If your data is stored in a SQLite database on the device, performing a full-text search (using FTS3, rather than a LIKE query) can provide a more robust search across text data and can produce results significantly faster.
  • If your data is stored online, then the perceived search performance might be inhibited by the user's data connection. You might want to display a spinning progress wheel until your search returns.
  • <?xml version="1.0" encoding="utf-8"?><searchable xmlns:android="http://schemas.android.com/apk/res/android"    android:label="@string/app_label"    android:hint="@string/search_hint" ></searchable>
    • Vincent Tsao
       
      这个地方一定要记得在string.xml文件中定义label,并在此处refrence定义好的label key。直接在里面写value是不会work的,得出这个结论我花了2个小时!
    • Vincent Tsao
       
      android:label="@string/app_label" 如果我写成 android:label="test", 铁定不能invoke search,不知道为什么Android要区别对待,我认为这是Android的一个bug
Vincent Tsao

View not attached to window manager-中国网盟有问必答 - 2 views

  • 把pdialog.dismiss()改成pdialog.hide()了,我亲自试验过了的。不过Logcat里面还是有错误信息,不过不会出现FC错误
  • 在用ProgressDialog的时候,用线程关闭的时候会出现这个错误,困扰很旧了。 详细错误信息:java.lang.IllegalArgumentException: View not attached to window manager
Vincent Tsao

一个发布应用需要注意的地方 - China Android Dev | Google Groups - 0 views

  • 我今天说的,无关于功能,也无关于布局,而在于资源命名。 我是这样发现问题的,我的应用《千字文》发布两天内获得了大概600个安装,但是有三个用户说他们无法安装,错误是“安装包没有正确的签名”。用户们的 共同点是他们都是1.5的固件。怎么会出现这样的事情呢?我在发布之前使用我的1.6固件的G2进行测试的,没有在1.5固件上测试过,这是因为我在开 发时功能和布局都是以1.5固件为基准做的,我很有信心不会在1.5上出现异常。于是我尝试在1.5固件的虚拟机上安装我的apk文件,果然遇到了用户 提到的错误。我检查了AndroidManifest.xml文件,miniSDK是3,也没有1.5不支持的配置选项,没问题的。于是Google 之,发现了解决方案。 原来1.5和它之前的固件都有bug,就是对资源文件(asset或者res目录下的文件)的命名解析的不好,具体的错误我也没有仔细看,大概的意思就 是,资源文件的名字和数量的组合和排列有可能会造成某些资源文件无法被解析。我们无法得知哪些名字是无法解析的,也不知道哪些资源文件数量是恰好不能解 析的。我们可以做的,就是在打包之后,发布之前,自己在1.5固件(或之前的固件)上进行安装测试。通过了就好,通不过就尝试改几个资源文件的名字,或 者增加一个或几个dummy文件,再打包,直到测试安装成功。 我的应用就是在我改了一个资源文件的名字之后通过了1.5的安装测试。 希望我说的明白。重点:发布之前,务必在1.5固件上进行测试安装。
    • Vincent Tsao
       
      良子大哥关于平台兼容性的宝贵经验
Vincent Tsao

用google adsense的小心了!!!! - China Android Dev | Google Groups - 0 views

  • google最后给的判决书: Hi, After further review from our abuse team we have confirmed that your account that was closed was modifying the ad behavior which is strictly prohibited as stated in the AdSense policies. These types of violations pose a significant risk to advertisers and for this reason we can no longer work with you through any partnering AdSense account or product offering. This will be the final communication about this issue. Please do not reply to this email as you will not receive a response. Thank you for your understanding. Google AdSense 我们自始至终都不知道原因。
  • 我Google了下 "modifying the ad behavior " 就是指你修改了 Google提供的 adsense js code 或者 sdk 唯一有可能的就是这里了 GoogleAdView adView = (GoogleAdView) activity.findViewById(R.id.ad<http://r.id.ad/> ); if (adView != null) { View vc = adView.getCurrentView(); if (vc instanceof WebView) { ((WebView) vc).destroy(); } View vn = adView.getNextView(); if (vn instanceof WebView) { ((WebView) vn).destroy(); } } 因为用了adsense之后 我们的程序老是crash 从stack trace看是因为Google adsense sdk 引起的. 资源没有释放. 然后去Adsense的那个mail list AFMA 问了 碰到2个都有同样问题的 然后有人给了个code 因为adsense sdk没有destroy ad view  所以要手动destroy下 我们就在每个有ads的activty的 onDestroy 加上这段 就好了 程序没有crash了 结果就被搞了 连负责我们android adsense sales都事先不知道 adsense team就直接把我们封了 还在beta 测试阶段的东西 还有bug  我们只是加了这个保证他资源正常释放不会影响到我们程序 结果就挂了 而且Google的态度巨NX无比 连个申述的途径都没有  只是给了个link类似事后调查
  • 我刚刚给我的sale发了一封信: Hi Sunil, It has been long that I haven't talked to you. I have a question, when I went to the application register page, I found the page layout was changed and some of my apps were gone. For example UK TV Guide, Australia TV Guide, etc. Also, the published status are all "false". I am confused because I am still seeing my ads are clicked in the daily report. Is there anything wrong? I am nervous because I just knew that an AdSense developer's account was disabled without any warning,  and the developers themselves don't know the reason. I don't want that happened on me so I really appreciate your comment. below is the letter in AFMA group. Looking forward to your reply. Thanks. Cheers, Luke 接下来我引用了superdroid的信。看看他怎么说吧。
  • ...1 more annotation...
  • 把这句抄下来了,大家以后小心了。 Ad Behavior AdSense code may not be altered, nor may the standard behavior, targeting or delivery of ads be manipulated in any way that is not explicitly permitted by Google. For instance, clicking Google ads may not result in a new browser window being launched. 我猜是不是可以找google总部投诉一下这个部门
Vincent Tsao

Introducing Droid-Fu for Android: BetterActivity, BetterService and BetterAsy... - 2 views

  • So the basic idea is: launch an AsyncTask making your service call, show a nifty progress dialog while the task thread is running, and have the task’s result be posted back to your activity once it completes. Cool, but what if the user decides to rotate the screen while your task is running? Or a phone call comes in, interrupting your app, and Android decides to kill it? Both these actions will effectively terminateyour activity, and recreate it when resuming (yes, a screen rotation kills your activity, very clever, isn’t it?). Unfortunately, any AsyncTask that was still running now holds a stale reference to your activity, because the restarted activity will be an entirely different object in memory (and it will go through onCreate(), as if the activity had started for the first time). I’m not entirely sure whether AsyncTask will actually post back the data to the old activity object (if it was a weak reference, it may already have been garbage collected), but in any case, your “new” activity will never see it, because it’s a different instance.
    • Vincent Tsao
       
      This situation always raise a FC bug, an alternative solution is IntentService + broadcast 
1 - 7 of 7
Showing 20 items per page