I have a native Android app that needs to connect to a different Facebook app (different Application ID) based on an app setting that can be changed at runtime.
Yes, you can set it programmatically. Use the Sessions$Builder class which allows you to build a session without needing to use one of the private constructors.
Session session = new Session.Builder(context).setApplicationId(applicationId).build();