Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different configuration values during development and production on Android

Tags:

android

I am developing an Android application that communicates with a server. When I am developing I want the app to use one server and port and when deploying it in production I want it to use a different server and port.

I thought that I could perhaps store the server name and port as a string resource and then override these values during development. But that does not seem to be possible since there is no quantifier for development.

What is the common way to provide different values to an App during development and production?

like image 507
oyse Avatar asked May 22 '11 15:05

oyse


People also ask

What are configuration changes in Android?

Configuration changes in Android refer to a set of system-level events that can strong affect application and UI behavior. These include such changes as: Orientation change (e.g., portrait to landscape); Screen size/depth change (e.g., HDMI hot-plug, orientation on newer API levels);

What is build configuration in Android?

The Android build system compiles app resources and source code, and packages them into APKs or Android App Bundles that you can test, deploy, sign, and distribute.

Which is the configuration file for Android application?

The config file must be available at the "/sdcard/config. txt" of the android hardware.


1 Answers

The hardcore way, use Ant, or better yet, AndroidAnt, which you can configure builds by simply calling different command line options,

http://code.google.com/p/autoandroid/wiki/AndroidAnt

like image 188
CL22 Avatar answered Oct 26 '22 15:10

CL22