2
File tempFile = File.createTempFile(""+Common.getMobileNumber(), ".jpg", null);
FileOutputStream fos = new FileOutputStream(tempFile);
fos.write(bos.toByteArray());

I do this, but thing is ...when i go to apps, and click on my app... i see that its adding caching. and this particular file is caching, how can i create file without caching/saving. only need of file for me, is to send it over to server side.

Is there any way i create a object file without saving/caching?

Mayuri
  • 402
  • 6
  • 13
user3278732
  • 1,694
  • 10
  • 31
  • 67

1 Answers1

0

If you are saying you need like a file only in the memory for the particular task like uploading to server. It is very similar to this question to do that. There is a code to create a file in memory.

Android Creating a memory resident input file that can be attached to an email

Community
  • 1
  • 1
Chk0nDanger
  • 1,211
  • 1
  • 10
  • 26