I 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
xxx.yyy.zzz.251.
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 пишет:
Scenario:
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<[email protected]> wrote:
On Tue, Aug 3, 2010 at 10:53 AM, droidbm<[email protected]> wrote:
I have no way of knowing customer environment settings at apk build
time so SharedPreferences as you described is out.
If the customer
(possibly with an accompanying utility) could unzip the apk, adjust
the settings file, and then deploy it, but I ran into signing issues
with both raw resources and directly reading the apk as a zip.
I'm getting confused. So your customer is someone who is going to set up the
app and then turn around and re-distribute it?
I don't see how you can pre-configure an app when you don't know the
pre-configurations ...
And you WANT them to be able to muck with your APK after you've signed it
and handed it over? How is this any better than a UI where they set this up?
You may want to further clarify and elaborate on your use case. I for one am
not sure about what you're really trying to do here.
-------------------------------------------------------------------------------------------------
TreKing<http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices
--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en