Rename ODK Collect Project/Package/Module/App?

I'm having real trouble trying to rename my fork of ODK Collect in Android Studio.

I want to totally separate my forked app from the original ODK Collect so that I can run both simultaneously on my device.

Everything I try fails miserably - if I try to right-click the collect_app and do a Refactor it throws a "cannot rename" error, but then does something weird in the background anyway and everything gets out of whack.

If I try renaming the directories manually that also screws things up.

I've tried following every set of instructions I can find on StackOverflow but nothing works.

At the moment if I attempt to install ODK Collect after installing my app (or vice versa) my device thinks they're just different versions of each other and will only proceed by uninstalling the other app first.

It seems like it should be such a simple thing but I'm pulling my hair out!

Any ideas how to achieve what I want? I.e. to separate the 2 apps as far as my device is concerned?


Ok, I think I figured it out!

I followed the steps here:

But it still left loads of references to org.odk.collect so then I had to go through and manually update those to match my renaming made in the steps above.

Now I can run both ODK Collect and my app simultaneously :+1:

Not that I want to encourage fragmentation of the project, but you might also take a look at KoBo Collect. It is a clone of ODK Collect that has been renamed and slightly re-skinned.

Great thanks @danbjoseph .

Am also unkeen to fragment the project - would have loved to have developed a robust print functionality so I could make a pull request and keep us on the same fork as the original, but my skills just aren't good enough to design print functionality that will cater for an arbitrary Form Instance.

So we've decided to run both apps for the time being alongside each other - therefore if the main app starts to deviate a lot we're not left too far behind.

1 Like