Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hello All,

In BREW applications, we can not get model name or platform ID(execpt BREW 2.0).

Is there any other way to identify the handset from application ?

Regards,

Gaurang.

Pretty much the only thing you have to go on is what's in the deviceinformation structure. You might save out that structure for each handset and then run a comparison at runtime of all the fields to the known structure for each handset.
Really, the only unique trait seem to be the resolution--aside from the recent Samsungs, I've never seen 2 BREW handsets with the same resolution.

Pretty much the only thing you have to go on is what's in the deviceinformation structure. You might save out that structure for each handset and then run a comparison at runtime of all the fields to the known structure for each handset.
Really, the only unique trait seem to be the resolution--aside from the recent Samsungs, I've never seen 2 BREW handsets with the same resolution.

You can use various attributes of the device to create a signature. A combination of screen size, nColorDepth, RAM, and BREW version is more than enough to identify a handset.

You can use various attributes of the device to create a signature. A combination of screen size, nColorDepth, RAM, and BREW version is more than enough to identify a handset.

One interesting thing : even in brew 1.1. the field dwPlatformID exists in the AEEDeviceInfo structure, but it is always equals to zero.. Well, useless hehe :P

One interesting thing : even in brew 1.1. the field dwPlatformID exists in the AEEDeviceInfo structure, but it is always equals to zero.. Well, useless hehe :P

BTW, some of the emulator skins seem to be configured incorrectly, so you have to account for that on your emulator build. The skins will report the wrong screen size (e.g. T720 is 121x131, VX4400 is 121x116) and wrong color depth (e.g. T720 and VX4400 both report 8-bit). Maybe they've fixed these skins by now but i re-downloaded some of them recently and the problem was still there.

BTW, some of the emulator skins seem to be configured incorrectly, so you have to account for that on your emulator build. The skins will report the wrong screen size (e.g. T720 is 121x131, VX4400 is 121x116) and wrong color depth (e.g. T720 and VX4400 both report 8-bit). Maybe they've fixed these skins by now but i re-downloaded some of them recently and the problem was still there.

That particular problem can be fairly easily solved by editing the .qsc files.
For instance, for 2.0 version of the T720, use Left: 65, Top: 157, Width: 120, Height: 130, and be sure to set color depth to 16, which more closely models the 12-bit color depth of the T720. You may also have to change the Pixel Count values to match the height and width.
For the 1.1 version, use Left: 65, Top: 157, Right: 184, and Bottom: 286, and uncheck "Define Aspect Ratio" if it is checked. Sadly, the 1.x device files don't support color depths greater than 8.

That particular problem can be fairly easily solved by editing the .qsc files.
For instance, for 2.0 version of the T720, use Left: 65, Top: 157, Width: 120, Height: 130, and be sure to set color depth to 16, which more closely models the 12-bit color depth of the T720. You may also have to change the Pixel Count values to match the height and width.
For the 1.1 version, use Left: 65, Top: 157, Right: 184, and Bottom: 286, and uncheck "Define Aspect Ratio" if it is checked. Sadly, the 1.x device files don't support color depths greater than 8.

I know about the Device Configurator, but i didn't want to have to educate my clients about this issue. It was simply easier to add the odd entries into the device profile table and be done with it, than to get everyone to use skins i provided or to go around to everyone's computer around the country and fix it. I'm not even sure if it's legal to distribute qsc files, whether the recipient is authenticated or not.

I know about the Device Configurator, but i didn't want to have to educate my clients about this issue. It was simply easier to add the odd entries into the device profile table and be done with it, than to get everyone to use skins i provided or to go around to everyone's computer around the country and fix it. I'm not even sure if it's legal to distribute qsc files, whether the recipient is authenticated or not.

A small function that works off a data table.
Qid is the Qualcomm ID, it changes per software revisions, and the phone may not actually have it (reason why I memset the Device Info struct)
Guide to the Cid (chasma id, our own internal numbering system)
00 - Any Phone
01 - Kyocera 3035e
02 - Sharp Z-800
03 - Motorola T720
04 - Audiovox CDM9500
05 - Kyocera 3225
06 - LG VX4400
07 - Samsung SCH-A530
08 - Audiovox CDM8600
09 - Samsung SCH-A561
10 - Samsung SCH-A610
11 - Sony Ericcson T606
12 - LG VX6000
13 - Kyocera X414
14 - Nokia 3586i
15 - Samsung SCH-A690
16 - Motorola T731
Not this code/data set is constantly changing. Phones sometimes return data that is BS. (Samsung 530 claiming it's 16bit etc)
Also some phones can not be seperated from each other.
(This code claims any Samsung 530 is actually a Samsung 610) etc.
struct PhoneInfo{
uint32 qid;
uint32 cid;
uint32 x1;
uint32 y1;
uint32 d1;
uint32 x2;
uint32 y2;
;
uint32 CPhone::init(IShell *pIShell)
{
testData = NULL;
testFunction = NULL;
timer1 = 0;
timer2 = 0;
timer3 = 0;
running = FALSE;
cleanFinish = FALSE;
p_IShell = pIShell;
if (p_IShell != NULL)
{
AEEDeviceInfo di;
MEMSET((void *)&di,0,sizeof(AEEDeviceInfo));
di.wStructSize = sizeof(AEEDeviceInfo);
ISHELL_GetDeviceInfo(p_IShell,&di);
screen_x = di.cxScreen;
screen_y = di.cyScreen;
screen_d = di.nColorDepth;
screen2_x = di.cxAltScreen;
screen2_y = di.cyAltScreen;
CloseAllApp = di.wKeyCloseAllApps;
CloseApp = di.wKeyCloseApp;
Lang = di.dwLang;
QPlat = di.dwPlatformID;
return calcPhoneType();
}
else
return 0;
}
uint32 CPhone::calcPhoneType()
{
PhoneInfo phone[] =
{
// Qid cid x1 y1 d1 x2 y2
{5000, 1, 88, 99, 1, 0, 0},
{4000, 2, 128, 144, 8, 0, 0},
{8003, 3, 120, 130, 12, 0, 0},
{13003, 4, 144, 158, 16, 0, 0},
{5005, 5, 106, 98, 2, 0, 0},
{1009, 6, 120, 115, 16, 0, 0},
{2013, 7, 128, 146, 16, 0, 0},
{16006, 8, 128, 112, 16, 0, 0},
{2018, 9, 128, 146, 12, 0, 0},
{2025, 10, 128, 146, 16, 0, 0},
{12000, 11, 128, 114, 16, 0, 0},
{1014, 12, 120, 146, 18, 0, 0},
{0, 13, 104, 68, 16, 0, 0},
{17000, 14, 96, 56, 12, 0, 0},
{0, 15, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0} //Denotes end of list
};
uint16 n=0;
//PhoneInfo *narrow[sizeof(phone)/sizeof(PhoneInfo)];
PhoneInfo *narrow=NULL;
uint32 i=0;
while(phone[i].cid != 0)
{
if (QPlat != 0)
{
if (phone[i].qid == QPlat)
{
return phone[i].cid;
}
}
if (phone[i].x1 >= screen_x && phone[i].y1 >= screen_y && phone[i].d1 >= screen_d )
{
if (narrow == NULL)
{
narrow = &phone[i];
}
else
{
if (phone[i].x1 <= narrow->x1 && phone[i].y1 <= narrow->y1 && phone[i].d1 <= narrow->d1)
{
narrow = &phone[i];
}
}
}
i++;
}
if (narrow == NULL)
return 0;
else
return narrow->cid;

Oh, the obligatory.
This code is not guarneted in any form. No warrenty is granted, use at your own risk.
I can tell you right now, that data table is not complete and we're constantly modfiying it as we hit problems!

A small function that works off a data table.
Qid is the Qualcomm ID, it changes per software revisions, and the phone may not actually have it (reason why I memset the Device Info struct)
Guide to the Cid (chasma id, our own internal numbering system)
00 - Any Phone
01 - Kyocera 3035e
02 - Sharp Z-800
03 - Motorola T720
04 - Audiovox CDM9500
05 - Kyocera 3225
06 - LG VX4400
07 - Samsung SCH-A530
08 - Audiovox CDM8600
09 - Samsung SCH-A561
10 - Samsung SCH-A610
11 - Sony Ericcson T606
12 - LG VX6000
13 - Kyocera X414
14 - Nokia 3586i
15 - Samsung SCH-A690
16 - Motorola T731
Not this code/data set is constantly changing. Phones sometimes return data that is BS. (Samsung 530 claiming it's 16bit etc)
Also some phones can not be seperated from each other.
(This code claims any Samsung 530 is actually a Samsung 610) etc.
struct PhoneInfo{
uint32 qid;
uint32 cid;
uint32 x1;
uint32 y1;
uint32 d1;
uint32 x2;
uint32 y2;
;
uint32 CPhone::init(IShell *pIShell)
{
testData = NULL;
testFunction = NULL;
timer1 = 0;
timer2 = 0;
timer3 = 0;
running = FALSE;
cleanFinish = FALSE;
p_IShell = pIShell;
if (p_IShell != NULL)
{
AEEDeviceInfo di;
MEMSET((void *)&di,0,sizeof(AEEDeviceInfo));
di.wStructSize = sizeof(AEEDeviceInfo);
ISHELL_GetDeviceInfo(p_IShell,&di);
screen_x = di.cxScreen;
screen_y = di.cyScreen;
screen_d = di.nColorDepth;
screen2_x = di.cxAltScreen;
screen2_y = di.cyAltScreen;
CloseAllApp = di.wKeyCloseAllApps;
CloseApp = di.wKeyCloseApp;
Lang = di.dwLang;
QPlat = di.dwPlatformID;
return calcPhoneType();
}
else
return 0;
}
uint32 CPhone::calcPhoneType()
{
PhoneInfo phone[] =
{
// Qid cid x1 y1 d1 x2 y2
{5000, 1, 88, 99, 1, 0, 0},
{4000, 2, 128, 144, 8, 0, 0},
{8003, 3, 120, 130, 12, 0, 0},
{13003, 4, 144, 158, 16, 0, 0},
{5005, 5, 106, 98, 2, 0, 0},
{1009, 6, 120, 115, 16, 0, 0},
{2013, 7, 128, 146, 16, 0, 0},
{16006, 8, 128, 112, 16, 0, 0},
{2018, 9, 128, 146, 12, 0, 0},
{2025, 10, 128, 146, 16, 0, 0},
{12000, 11, 128, 114, 16, 0, 0},
{1014, 12, 120, 146, 18, 0, 0},
{0, 13, 104, 68, 16, 0, 0},
{17000, 14, 96, 56, 12, 0, 0},
{0, 15, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0} //Denotes end of list
};
uint16 n=0;
//PhoneInfo *narrow[sizeof(phone)/sizeof(PhoneInfo)];
PhoneInfo *narrow=NULL;
uint32 i=0;
while(phone[i].cid != 0)
{
if (QPlat != 0)
{
if (phone[i].qid == QPlat)
{
return phone[i].cid;
}
}
if (phone[i].x1 >= screen_x && phone[i].y1 >= screen_y && phone[i].d1 >= screen_d )
{
if (narrow == NULL)
{
narrow = &phone[i];
}
else
{
if (phone[i].x1 <= narrow->x1 && phone[i].y1 <= narrow->y1 && phone[i].d1 <= narrow->d1)
{
narrow = &phone[i];
}
}
}
i++;
}
if (narrow == NULL)
return 0;
else
return narrow->cid;

Oh, the obligatory.
This code is not guarneted in any form. No warrenty is granted, use at your own risk.
I can tell you right now, that data table is not complete and we're constantly modfiying it as we hit problems!

has anyone tried using AEEGETVERSION to solve this problem?
-Aaron

has anyone tried using AEEGETVERSION to solve this problem?
-Aaron

AEEGETVERSION
only returns the software version of brew on the phone.
It isn't phone model specific.

AEEGETVERSION
only returns the software version of brew on the phone.
It isn't phone model specific.

I have no trouble getting the platform ID off both BREW 1.1 and 2.0 phones. If you read the docs it says that you in order to properly obtain the dwPlatformId, "you MUST fill in the wStructSize element of the structure [referring to AEEDeviceInfo] before passing this to the GetDeviceInfo call" If you don't do this, you will always get a 0.

I have no trouble getting the platform ID off both BREW 1.1 and 2.0 phones. If you read the docs it says that you in order to properly obtain the dwPlatformId, "you MUST fill in the wStructSize element of the structure [referring to AEEDeviceInfo] before passing this to the GetDeviceInfo call" If you don't do this, you will always get a 0.

Device Info platform can change per software revisions on a phone, and certain 1.1 devices don't return anything. (Audiovox 9500 will return platID, mt720 won't) etc

Device Info platform can change per software revisions on a phone, and certain 1.1 devices don't return anything. (Audiovox 9500 will return platID, mt720 won't) etc

Hi all..
Can anyone clarify whether AEEDeviceInfo.dwPlatformID is unique for each combination of handset & BREW version?
When i tried for KX424 & KX434 models of Kyocera with BREW 2.0 it returns me same value in AEEDeviceInfo.dwPlatformID i.e 5014. How to differentiate both handset in such case?
Thanks in advance,
regds,
Nilesh

Hi all..
Can anyone clarify whether AEEDeviceInfo.dwPlatformID is unique for each combination of handset & BREW version?
When i tried for KX424 & KX434 models of Kyocera with BREW 2.0 it returns me same value in AEEDeviceInfo.dwPlatformID i.e 5014. How to differentiate both handset in such case?
Thanks in advance,
regds,
Nilesh

Since alot of devices (brew 1.1) do have a proper deviceID, i personnaly try to detect the phone using screen size, screen depth, etc..
As far as i remember, there's a good source sample in this forum
/kUfa

Since alot of devices (brew 1.1) do have a proper deviceID, i personnaly try to detect the phone using screen size, screen depth, etc..
As far as i remember, there's a good source sample in this forum
/kUfa

dwPlatformID returns the software version of the phone developers fireware/os/platform. It can be the same across multiple phones if they use the same software revision.

dwPlatformID returns the software version of the phone developers fireware/os/platform. It can be the same across multiple phones if they use the same software revision.

dwPlatformID is a "handset id". It is (generally) not firmware version specific, unless there have been major functionality changes.

dwPlatformID is a "handset id". It is (generally) not firmware version specific, unless there have been major functionality changes.

I've just implemented your code, thanks, and have a question. I know you're not a support desk though :)
I have a moto720. When running this code throught the emulator it first detects the moto and assigns narrow to it, then as it progresses it gets overidden by the SCH-A610 because the bit-depth is better.
This is because the emulator claims the moto is 16 bit whereas it's 12 in your table which I assume a real phone reports.
However, I tried to change the moto's skin to be 12 deep in the configurator and now the emulator won't load it :S
Dunno what I'm expecting you to say to this, but just pointing it out. I'm a bit stuck for a fix but it's a shame the only phone I have atm is one that doesn't work nicely for both emu and real. :S

I've just implemented your code, thanks, and have a question. I know you're not a support desk though :)
I have a moto720. When running this code throught the emulator it first detects the moto and assigns narrow to it, then as it progresses it gets overidden by the SCH-A610 because the bit-depth is better.
This is because the emulator claims the moto is 16 bit whereas it's 12 in your table which I assume a real phone reports.
However, I tried to change the moto's skin to be 12 deep in the configurator and now the emulator won't load it :S
Dunno what I'm expecting you to say to this, but just pointing it out. I'm a bit stuck for a fix but it's a shame the only phone I have atm is one that doesn't work nicely for both emu and real. :S

I meant to add:
Does anyone have stats for an LG VX4600 please ?

I meant to add:
Does anyone have stats for an LG VX4600 please ?