Custom written Enterprise Android Application Configuration

J
Jeff
The William Carter Company (Retail)

My team has written an application that requires some initial startup configuration items (API endpoints, store number associated with device, etc.)

How can I provide those configuration variables to the app during either installation or by some other means?

I was able to create a Custom Attribute via the REST API, but cannot access it on the device via my app. I could make a REST call with the app, but that defeats the purpose, because I still would have to store the REST API endpoint within my code . . . which my security team will not allow.

I can access the Custom Attribute via legacy scripting, but I cannot write that value to a file via custom scripting (or at least, I didn't find any way to do that). 

I can't seem to access a Custom Attribute via javascript scripting. I've tried various methods, but none work.

Any advice would be helpful. I'm new to this and just can't seem to figure out how to get the initial configuration data down to the device.

Edited 5 years ago
Android
ANSWERS
MD
Matt Dermody Diamond Contributor
5 years ago

You can customize your application so that it can read configuration properties in from an external configuration file that you deliver to the device from SOTI. 

Alternatively, App Config or Managed Configurations could be an option if were to distribute the app via Private Play store. We're still using external config files for the majority of our use cases. 

J
Jeff
5 years ago

Thank you for the reply.

Can I dynamically include Custom Attributes or other API data inside a file during package creation? Each of the devices we are deploying are associated with a given store number, which I am storing in a Custom Attribute. Can I add that custom attribute to a file, via a pre or post-install script, and then deploy it as part of a package?

Architecturally, I could write a Javascript post-install script which would call an API, providing the Mobi Device ID, which could then trigger some back-end process to generate a file and deploy it to devices (can you deploy a file to a device via the REST API?)

MD
Matt Dermody Diamond Contributor
5 years ago (edited 5 years ago)

When the app is first launched prompt the end user to type in a store number. Save that store number to a .ini config file so that it can be read from every time that app is launched again on that device. Then use the SOTI Custom Data configuration to extract the Store number out of the .ini config file so that it can be listed as a device property in SOTI. This way you're letting them configure the device with the Store number with the device itself rather than trying to cross reference the device within the SOTI console and then add a Store property of some kind. 

J
Jeff
5 years ago (edited 5 years ago)

That works for store number, but it doesn't work at all for REST API endpoints and other configuration items that the end user doesn't know or isn't aware of.

RC
Raymond Chan Diamond Contributor
5 years ago

AppConfig framework is the more generic mechaism to configure a large set of  application parameters of different types via any compliant  EMM solution for Android-Enterprise and iOS devices.

J
JCMOD@SOTI
5 years ago (edited 5 years ago)

Hi Jeff,

Thank you for requesting a response from SOTI Support Staff.

Within an Application Catalog Rule, there is Managed Google Play Applications. You can utilise Google Play to privately host your app then utilise the Enable App Configuration in the Advanced option of the rule.

That way you can reference unique values or macros as described via the reference below [1]. Another option is potentially using custom attributes and then via %CustomAttr:namehere% you could utilise a script to write those values to devices via mkdir script for example. That way you'll have a method of fetching store numbers via your app.

References:

https://www.soti.net/mc/help/v15.2/en/console/reference/dialogs/rules/appcatalog/androidplus/appcatalog_addedit_advanced_androidplus.html

https://www.soti.net/mc/help/v15.2/en/scriptcmds/reference/androidplus_enterprise_do.html

https://www.soti.net/mc/help/v15.2/en/scriptcmds/reference/androidplus_classic.html

If you need more specifics / further clarification let us know.

Regards,

J
Jeff
5 years ago (edited 5 years ago)

@Raymond Chan

I have enabled some EMM configuration items for our app. I could not get them to show up under the advanced tab when adding the APK as an Enterprise App, but we will try putting them into the Managed Google Play store to see if they come across there. Thank you for the reply!

@JCMOD

That way you can reference unique values or macros as described via the reference below [1]. Another option is potentially using custom attributes and then via %CustomAttr:namehere% you could utilise a script to write those values to devices via mkdir script for example. That way you'll have a method of fetching store numbers via your app.

I have been able to access the %CustomAttr:AttrName% field from within scripting (showmessagebox), but I could not figure out how to write that value to a file. Does the mkdir command allow writing to a file?

Also, can those Custom Attributes be accessed using a Javascript script instead of a legacy script?

I think if I can find a way to write out a file, I think I could solve this with a post-install script.

I faced the same issue when using to app configuration.

The custom configuration is translated into a json string, something as :

{ "identifier":"%CustomAttr:nameattr%"}

When launch the app the CustomAttr:nameattr is not translated to its proper value.

But when using showmessagebox %CustomAttr:nameattr% it shows correctly the value.

As in app configuration it shows as a field to type value in, I could not find a way it automatically creates a json as:

{ "identifier":"%CustomAttr:nameattr%"}

Have you found your solution ?

RC
Raymond Chan Diamond Contributor
5 years ago (edited 5 years ago)

Hi Joao,

The lists of MobiControl macro for different usage contexts (e.g. script, kiosk, report, email, app configuration , etc.) are different.  Specifically, macros for custom attributes are not currently supported for AppConfig parameter configuration. 

In fact, the list of supported macros for Android Enterprise and Apple devices are also slightly different:

https://www.soti.net/mc/help/v15.2/en/console/reference/dialogs/rules/appcatalog/androidplus/appcatalog_addedit_advanced_androidplus.html

https://www.soti.net/mc/help/v15.2/en/console/reference/dialogs/rules/appcatalog/apple/appcatalog_addedit_appconfig_ios.html