Android Plus Device name to text file
I think it would honestly be easier to architect in reverse. You could have the app save a unique custom device name to an ini file and then use the Custom Data configuration in Mobicontrol to extract the value from the device so that it is viewable and reportable in your console. This Custom Data value wouldn't replace the actual MobiControl Device Name but you could call it anything you want, like CustomDeviceName.
We have done this with a file sync rule. We copy an empty "devicename.txt" file to a folder like /sdcard/soti/.
We use a before file sync script:
and a after filesync script:
copy /sdcard/SOTI/Devicename.txt /sdcard/SOTI/%MCDEVICENAME%.txt
This filecopy rule is scheduled for every Monday 9:00 clock.