Creating a text with device name in it

Creating a text with device name in it

Is it possible to send a script or have a package, that will create a text file on Zebra Android 8.1 device which will contain device's name

%DEVICENAME% ?

 

Reason behind is that my company is using in-house built app that has it's own launcher. So Kiosk mode from SOTI will not be used.

 

They would like to have device name shown in their app, but how to make it happen? My idea would be to create on all devices a text file that will only have %DEVICENAME% written in it. So that they can make app pull value from that text file in order to show in our app, the device name of it's device. 

 

So, is there a way to create such text file on device automatically?

 

Thanks

6 Answers

Order By:   Standard | Newest | Votes
JVMOD@SOTI | posted this 06 July 2020

Hello Sasha,


Thank you for your post, please provide details of how are you going to integrate your application with MobiControl?

If you require DeviceName from MobiControl, you can consider accessing via RESTApi.

 

Looking forward for your response.

 

Regards,

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |

  • 0
  • 0
Sasha DEX | posted this 5 weeks ago

HI,

 

Thank you for the suggestion.

I haven't used RESTApi feature before. Will this create on all devices some sort of local file which will be accessible by 3rd party app in order to read it's contents? At least readable as a text file?

 

Because our in-house built app has a launcher that replaces/covers entire screen. It does not work well with SOTI Kiosk, it creates a conflict and devices has a black screen. For this reason I've only used a SOTI lockdown features. When this app is running, there is no way to actually access SOTI or other android settings on device. Unless I send "kill" the app via mxconfig command. Other features as remote control, lockdown restrictions work fine.

 

It's not ideal solution but we are moving with direction of our app as an android launcher. Only minus that I've seen, at the moment, is that we can't get device name to appear on the screen. Because devs need a source of device name in order to show in our app. 

 

Regards

Sasha

  • 0
  • 0
Ian Stuart | posted this 4 weeks ago

We're trying to find a similar solution. I am thinking of trying to do a script that would create a file on each device with the device name as the file name. Like "AssetTag.json". Not sure if this will work but worth a try.

 

Update: I have had success so far with creating a file sync rule that moves a blank dummy file "Name.devname" to the device and then run a script afterwards that renames it to %devicename%.devname. The file then has the device name as it's name, and we can reference it in third party apps.

  • 2
  • 0
Sasha DEX | posted this 4 weeks ago

That is a good idea I'll test it also on my end and see how it goes.

 

EDIT: On my end I can't even copy to a new destination folder inside of device, let alone rename some folder/file. How did you managed to do it? 

SOTI logs show that my script has been sent to device, no errors, but nothing happens on the device.

  • 0
  • 0
Ian Stuart | posted this 4 weeks ago

I am doing it with a file sync rule. Just downloading a local file on my server to %sdcard%/download/ on my Androids, but other directories should work too like /data/tmp/public.

 

The file is name.devname (fake file) but after copying the file it renames it. Just go to the advanced tab of your file sync rule and click on scripts. Then in the "after file sync execute script" box I put in:

copy /sdcard/Download/Name.devname /sdcard/Download/%devicename%.devname

 

This copies the fakefile and renames it to have the device name. Not sure how useful this is, but we are able to reference that file by other programs since no other file with extension .devname exists. If you find a better workaround, you should post it!

  • 1
  • 0
Sasha DEX | posted this 3 weeks ago

I see, you've package the script as part of sync rule. 

What I was trying to do, is to test that by sending script via "Legacy" mode. Which had no effect. I'll give it a go on my TC-57 and see how it goes. 

Thank you for the help

 

UPDATE: This also works on our end, I've made it work as part of package deployment. Thank you for the solution

  • 0
  • 0

Give us your feedback
Give us your feedback
Feedback