Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone… Can anyone help to take images and save the image to sqlite in android.Retrieve the image and show it in listview.
Thanks in advanced… :)
Jubayer
Posted

1 solution

Try this code:
C#
URL url = new URL ("file://some/path/anImage.png");
InputStream input = url.openStream();
try {
    OutputStream output = new FileOutputStream ("/sdcard/myImage.png");
    try {
        byte[] buffer = new byte[aReasonableSize];
        int bytesRead = 0;
        while ((bytesRead = input.read(buffer, 0, buffer.length)) >= 0) {
            output.write(buffer, 0, bytesRead);
        }
    } finally {
        output.close();
    }
} finally {
    input.close();
}


Have a look here[^] & here[^]
 
Share this answer
 
Comments
Ahmed Jubayer 19-Mar-12 0:52am    
thanks :)
Prasad_Kulkarni 19-Mar-12 0:56am    
Glad it helps. You're welcome..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900