Build ODK Survey in Android Studio

I have been using the pre-built apk from the release folder on github - no problem, works a treat.

So I thought I would have a go at a way to incorporate day/night mode into the ODK Survey app. I have done a git clone of the ODK Survey source. With no modifications, the app builds OK and installs the apk on my phone.

However, when the app starts up, it gets stuck with a pop-up saying “Configuring ODK Survey… Please wait a few moments.”, with a ‘spinning widget of doom’. This is confirmed in the log file which seems to indicate nothing happening after the INITIALIZATION_DIALOG.

D/AlertNProgessMsgFragmentMger: 2019-03-14 06:53:44.772 in private void restoreProgressDialog() {
I/MainMenuActivity: 2019-03-14 06:53:45.136 swapToFragmentView: INITIALIZATION_DIALOG
I/MainMenuActivity: 2019-03-14 06:53:45.138 BackStackEntry[0] FORM_CHOOSER
I/MainMenuActivity: 2019-03-14 06:53:45.140 BackStackEntry[1] INITIALIZATION_DIALOG
E/MainMenuActivity: 2019-03-14 06:53:45.141 [102840905] popping back stack INITIALIZATION_DIALOG
D/AlertNProgessMsgFragmentMger: 2019-03-14 06:53:45.144 in private void restoreProgressDialog() {

Any ideas, where to start looking?

Hi George,

Are you building the master or development branch of Survey? Also, have you built the corresponding branch for ODK Services? You will not be able to use the pre-built APK in github for ODK Services (Release ODK Services v2.1.1 · odk-x/services · GitHub) with your custom build of ODK Survey due to mismatched keys. When we build our APKs for github we use our own key for signing the APKs. APKs with different keys will not work together. Thus, you will have to build ODK Services as well as ODK Survey to get things to work on your device.

I hope that helps. If not, let me know.

Clarice,

No, I have been using the pre-built ODK Services apk, so that may well be the problem. I’ll pull the ODK Services git tonight and give it a go.

Thanks :slight_smile:

@clarice_larson thanks for your help. Built and installed ODK Services and now my version of Survey works :slight_smile: