Skip to main content

Home/ Android Dev/ Contents contributed and discussions participated by Vincent Tsao

Contents contributed and discussions participated by Vincent Tsao

Vincent Tsao

Widget(s) and Pending intent - Android Developers | Google Groups - 0 views

  • Then i've tried PendingIntent.FLAG_UPDATE_CURRENT i'm no longer crashing, but it always launches the activity with extras were put in the widget that was updated the last. It looks like pending intent is shared among my widget instances
  • I've changed the call to  PendingIntent pending = PendingIntent.getActivity(context, appWidgetId, intent, PendingIntent.FLAG_UPDATE_CURRENT); Now everything is cool except based on discussions i'm not sure how reliable it'll be . ( Doc says it's not supported yet )
Vincent Tsao

天线续集, 三星旗舰热卖, iPhone 单反, 菜市场的里程碑 | ifanr 爱范儿 ♂专注于拇指设备的小众讨论 - 0 views

  • 三星在移动市场的进步令人瞩目,最近的旗舰 Galaxy S (I9000) 发售短短几周就已经达到了百万销量,三星期望该机型的总销量能够达到一千万部。考虑到这东西售价 600 美元,而且只在有限的国家有售,系统还不是最新,你应该知道乔教主为什么会在新闻发布会上提起韩国公司了吧
    • Vincent Tsao
       
      这款手机值得关注
  • 三星的机海战术在近几年获得了巨大的成功,WM,Android,自身的非智能机系统,Bada 几条腿走路,机型的定位明确,做工质量稳定,以此换来了市场份额的不断攀升,三星给其他厂商带来了很大的压力,不过对于我们消费者来说,竞争是越激烈越好啊
Vincent Tsao

Android开发者必须深入学习的10个应用开源项目 - UU的世界 - 1 views

  •  
    很好的总结
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

Is it possible to update a widget from an Activity? - Android Developers | Google Groups - 0 views

  • An AppWidgetProvider is a BroadcastReceiver. That gives you two possibilities right off the bat: 1. Have it also handle whatever other Intents you were planning on setting up with a separate BroadcastReceiver, or 2. Send an Intent from whatever component you want to the AppWidgetProvider. In other words, don't worry about trying to talk directly to the app widget (which I suspect is impossible) -- just talk to your code that already talks to the app widget.
    • Vincent Tsao
       
      good explanation
  • I update my widget from within my app, when I delete/add entries to a list. To do this, I have a method (updateWidget) and a static String (UPDATE_ACTION). My updateWidget() method sends a broadcast which is received by the widget class and then calls onUpdate() with the appropriate params: private void updateWidget() {                 Intent i = new Intent(this, TVWidget.class);                 i.setAction(TVWidget.UPDATE_ACTION);                 sendBroadcast(i);         } In TVWidget class: @Override         public void onReceive(Context context, Intent intent) {                 String action = intent.getAction();                 if (action != null && action.equals(UPDATE_ACTION)) {                         final AppWidgetManager manager = AppWidgetManager.getInstance (context);                         onUpdate(context, manager,                                         manager.getAppWidgetIds(new ComponentName(                                                         context, TVWidget.class)                                         )                         );                 }                 else {                         super.onReceive(context, intent);                 }         } This seems to work fine.
Vincent Tsao

Mark Murphy | AndroidGuys - 0 views

  • Mark Murphy is the founder of CommonsWare and is the author of _The Busy Coder's Guide to Android Development_, _The Busy Coder's Guide to *Advanced* Android Development_, and _Android Programming Tutorials_.
  •  
    Articles from Mark Murphy
Vincent Tsao

How to disable a button on an appwidget? | Hello Android - 0 views

  • RemoteViews can't manipulate a buttons enabled/disabled state, but it can modify its visibility. So the trick is to have two buttons, the real one, and an other which is designed to look like the real one in disabled state, and change witch one is visible.
  • <Button android:id="@+id/startbutton" android:text="Start" android:visibility="visible"></Button> <Button android:id="@+id/startbutton_disabled" android:text="Start" android:clickable="false" android:textColor="#999999" android:visibility="gone"></Button>   <Button android:id="@+id/stopbutton" android:text="Stop"  android:visibility="gone"></Button> <Button android:id="@+id/stopbutton_disabled" android:text="Stop" android:clickable="false" android:textColor="#999999" android:visibility="visible"></Button>
  • RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.widget); remoteView.setViewVisibility(R.id.startbutton, View.GONE); remoteView.setViewVisibility(R.id.startbutton_disabled, View.VISIBLE); remoteView.setViewVisibility(R.id.stopbutton, View.VISIBLE); remoteView.setViewVisibility(R.id.stopbutton_disabled, View.GONE); AppWidgetManager.getInstance(context).updateAppWidget(appWidgetId, remoteView);
  • ...1 more annotation...
  • RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.widget); remoteView.setViewVisibility(R.id.startbutton, View.VISIBLE); remoteView.setViewVisibility(R.id.startbutton_disabled, View.GONE); remoteView.setViewVisibility(R.id.stopbutton, View.GONE); remoteView.setViewVisibility(R.id.stopbutton_disabled, View.VISIBLE); AppWidgetManager.getInstance(context).updateAppWidget(appWidgetId, remoteView);
Vincent Tsao

Android 2.2 深度功能评测 | ifanr 爱范儿 ♂专注于拇指设备的小众讨论 - 1 views

  • Android 2.2 是一次增补式的更新,但仅靠效率提升一点就让它成为 Android 狂热者的重要升级。提升的响应速度和更平滑的界面过渡大大提升了用户体验。 几个新功能——特别是批量升级——提供了立即可用的明显好处。其它功能,如 SD 卡程序存储和云备份,可能要在 Android 开发者大量应用后才能体现真正的价值。我对云端信息服务特别有兴趣——这应该能够极大的丰富 Android,为程序开发社区开启创新之门。 Google 积极的开发努力将 Android 快速向前推进。和两年前相比,系统更成熟了。2.2 版本新增的 JIT 大大解决了 Android 的效率问题,赋予了它前所未有的竞争力。Google 正在向 3.0 迈进,用户界面似乎会有大革新,我们很有可能看到更多创新
Vincent Tsao

Android Market 应用数量将在本月突破十万大关 | 谷安--谷奥Android专题站 - 0 views

  • 上图是AndroLib.com统计的Android Market应用数量图表,可以看到截至7月1日应用数量已经超过9万大关,按照这个增速计算在7月里Android Market应用数量肯定会突破10万大关。要知道一年前这个数量还不到1万。
Vincent Tsao

谷歌力推低价Android手机的野心_Google Android_cnBeta.COM - 0 views

  • 新闻来源:21世纪网 作者:小刀马
  • 近日,市场又有消息称,谷歌将联合华为推低价Android手机。据悉,谷歌计划在中国和印度推动Android手机软件的发展,它们也试图为当地的开发者们寻找更多的生财之路。而为了吸引开发者们加入到Android操作系统中来,谷歌将提供工具,帮助他们销售产品,如订阅、虚拟货物及其它的形式。同时,谷歌还准备将Android操作系统植入低价手机中,这些手机由华为和 LG电子制造,主要面向亚洲和欧洲,而这两大地区正是诺基亚的腹地
  • Gartner表示,2009年移动广告市场只有10亿美元规模,但2013年将增长到135亿美元。此外,在移动应用上,谷歌落后于苹果。Android只有6.5万个应用程序,而苹果却有将近20万个。Gartner预计,2012年Android将成为全球第二大操作系统,超过苹果的iPhone OS,仅次于诺基亚Symbian
  • ...5 more annotations...
  • 如何才能更快速地让Android进入一个发展的快车道?无疑引入更多的开放者追捧这个系统是非常关键的。这也是苹果iPhone之所以成功的关键所在
  • 为了能够吸引到更多的开发者,谷歌试图帮助开发者通过软件赚更多钱,比如提供更简单的支付方式。
  • 目前大多的Android开发者通过广告赚钱,或者是一次性费用赚钱。如此一来,它们的收入比苹果平台少得多。苹果平台每年光是下载应用的费用就达44亿美元,应用商店每年占比77%,而Android只有9%。这是谷歌的软肋,也是谷歌Android没有苹果系统风靡的原因所在。为此,谷歌希望能打入低端手机市场,获得更多用户的使用,从而刺激Android手机系统的用户基数的增长,再带动第三方软件开发者对这个市场的关注和投入。谷歌也表示,eBay的PayPal已经向Android提供应用程序
  • 低端市场本来是很多制造大鳄并不十分感兴趣的市场,但是中国山寨市场的火爆让人们彻底改变了对这个市场的态度,大量的低端品牌涌入市场,并且获得了强大的生命力,本身就说明市场对该类产品的认可。这是一个非常值得谷歌思索的地方。于是,谷歌开始正式切入这个市场,并积极布局
  • 既然在硬件制造方面,谷歌难以和同类的竞争产品一争高下,那么改弦易张,进行有针对性地市场布局,比如支持更多的厂商推出Android产品,以及支持更多的第三方开发者进入到谷歌的阵营,或许这将是谷歌在移动市场竞争的最有力武器。而低端市场无疑是一个突破口,如果能够获得成功,那将星星之火可以燎原
Vincent Tsao

Creating a Home Screen App Widget on Android - Developer.com - 0 views

  • The Android system reuses Intents that match both action and scheme values—the "extras" values are not compared
    • Vincent Tsao
       
      通过设置不同scheme来区别不同的intent
  • In practice, this means the Intent for each App Widget identifier would actually be the same Intent. Fortunately, the solution is straightforward: define a scheme for your App Widget and use it to define unique Intent instances
  • // make this pending intent unique widgetUpdate.setData( Uri.withAppendedPath(Uri.parse( ImagesWidgetProvider.URI_SCHEME + "://widget/id/"), String.valueOf(appWidgetId)));
Vincent Tsao

Creating a Home Screen App Widget on Android - Developer.com - 0 views

  • onReceive(): The default implementation of this method handles the BroadcastReceiver actions and makes the appropriate calls to the methods shown above. (Warning: A well-documented defect exists that requires the developer to handle certain cases explicitly. See the following note for more information.)
  • Creating a simple App Widget involves several steps: Create a RemoteView, which provides the user interface for the App Widget. Tie the RemoteView to an Activity that implements the AppWidgetProvider interface. Provide key App Widget configuration information in the Android manifest file.
  • An App Widget is basically just a BroadcastReceiver that handles specific actions.
Vincent Tsao

putExtra error on AppWidget - Android Developers | Google Groups - 0 views

  • I am just making some AppWidget and I want to pass some Strings through UpdateView to an Activity. But the Bundle is null. I try this: -Widget.java                       Intent defineIntent = new Intent(context, Visor.class);                        defineIntent.putExtra ("org.rss.androides.post2","artist");                        PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, defineIntent, 0);                        updateViews.setOnClickPendingIntent (R.id.widget, pendingIntent); -Viewer.java           Bundle b = intent.getExtras();                 if (b == null) {                     finish();                     return;                 } b is always null.
  • Remember that PendingIntents aren't keyed using extras: http://groups.google.com/group/android-developers/msg/b296f43ae70c4587 You could hack the extras through by mangling them into Uri parameters, or if you're using a ContentProvider, just point to a specific row.
  • Or use PendingIntent.FLAG_UPDATE_CURRENT; just be careful that each active instance has its own unique Intent.
Vincent Tsao

Handling User Interaction with Android App Widgets - Developer.com - 0 views

  • An App Widget uses a special display control called RemoteViews. Unlike a regular View, a RemoteViews control is designed to display a collection of View controls in another process. Consequently, you can't simply add a button handler because that code would run in your application process, not in the process displaying the RemoteViews object (in this case, the Home Screen process).
  • In order to handle user interaction with an App Widget, the following tasks must be performed: Set a unique click handler for each App Widget control Have the click handler send a command to a registered receiver Process the command received and perform any action necessary Update the App Widget to reflect the changes
Vincent Tsao

Bump Android App Review by AndroidTapp.com | Android Tapp. Android App Reviews - 0 views

  • Bump™ makes sharing photos, contacts, and apps with people as simple as bumping your phones together. Compatible with Android to iPhone too!
  • Bump for Android is an awesome app for quickly exchanging Contact info, Pictures and even Android apps! It’s such an easy way to share information on smartphones running the Bump app. It even works between Android and iPhones, so not just Android to Android or iPhone to iPhone bumps, but a mix of any phone running the app. Many users complain that you can’t Bump music transfers but understand there are legal issues involved there, something I’m sure Bump would not knowingly want to get involved with.
« First ‹ Previous 201 - 220 of 450 Next › Last »
Showing 20 items per page