Dot Product Software Weblog
Programming Insights
Categories:

Archives:
Meta:
June 2026
S M T W T F S
« Jun    
 123456
78910111213
14151617181920
21222324252627
282930  
06/12/13
Download File With Android
Filed under: General
Posted by: Lou Rebimbas @ 3:08 am

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();
		}
	}
comments (0)
04/01/13
The Posh Girl Closet Clearance
Filed under: General
Posted by: Lou Rebimbas @ 11:47 am

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

comments (0)
01/23/13
Faces To Be Re-Released
Filed under: General, 3D Programming
Posted by: Lou Rebimbas @ 3:18 am

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.

Check Faces out on Facebook for the latest updates

Visit Dot Product Software on FaceBook to keep current on what we’re doing with our 3D Rendering Engine!

Follow @DotProductSoft On Twitter!

comments (0)