Hi All,
In Android, as "EXTERNAL_MEMORY" implies both "INTERNAL+EXTERNAL", to
accurately obtain information
from the agent, let's do a small calculation at the agent side to retrieve
correct values as follows.
Current payload retrieved :
{
"EXTERNAL_TOTAL_MEMORY": "4.92",
"INTERNAL_AVAILABLE_MEMORY": "4.78",
"EXTERNAL_AVAILABLE_MEMORY": "4.78",
"OPERATOR": "Android",
"BATTERY_LEVEL": "51",
"INTERNAL_TOTAL_MEMORY": "4.92"
}
Here we can obtain the correct value for "EXTERNAL_TOTAL_MEMORY" as
EXTERNAL_TOTAL_MEMORY = EXTERNAL_TOTAL_MEMORY - INTERNAL_TOTAL_MEMORY
Similarly, the correct value for "EXTERNAL_AVAILABLE_MEMORY" as
EXTERNAL_AVAILABLE_MEMORY = "EXTERNAL_AVAILABLE_MEMORY" -
INTERNAL_AVAILABLE_MEMORY
So the final outcome would look something similar to the following.
{
"OPERATOR": "Android",
"BATTERY_LEVEL": "51",
"INTERNAL_TOTAL_MEMORY": "4.92",
"INTERNAL_AVAILABLE_MEMORY": "4.78",
"EXTERNAL_TOTAL_MEMORY": "0.00",
"EXTERNAL_AVAILABLE_MEMORY": "0.00"
}
- - - - - - - - - - - - - - - - - - - - - - - - - -
Cheers.
*Dilan U. Ariyaratne*
Software Engineer
WSO2 Inc. <http://wso2.com/>
Mobile: +94775149066
lean . enterprise . middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev