in my app i am using the camera activity to capture an image and i want to
upload the image to a server by getting it's path. I have created an
External Storage Directory of my own and i am storing the images in that
folder. The problem is when i run my app in a Motorola device the image gets
captured and stored in the correct folder and it gets uploaded.
But when i run the app i an HTC device, the image gets captured and the
folder is created but the image gets stored in some other folder and because
of that image is not uploaded and gets crashed...
Following is my code....
public void startCamera()
{
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
File folder = new File(Environment.getExternalStorageDirectory() +
"/Images");
boolean success = false;
if(!folder.exists())
{
success = folder.mkdir();
}
final Calendar c = Calendar.getInstance();
path = "/sdcard/Images/"+timeStampFormat.format(new Date())+".jpg";
File photo = new File(path);
intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(photo));
Uri imageUri = Uri.fromFile(photo);
startActivityForResult(intent, TAKE_PICTURE);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent
data)
{
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode)
{
case TAKE_PICTURE:
if (resultCode == Activity.RESULT_OK)
{
Log.e("resultCode","Activity Result "+path);
String image = path;
FileUploader(path);
}
super.onActivityResult(requestCode, resultCode, data);
}
}
Why such a problem appears, i afraid that the same problem may occur in all
android devices, how to over come this problem....Please help me friends....
--
Siva Shankar K
--
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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en