Deploying Custom Configuration with My Android App

by Kostya Vasilyev » Wed, 04 Aug 2010 02:52:30 GMT

Sponsored Links
  can think of a few solutions.

1 - Discover the web service automatically. For example, through UPnP
(don't know if there is a client library for Java). Or - this is a hack
- set up your server at a known address, relative to the client's
network. That is, network is xxx.yyy.zzz.0/24 -> look for your server at

2 - Bootstrap configuration with another server, that just points to the
real one. This could be a separate machine, running a web server, and a
Wifi access point daemon. It would be configured by the client just once
to give out your real web server address.

Then, with a new phone, a network technician installs your program on
the phone, starts it, and enables Wiif. That's it - your service
discovers Wifi connectivity, connects to the bootstrap server (since its
signal is strongest - assume it physically sits right next to the
technician) and gets initial configuration from there. At this point
your app would know the real server.

3 - Create a separate .apk with configuration, build pre-defined ones
for your clients. The main app would request the configuration by
broadcasting an intent and receiving the server name back also by using
an intent.

4 - Use a simple configuration file, stored in a well-known location on
the memory card.

-- Kostya

03.08.2010 22:30, droidbm :


Customer purchases hundreds of licenses for software app (and
accompanying back end). This client software is highly customizable as
to what, when, and where it reports and to the customers liking
(literally hundreds of settings and tweaks). The client software polls
for config changes through a web service call. However, customers are
asking for a way to have their sys admins deploy the app apk and
config for their environment(s) with out having to install the app, go
to a settings page, and type in the config web services URL on
hundreds of devices. Essentialy, they want a way (like we have on our
other platforms) to deploy a customizable initial config with all the
right communication settings. Since there isn't a file manager or .Net
XML config files or anything similar to help facilitate this in
android, I looked at embedding a raw resource, but that has to be done
at development time by the developer. I then saw that one could (from
a package name) find the installation apk file on the device and open
it as a ZipFile, but adding a file to the apk also fails the signing
check if done post development. Since the app has no UI, there isn't a
place to have a PreferencesActivity, and it doesn't fix the real
problem of giving the sys admin the ability to have a turn-key install
of the apk. I hope this clarifies what I'm trying to accomplish.

On Aug 3, 12:53 pm, TreKing<> wrote:

On Tue, Aug 3, 2010 at 10:53 AM, droidbm<> wrote:

I have no way of knowing customer environment settings at apk build
time so SharedPrefere

Other Threads

1. Selecting text in a WebView?

The browser does this by calling `public void emulateShiftHeld()`
method on the WebView which is hidden in the SDK.
Any other options?

2. UI changing layouts


I have created multiple UI layout files and placed them in res/layout
folder. The layouts designed are similar to a forms. Each layout has
some buttons to transition to an alternate layout. Let me elaborate
how my files look like:

linearlayout with button b1

linearlayout with button b2

linearlayout with button b3


In the main Activity, for OnClickListener of b1, i modify to

runOnUiThread(new Runnable()
public void run()
// with some processing

for OnClickListener of b2, i modify to
runOnUiThread(new Runnable()
public void run()
// with some processing

for OnClickListener of b3, i modify to
runOnUiThread(new Runnable()
public void run()
// with some processing

I get a force close when I try to perform the same. Could you please
point what mistake I am making? Any suggestions of a better UI design?


3. Can adb shell trigger onLowMemory

4. USB data acquisition

5. Unable to read camera input buffer

6. Can't delete emails?

7. Announcement: InsideMobile conference for those interested in all things mobile