Pull hardward id into xml record?

Is there a way to identify a phone by some hardware id automatically and
add that into the XML record? We want to do this so that we can track data
coming from each phone separately but not require the users to select an id
each time.

Thanks!
Alex

Yes, this is currently done through preload parameters.

For 1.1.7, you can use a bind like this:

 <bind nodeset="/imci/Meta/DeviceID" type="xsd:string"

jr:preload="property" jr:preloadParams="DeviceID" />

This will populate the value for phones with sim cards. Other values for
preloadParams are:
subscriberID -- the imsi
simSerial -- the sim serial number
phoneNumber -- the phone number

For 1.2, the deviceID bind will populate a unique value for all devices,
including WiFi-only devices.

Also in 1.2, there are these additional preloadParams values that you can
save into your form:

uri:deviceID -- prefixes imei:, android_id: or mac:
also: need to document the preference of what value is used:
(prefer imei: if cellular network chip or android_id: if cellular
network chip but no valid phone number) otherwise return either mac:
uri:subscriberID -- prefixes imsi:
uri:simserial -- prefixes simserial:
uri:phonenumber -- prefixes tel: (note, if you don't have a sim
card, this may still have a value).
username
uri:username -- prefixes username: to the username as configured in
ODK Collect settings
email
uri:email -- prefixes mailto: to the Google Account (email) as
configured in ODK Collect settings

··· On Mon, Jul 16, 2012 at 8:57 AM, Alex Pavluck wrote:

Is there a way to identify a phone by some hardware id automatically and
add that into the XML record? We want to do this so that we can track data
coming from each phone separately but not require the users to select an id
each time.

Thanks!
Alex

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Thanks. Pardon my ignorance but this answer seems incomplete. Are you
saying for 1.1.7 just add this bind code to the XML file and it will work -
which I tried and it didn't show up in my submission? Do I need to add
a variable to set this value to?

Thanks!
Alex

··· On Monday, July 16, 2012 12:29:40 PM UTC-4, Mitch wrote: > > Yes, this is currently done through preload parameters. > > For 1.1.7, you can use a bind like this: > > jr:preload="property" jr:preloadParams="DeviceID" /> > > This will populate the value for phones with sim cards. Other values for > preloadParams are: > subscriberID -- the imsi > simSerial -- the sim serial number > phoneNumber -- the phone number > > For 1.2, the deviceID bind will populate a unique value for all devices, > including WiFi-only devices. > > Also in 1.2, there are these additional preloadParams values that you can > save into your form: > > uri:deviceID -- prefixes imei:, android_id: or mac: > also: need to document the preference of what value is used: > (prefer imei: if cellular network chip or android_id: if cellular network chip but no valid phone number) otherwise return either mac: > uri:subscriberID -- prefixes imsi: > uri:simserial -- prefixes simserial: > uri:phonenumber -- prefixes tel: (note, if you don't have a sim card, this may still have a value). > username > uri:username -- prefixes username: to the username as configured in ODK Collect settings > email > > uri:email -- prefixes mailto: to the Google Account (email) as configured in ODK Collect settings > > > > > On Mon, Jul 16, 2012 at 8:57 AM, Alex Pavluck wrote: > >> Is there a way to identify a phone by some hardware id automatically and >> add that into the XML record? We want to do this so that we can track data >> coming from each phone separately but not require the users to select an id >> each time. >> >> Thanks! >> Alex >> >> -- >> Post: opendatakit@googlegroups.com >> Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> Options: http://groups.google.com/group/opendatakit?hl=en >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitchellsundt@gmail.com >

Sorry, yes, this is a that needs to have a data element associated
with it. I assume you understand the basics of XForms
http://opendatakit.org/help/form-design/ and how bind elements relate to
the variables of your instance.

Note that in 1.1.7, if you have a wifi-only device, the deviceID may be
blank. This was a bug that was fixed in 1.2, which now returns the WiFi
MAC address, if available, or the android ID if not.

Mitch

··· On Mon, Jul 16, 2012 at 9:47 AM, Alex Pavluck wrote:

Thanks. Pardon my ignorance but this answer seems incomplete. Are you
saying for 1.1.7 just add this bind code to the XML file and it will work -
which I tried and it didn't show up in my submission? Do I need to add
a variable to set this value to?

Thanks!
Alex

On Monday, July 16, 2012 12:29:40 PM UTC-4, Mitch wrote:

Yes, this is currently done through preload parameters.

For 1.1.7, you can use a bind like this:

 <bind nodeset="/imci/Meta/DeviceID" type="xsd:string"

jr:preload="property" jr:preloadParams="DeviceID" />

This will populate the value for phones with sim cards. Other values for
preloadParams are:
subscriberID -- the imsi
simSerial -- the sim serial number
phoneNumber -- the phone number

For 1.2, the deviceID bind will populate a unique value for all devices,
including WiFi-only devices.

Also in 1.2, there are these additional preloadParams values that you can
save into your form:

uri:deviceID -- prefixes imei:, android_id: or mac:
also: need to document the preference of what value is used:
(prefer imei: if cellular network chip or android_id: if cellular network chip but no valid phone number) otherwise return either mac:
uri:subscriberID -- prefixes imsi:
uri:simserial -- prefixes simserial:
uri:phonenumber -- prefixes tel: (note, if you don't have a sim card, this may still have a value).
username
uri:username -- prefixes username: to the username as configured in ODK Collect settings
email

uri:email -- prefixes mailto: to the Google Account (email) as configured in ODK Collect settings

On Mon, Jul 16, 2012 at 8:57 AM, Alex Pavluck apavluck@taskforce.orgwrote:

Is there a way to identify a phone by some hardware id automatically and
add that into the XML record? We want to do this so that we can track data
coming from each phone separately but not require the users to select an id
each time.

Thanks!
Alex

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@**googlegroups.comopendatakit%2Bunsubscribe@googlegroups.com
Options: http://groups.google.com/**group/opendatakit?hl=enhttp://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com