I have a requirement in which I have to figure out if my android app is running on one of the samsung edge devices or its a regular android phone. Accordingly my ui would update. All i could gather is that the device name has a substring edge in it. Can someone suggest me a a a better way to do this ?
Asked
Active
Viewed 141 times
-1
-
I think the only way is to store a list of edge device models in your app, and check current device against this list. – Vladyslav Matviienko Jun 14 '18 at 07:20
-
Yes of course that could be a way. But is there nothing which could inform me of this from the device itself ? – Ashish Kumar Jun 14 '18 at 07:22
-
I don't think that Android itself has any clue about something called *edge*. It is a Samsung-only feature, and I believe there is nothing to identify it in Android OS. – Vladyslav Matviienko Jun 14 '18 at 07:24
-
Yes but devices do come with hardware information – Ashish Kumar Jun 14 '18 at 07:26
-
try to get device name and model and add some if conditions if it works for you. refer this [link](https://stackoverflow.com/a/38157223/6454463) to get device details. – Rutvik Bhatt Jun 14 '18 at 07:32
1 Answers
1
For samsung device's, take a look at the Samsung programming guide for Edge, in page 10 :
initialize() initializes Look. You need to initialize the Look package before you can use it. If the device does not support Look, SsdkUnsupportedException exception is thrown.
If an SsdkUnsupportedException exception is thrown, check the exception message type using SsdkUnsupportedException.getType(). The following two types of exception messages are defined in the Slook class: VENDOR_NOT_SUPPORTED: The device is not a Samsung device. DEVICE_NOT_SUPPORTED: The device does not support the Look package.
So you can do this:
Slook slook = new Slook();
try {
slook.initialize(this); // it is a edge
} catch(SsdkUnsupportedException e)
{
// it is not an edge
}

E.Abdel
- 1,992
- 1
- 13
- 24
-
I believe this will help, will approve the answer once after I implement it – Ashish Kumar Jun 14 '18 at 07:32