Problem configuring the app widget with bitmap image using remote views

by teddy » Tue, 10 Nov 2009 02:05:51 GMT


Sponsored Links
 Hi,

I started with developing the resizable photo widget.
Every time the widget is resized, i am configuring the widget remote
view with the new bitmap image.
I am using the same layout file for all resize dimensions with
fillparent option for both width and height.

But i am facing issues with this, for 4x4 widget size, even if i
configure the remote view with valid bitmap, the image is seen cropped
on the homeScreen. And sometimes the new bitmap which is set to the
remote views will not be seen and instead the old bitmap remains on
the screen.
Is the appwidgetManager discarding the updates????

Also, as the APP_WIDGET_UPDATE broadcast wecan get the new dimensions
of widget in terms of cells.
 can anyone tell,  how to map the cell values into pixel values(WVGA
screen) ????????

Any kind of help is appreciable.

Thanks..

--



Problem configuring the app widget with bitmap image using remote views

by teddy » Tue, 10 Nov 2009 02:06:04 GMT


 Hi,

I started with developing the resizable photo widget.
Every time the widget is resized, i am configuring the widget remote
view with the new bitmap image.
I am using the same layout file for all resize dimensions with
fillparent option for both width and height.

But i am facing issues with this, for 4x4 widget size, even if i
configure the remote view with valid bitmap, the image is seen cropped
on the homeScreen. And sometimes the new bitmap which is set to the
remote views will not be seen and instead the old bitmap remains on
the screen.
Is the appwidgetManager discarding the updates????

Also, as the APP_WIDGET_UPDATE broadcast wecan get the new dimensions
of widget in terms of cells.
 can anyone tell,  how to map the cell values into pixel values(WVGA
screen) ????????

Any kind of help is appreciable.

Thanks..

--


Sponsored Links


Other Threads

1. Application with Hardware Acceleration, hardware layers, and rotated ImageViews is causing jaggies.

Hey folks

I am building an application and the following 3 scenarios occur.

1. When I have hardware acceleration in the manifest turned on,
hardware layers enabled in my layout.xml file and a rotation applied
to an ImageView I get jaggies around the edges of the ImageView that
is holding the Bitmap.

2. When I have hardware acceleration in the manifest turned on,
hardware layers dis-abled in my layout.xml file and a rotation applied
to an ImageView I get black borders around the edges of the ImageView
that is holding the Bitmap.

3. When I have hardware acceleration turned off, hardware layers dis-
abled, and the ImageViews rotated I get some kind of jaggedness added
to the ImageView images themselves. Essentially they are not smooth
and crisp (ANTI_ALIAS).

I am trying to work out a scenario where I can have hardware
acceleration = on, no black edges around the ImageViews bitmaps, and
anti_aliased rotated imageviews. Clean and Crisp rotations.

Thanks for any help

Chris

-- 

2. Best Practice for Activities that Absolutely Depend on Services

My application is full of Activities that are absolutely dependent on
a connection to a financial data server (trading system).  The
Activity has the following requirements:

- a user needs to be logged into the server in order to have
permission to view data
- the Activity has to query methods on the loggedOnUser to find
trading permissions
- the Activity has a large amount of UI view code that depends on
extracting values from trading orders

If the connection to the server, which I hope to implement in a
Service, is down or not connected yet, what is the best practice for
implementing the Activity, for login permission purposes, and also to
avoid NullPointerExceptions when asking for data through methods that
may return null?  And what is the best practice for publishing Service
data to the Activity?

I see a couple of solutions

- write the Activity so that it starts up no matter what the status of
the connection/Service, and in all of the Activity methods that deal
with data to guard agains NullPointerExceptions (i.e. assume anyhing
coming from the server could be null at any time

- or, in the onCreate() of the Activity, check for the existence of a
fully connected Service.  IF it's there, allow the Activity to start
and assume that all data is non-null.  if the Service disconnects,
finish() the Activity and go to an interim Activity saying,
"reconnecting please wait...'  restart the Activity when Service is
connected again.   IF the Service is NOT viable on Activity
onCreate(), finish() the Activity in onCreate() and start the
temporary "connecting please wait" Activity, and when Service is
viable again, start the main Activity back up.

-- 

3. Acer Iconia A500

4. Non-US buyers still charged in US$.

5. widget color

6. Honeycomb / 3.0 / OpenGL ES / Broken / Again!?!

7. Must Have Applications - Android Market