How to: (new) HTTP API

by yves » Fri, 10 Apr 2009 01:48:33 GMT


Sponsored Links
 I've read a lot of tutorials explaining how to use the HTTP Client
from the previous Android SDK.
With SDK 1.1 r1 this API has totally changed.

Is there any tutorial for this new API?

Is it possible to interact with a J EE application? I mean, on the one
side there is the J EE Application on the Internet, on the other side
there is the Android Device which uses the J EE Application (through
REST)? Is it also possible to stay "logged in" on the Android
application (Sessions)? Can I set Cookies on the Android Device?

Thanks in advance
Yves

--~--~---------~--~----~------------~-------~--~----~



How to: (new) HTTP API

by yves » Fri, 10 Apr 2009 01:48:59 GMT


 I've read a lot of tutorials explaining how to use the HTTP Client
from the previous Android SDK.
With SDK 1.1 r1 this API has totally changed.

Is there any tutorial for this new API?

Is it possible to interact with a J EE application? I mean, on the one
side there is the J EE Application on the Internet, on the other side
there is the Android Device which uses the J EE Application (through
REST)? Is it also possible to stay "logged in" on the Android
application (Sessions)? Can I set Cookies on the Android Device?

Thanks in advance
Yves

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


How to: (new) HTTP API

by Mark Murphy » Fri, 10 Apr 2009 06:10:08 GMT


 


HttpClient is a product of the Apache Foundation. Documentation,
including examples, can be found at:

 http://hc.apache.org .


Presumably yes.


Presumably yes.


Yes.

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

Android App Developer Books:  http://commonsware.com/books.html 

--~--~---------~--~----~------------~-------~--~----~



How to: (new) HTTP API

by yves » Sat, 11 Apr 2009 01:22:02 GMT


 Thank you





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. 1.5 ListView disabled items

Hi all , i've noticed after i've switched to 1.5 that if ListView item
is not enabled the divider(s) for this item are not rendering. Is this
intentional ?
--~--~---------~--~----~------------~-------~--~----~

2. AppWidget issues

I'm taking a swing at quickly producing a fully fledged AppWidget that will
augment my forthcoming Daisy Chase game. I've encountered a couple of
issues.

There's one definite bug: AppWidgetProvider fails to
handle ACTION_APPWIDGET_DELETED actions properly. Browsing the source I can
see that AppWidgetService broadcasts an ACTION_APPWIDGET_DELETED Intent with
an EXTRA_APPWIDGET_ID, but the AppWidgetProvider is only looking
for EXTRA_APPWIDGET_IDS. The result is that you never receive a call
to onDeleted().

The workaround is simple: don't use AppWidgetProvider, but the question is
which end is wrong? Nothing is specified in the docs as far as I can tell.
Do we need to watch out for either extra for both updates and deletions?

Additionally (and I haven't investigated this yet) there appears to be a
possible deficiency in the timeliness of ACTION_APPWIDGET_UPDATED
broadcast cessation. If my debug output is to be believed, what I am seeing
is that the deletion is broadcast but I continue to receive update events
for the deleted widget until I add another widget from the same provider;
that is, I remove my widget on the home-screen and continue to receive
updates for it (indefinitely it seems) until I add another.
The second issue I've encountered probably isn't a bug, but I can't work out
the expected behaviour. My widgets contain an ImageView. The image is small
(80x80) and updates every hour. I decided that the most efficient approach
would be to write a ContentProvider that serves pngs of the widget images
from disk via openFile(). My RemoteViews for each widget then queues a
setImageURI call with the appropriate content URI.

This works up-to a point. The problem is that when the widget is updated and
a new image is generated, how can I kick the ImageView into reloading the
image? The obvious solution which I expected to work, was to push another
RemoteViews object (new instance - identical layout) to the AppWidgetManager
but that doesn't work. The image is not requested again. What is causing
this, over-aggressive optimization in the handling of RemoveViews by the
widget framework, or something else?

(Again the workaround is simple: decorate the Uri with something distinctive
like a timestamp so that the Uri is unique on each request.)

Tom

--~--~---------~--~----~------------~-------~--~----~

3. Animation Xml Resource and CycleInterpolator tag: FAIL

4. AppWidgets: Dynamic value for updatePeriodMillis?

5. AppWidgets: Dynamic value for updatePeriodMillis?

6. httpclient -> http.client

7. The cell line color of GridView