Widget update with Context.sendBroadcast()

by Carl » Wed, 04 Nov 2009 17:53:07 GMT


Sponsored Links
 Hello all,


I would like to update my AppWidget only, without interfering with the
other widgets in the system.
I created the following code, but I am not sure it other widgets will
also update, since I am using Context.sendBroadcast().

Intent myWidgetUpdate= new Intent
("android.appwidget.action.APPWIDGET_UPDATE");
myWidgetUpdate.setClassName("com.package.name",
"com.package.name.mywidget");
sendBroadcast(myWidgetUpdate);

In the reference it is written:

sendBroadcast(Intent intent, String receiverPermission)
Broadcast the given intent to all interested BroadcastReceivers...

Does this means that even if I specify the exact class to send the
intent to, other unrelated widgets will also be udpated?

Thank you.

Carl

--



Widget update with Context.sendBroadcast()

by Justin Anderson » Thu, 05 Nov 2009 00:35:12 GMT


 I believe that "interested BroadcastReceivers" means the ones that match the
intent.

Given your sample code it seems to me that only your widget will be updated.

Thanks,
Justin

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------





>


Sponsored Links


Widget update with Context.sendBroadcast()

by Mark Murphy » Fri, 06 Nov 2009 06:47:08 GMT


 


Why not just:

-- bind to the IntentService that is supporting your widget and call a
method on there to update to widget? Or

-- create your own Intent that your AppWidgetProvider listens to in
addition to the official one, and broadcast that custom Intent?

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_Android Programming Tutorials_ Version 1.0 Available!

--



Other Threads

1. Sr. SW Engineer, Java, J2ME, Android, Messaging Middleware Development - Central New Jersey and Dallas, TX

Riccione Resources, the Recruitment Firm with over 24 years
experience, is proud to announce an Embedded Messaging Developer
position.  The ideal candidate is a generalist with a strong
background in messaging software; open-minded and possesses a drive to
learn new things quickly; will work with a team of like-minded
engineers to build advanced messaging middleware components of a next
generation wireless product.

This lab has 2 major goals:
- Research and development of next generation wireless software ,
platforms and solutions for the global marketplace
- Development and commercialization of advanced products for the North
American Market to maintain competitive edge

Responsibilities
- Design and build next-generation Messaging Middleware
- Measure and characterize performance of the middleware, and suitably
improve performance as needed
- Develop abstractions to hide platform specific capabilities
- Be the in-house Guru for various forms of messaging, including
email, text messaging, instant messaging, Visual Voice Mail (VVM), and
social networking protocols
- Travel to overseas offices and customer sites (worldwide) for 1-3
weeks at a time to assist in integration, commercialization activities
- There may be 3-4 such trips per year.

Qualifications
- Senior level software development skills
- Java, J2ME and Android applications or middleware development
- Knowledge of and experience with one or more of the following:
Email protocols such as IMAP, POP3, SMTP, ActiveSync, Lotus Notes;
text messaging protocols such as SMS, MMS, and IMS; Visual Voice Mail
(VVM); instant messaging protocols; social networking APIs for
accessing services such as Facebook, MySpace, Twitter, etc.
- Very strong design and abstraction skills - as it relates to
programming, development of re-usable components etc.
- B.S. Computer Science
Desired but not required:
- Masters degree in CS
- Fluent in C/C++ programming (C++ preferred)

Salary:  $100k - 150k + Bonus Plan

Relocation:  Moving assistance

Email resume to ka...@riccione.com

--

2. Windows 7 + adb driver for G1 -- can't install, because "the best driver" is already installed. Augh.

I seem unable to convince Windows 7 (32-bit) to let me manually
install the driver for my G1. I recall some similar trouble before,
but having looked through previous solutions, this seems -- well,
worse.

Looking through the documentation and bug errors, I can't seem to find
a fully-documented case of this issue. Once I'm satisfied I know
what's going on on the Windows side of things, I'm happy to file the
issue for Android's side.

This was the previously-reported problem in the issues database:
 http://www.***.com/ ;q=adb%20windows%207&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

Steps to produce the problem:
1. Download the SDK drivers (for SDK 3).
2. Set the G1 to debug mode.
3. Connect via USB. Windows reports "USB Device Not Recognized" -- but
that's correct, as I haven't yet pointed it to the drivers.
4. Open Device Manager, find the associated entry for "Unknown
Device" (the one that's the Android).
5. Right click, select Update Driver Software.
6. Select Browse my Computer.
7. Point to the appropriate directory; e.g., C:\android-sdk3\usb_driver
\
8. Windows reports:
The best driver software for your device is already installed.
Windows has determined the driver software for your device is up to
date.
Unknown Device

I've tried:
1. Manually uninstalling the driver in Device Manager.

2. Uninstalling USB Mass Storage and all the drivers associated with
HTC Android using the utility usbdeview, which apparently had worked
for some people.
 http://www.***.com/ 

3. Disabling automatic driver installation in the Group Policy Editor,
as described here:
http://www.{*filter*}ivetips.com/windows-tips/how-to-disable-automatic-driver-installation-in-windows-vista/

... and restarting, and unplugging, and trying again, and nothing
works. Windows is absolutely convinced that it's smarter than me and
its out-of-box drivers are correct, even though they're not.

I'm also using the HTC cable; I know someone had even seen an issue
with that.

I've used this G1 with adb previously under Ubuntu and Windows Vista.

These are the kind of USB driver issues on Windows that make me go
absolutely bonkers (and I've even occasionally chatted with Microsoft
engineers about them, which didn't make me feel any better). Anyone
have any idea how to force this driver to install?

-- 

3. Interrupting the app uninstaller

4. How to set target in eclipse at the time of creating AVD.

5. android-sdk sans gui

6. Trouble setting up SDK on ubuntu 9.10

7. installing and using android in a multi-user environment