Hello,
Someone had asked about downloading a file from a URL onto an android device.
I’ve excluded the imports but you should be able to find the necessary packages without too much trouble.
I originally came up with this function to download bitmaps to load into an app, but it works just as well for any file type.
public void downloadFile(String url){
InputStream input = null;
try{
//Get the stream to the file on the web
input = new BufferedInputStream(new URL(url).openStream());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
//Read the data coming in from the stream
byte[] data = new byte[1024];
int x = 0;
while((x = input.read(data,0,1024))>0){
baos.write(data, 0, x);
}
//convert data to a byte array
byte [] ar = baos.toByteArray();
//Create a local file
File newFile = new File(\"/path/to/save/to/music.mp3\");
FileOutputStream fos = new FileOutputStream(newFile);
fos.write(ar);
fos.flush();
fos.close();
input.close();
baos.close();
} catch(IOException iex){
iex.printStackTrace();
}
}
Dot Product Software will be releasing “The Posh Girl Closet Clearance” app onto The Play Store on April 2, 2013.
The app enables customers to shop and sell using the all-in-one app for a low subscription cost of $.99 cents. All profits go directly to the seller.
The Posh Girl
An improved Faces for Android will be re-released onto Google’s Play Store after 2 years of residing exclusively on Amazon’s Appstore.
Faces for Android allows you to take a photo using the camera on your mobile device and place it onto a 3D rendering of a male or female 3D head.
In the weeks ahead we’ll introduce more content for download. You’ll be able to add hair, bodies and clothing to your existing models in your Face Gallery.
We will use “Faces” as the base of future apps that we are currently building.