0

Is their a way to check what mobile the user uses. I will explain why I want to know this.

In my app, I must take photo's from the Camera path of the user. In the samsung devices, that is DCIM/Camera. But in the HTC devices, that is DCIM/100MEDIA.

So when I see the user got a HTC phone, I can change the Camera path string in my app.

Or is their a way to acces the Camera folder on phone?

I know how to acces the root:

File root = Environment.getExternalStorageDirectory();

I already tried Environment.DIRECTORY_PICTURES; and Environment.DIRECTORY_DCIM;

Maybe I use it in a wrong way.

Any Ideas are welcome.

Bigflow
  • 3,616
  • 5
  • 29
  • 52

3 Answers3

3

Try below code to get manufacturer

String comp = Build.MANUFACTURER;
String model = Build.MODEL;
Sandip Jadhav
  • 7,377
  • 8
  • 44
  • 76
0

using this code you can able to get the device name String str = android.os.Build.MODEL;

Aerrow
  • 12,086
  • 10
  • 56
  • 90
0

To get to device name :

android.os.Build.MODEL;

Found Here

But in your case it will be better if you look directly for the default path using :

getExternalStorageDirectory();

If API level is below 7 and then append /Pictures to get the path of Photos storage.

getExternalStoragePublicDirectory (DIRECTORY_PICTURES)

If API level > 7

Found here

for more details visit this Link.Section : Saving files that should be shared

Community
  • 1
  • 1
Mehdi
  • 1,494
  • 5
  • 33
  • 53
  • Hey, I tried this `Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)` But that isn't reacting the same as `Environment.getExternalStorageDirectory(); +"DCIM/Camera"` – Bigflow Apr 23 '12 at 10:15
  • The API is above 7 (10) So I used `Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)` But that didn't work, however this works (on Samsung only then): `Environment.getExternalStorageDirectory(); +"/DCIM/Camera"` But as I said, I want to let it work on the HTC too (DCIM/100MEDIA). I now check on Manufactor, then change the string, but I prefer your answer (if I can get it to work) – Bigflow Apr 23 '12 at 10:43