Need help setting default admin settings programmatically in ODK Collect

Hi I am a newbie in android development but I am charged with making a port of ODK Collect for use with partners. One thing they want is to have certain settings locked down, for instance server type, whether or not a person can delete forms, and admin password which would only be known by staff. I've been reading the message boards, creating simple apps and reading extensively on how to create default preferences.

I've got server preferenes but it seems that anything I add in admin_preferences.xml file doesn't show up. I've tried using PreferenceManager.setDefaultValues for each preference but it seems it only works for the first xml file - and never for admin_preferences.xml. I've also tried addPreferencesFromResource in the admin preferences fragment with no luck.

So obviously I am not getting something - preferences here seem a lot more complicated than my parlous state of knowledge.

so tl:dr how does one set default admin preferences in ODK Collect?

@Craig_Savel did you ever figure this out?

well I finally convinced them that porting ODK was a silly idea. So in a sense yes :slight_smile:


That seems like a good outcome, @Craig_Savel!

To give some context, the core development team generally doesn't provide forking help because it doesn't provide benefit to the broader community. Naturally, if users want to help each other with their forks, that's great. Do note that keeping a fork in sync requires ongoing maintenance and that it may be hard to update from mainline depending on what changes you make.

For quickly setting up many devices with the same admin settings, we recommend using QR codes. You can configure one device exactly like you want it and then scan it from others. If you need data collectors to set things up themselves, you can make a printout of the QR code available or send around the QR code image by text message, email, etc.