Downloading a file from the web is very simple, you can either use
HttpClient (plenty of documentation available) or, more simply, new
URL("http://...";).openStream().

As for storing it in a SQLite3 database, you may be surprised to find
that you cannot with Android.  Instead, the approach is to store it to
a file and reference that file in a column in your database table.
The preferred and most conventional way to do this is to use a
ContentProvider and store a valid content URI in your database
column.  Then, you would implement the openFile method to translate
the content URI you stored to a file on the device.  This is a useful
approach because this allows you to say, store an image in column
photo, and display it in an ImageView using simply
setImageURI(Uri.parse(cursor.getString(PHOTO_COLUMN))).

If you need more help, there's actually quite a bit of discussion
about this in other posts...

On Mar 23, 8:35 pm, GUS <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I need to download a .jpg photo from a webserver and then save it in a
> database. Does anyone knows where can I find a sample of downloading
> files trhu HTTP, and also a sample of serializating files to database?
>
> Thank You very much.
>
> Gustavo Avila
> virtualsite.com.br
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to