views:

65

answers:

2

Hi there. I have a php web page that will randomize an image that is 158x154. I was able to get the android application to work, but would also like to get it to work as a widget. How the heck can I get a widget to pull information from the net? I got the widget to work and layout correctly with a black sample image. I have tried to look at the wiki sample, but it is a bit too complicated for my little brain to grasp. The data that gets pulled looks something like:

<html><body bgcolor="#000000">center>    
<a href="http://www.website.com" target="_blank">
<img border="0" src="http://www.webiste.com//0.gif"&gt;&lt;/a&gt;
<img src="http://www.webiste.com" style="border:none;" />
</center></body></html>

Help please. I am pulling my hair out trying to figure this out.

+2  A: 

How the heck can I get a widget to pull information from the net?

In your RemoteViews, try calling setImageViewUri() supplying the ID of the ImageView widget in the app widget's layout and the URL to the image as converted to a Uri.

CommonsWare
Thank you. I just feel really dumb. Here is what I have so far. Of course it doesn't work. Think my brain has turned to mush.javapackage com.domanin.file;import android.appwidget.AppWidgetProvider;public class QuotesWidget extends AppWidgetProvider { void addView(int, RemoteViews); setImageViewUri(widget); }
cdg
+1  A: 

Here's a nice tutorial fetching and displaying remote images.

Jon