[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-c-dev
Subject:    [Dev] Issue in functionality for retrieving Android device CPU info at enrollment
From:       Nuwan Jayawardene <nuwanj () wso2 ! com>
Date:       2018-03-26 5:47:53
Message-ID: CAJZotTCdsTOLAFOmvCCtnLK=xoizpJVhS96dbLT=Qz_5R8Mm1w () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/related)]

[Attachment #4 (multipart/alternative)]


Hi All,

I encountered an issue while enrolling my Android device to the IoT Server
using the cdmf-android-agent. The issue was, after the enrollment info was
provided (server endpoint, username, password etc) the app would crash and
the device would fail to enrol.
While debugging, I came across a method to get the device CPUinfo using the
top command.

When an Android device is being enrolled, the device sends a payload with
device CPU info to the IoT Server. This data is not displayed or processed,
rather simply stored.
Since a separate API does not exist to retrieve this data, it is read from
a format provided by the Android OS. However, this format sometimes changes
by Android version and even manufacturer.
While in certain Android variants, this change does not cause the app to
crash, the data retrieved is often either incorrect or a null value.

To further elaborate the how drastic the changes can be to the format from
Android version to succeeding version I've provided screenshots below.
Note the lines in each format that provide the percentages for values such
as* user, iow* and *irq*:

*the format for Android 25,*


*the format for Android 26,*



Taking into account the changes to this format based on Android version and
manufacturer version, I applied some changes and did a pull request which
can be found at this link
<https://github.com/wso2/cdmf-agent-android/pull/168>.

Thanks and regards
-- 
*Nuwan Jayawardene*
*Software Engineering intern*
*WSO2, Inc.:http://wso2.com <http://wso2.com/>*
*lean.enterprise.middleware*
*Mobile  :- +94 71 1813299*


   - *Linkedin* *:- **https://www.linkedin.com/in/nuwa
   <https://www.linkedin.com/in/nuwanjaya/>**njaya/
   <https://www.linkedin.com/in/nuwanjaya/>*
   - * <https://www.wso2.com/signature>*

[Attachment #7 (text/html)]

<div dir="ltr">Hi All,<div><br></div><div>I encountered an issue while enrolling my \
Android device to the IoT Server using the cdmf-android-agent. The issue was, after \
the enrollment info was provided (server endpoint, username, password etc) the app \
would crash and the device would fail to enrol.<br>While debugging, I came across a \
method to get the device CPUinfo using the top \
command.</div><div><br></div><div><div>When an Android device is being enrolled, the \
device sends a payload with device CPU info to the IoT Server. This data is not \
displayed or processed, rather simply stored.</div><div>Since a separate API does not \
exist to retrieve this data, it is read from a format provided by the Android OS. \
However, this format sometimes changes by Android version and even \
manufacturer.</div><div>While in certain Android variants, this change does not cause \
the app to crash, the data retrieved is often either incorrect or a null \
value.</div><div><br></div><div>To further elaborate the how drastic the changes can \
be to the format from Android version to succeeding version I&#39;ve provided \
screenshots below.<br>Note the lines in each format that provide the percentages for \
values such as<b> user, iow</b>  and <b>irq</b>:</div><div><br></div><div><i>the \
format for Android 25,</i></div><div><img src="cid:ii_jf7rwdeq0_16260b63b8a135eb" \
width="562" height="329"><br><br></div><div><span \
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-variant-l \
igatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-al \
ign:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;back \
ground-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><i>the \
format for Android 26,</i></span><br></div><div><span \
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:nor \
mal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spac \
ing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;wor \
d-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><img \
src="cid:ii_jf7rwzd71_16260b6aa3f82060" width="562" \
height="331"><br><br></span></div><div><br></div><div>Taking into account the changes \
to this format based on Android version and manufacturer version, I applied some \
changes and did a pull request which can be found at <a \
href="https://github.com/wso2/cdmf-agent-android/pull/168">this \
link</a>.<br></div><div><br></div><div>Thanks and regards</div>-- <br><div \
class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div \
dir="ltr"><div style="color:rgb(117,117,117);font-family:sans-serif;font-size:13px"><b>Nuwan \
Jayawardene</b></div><div style="font-size:13px"><font color="#000000" face="arial, \
helvetica, sans-serif"><b>Software Engineering intern</b></font><br><div \
style="color:rgb(117,117,117);font-family:sans-serif"><font color="#000000" \
face="arial, helvetica, sans-serif"><b>WSO2, Inc.:<a href="http://wso2.com/" \
style="color:rgb(126,87,194)" target="_blank">http://wso2.<span \
style="background-color:rgb(255,255,204)">com</span></a></b></font></div><div \
style="color:rgb(117,117,117);font-family:sans-serif"><font color="#000000" \
face="arial, helvetica, \
sans-serif"><b>lean.enterprise.middleware</b></font></div><div \
style="color:rgb(117,117,117);font-family:sans-serif"><font color="#000000" \
face="arial, helvetica, sans-serif"><b>Mobile   :-  <u>+94 71 \
1813299</u></b></font></div><div \
style="color:rgb(117,117,117);font-family:sans-serif"><font color="#000000" \
face="arial, helvetica, sans-serif"><b><u><br></u></b></font></div><div \
style="color:rgb(117,117,117);font-family:sans-serif"><ul \
style="margin:0px;padding:0px 0px \
8px;border:0px;outline:0px;vertical-align:baseline;list-style:none;line-height:17px;display:table-cell;width:503px"><li \
style="margin:0px;padding:8px 12px 2px \
0px;border:0px;outline:0px;vertical-align:baseline;line-height:1.2em"><font \
color="#000000" face="arial, helvetica, sans-serif" \
style="font-size:11px;font-style:inherit"><span \
style="font-style:inherit;font-variant:inherit;line-height:inherit"><b>Linkedin</b>  \
<b>:-  </b></span></font><font color="#7e57c2" face="arial, helvetica, \
sans-serif"><span style="font-size:11px"><b><u><a \
href="https://www.linkedin.com/in/nuwanjaya/" \
target="_blank">https://www.linkedin.com/in/nuwa</a></u></b></span></font><b \
style="font-size:11px;color:rgb(126,87,194);font-family:arial,helvetica,sans-serif"><u><a \
href="https://www.linkedin.com/in/nuwanjaya/" \
target="_blank">njaya/</a></u></b></li><li style="margin:0px;padding:8px 12px 2px \
0px;border:0px;outline:0px;vertical-align:baseline;line-height:1.2em"><font \
color="#7e57c2" face="arial, helvetica, sans-serif"><span \
style="font-size:11px"><b><u><a href="https://www.wso2.com/signature" \
target="_blank"><img src="http://c.content.wso2.com/signatures/general.png" \
alt=""></a></u></b></span></font></li></ul></div></div></div></div></div></div></div></div></div>
 </div></div>

--001a114c843cc7d75805684a2592--


["image.png" (image/png)]
["image.png" (image/png)]

_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic