How to configure android application before or during instalaltion?

Search This thread

VladUkraine

New member
May 5, 2014
2
0
How to configure android application before or during instalaltion?


Is there any standard approach how to configure android application with custom settings before or during instalaltion?

Our users will not use Android market to install our application. They will download apk file from some local site in local network.

Our android application should communicate with server side application.
Different clients(corporate clients) will use different URLs for server side applications.

We need to setup correct URL for server side application before or during installation of apk file on user's phone/tablet.
It should be done automatically without interaction with user.
User should install apk file and after installation application should work with correct server side application.
How to do it?

One approach - create different apk files for different clients and set somewhere in application resources correct URL for server side application.
I do not like it. Actually client could change location of server side. In this case we will need to create new apk files.

Second approach:
- Create apk file.
- Install/store apk file as part of web application deployed on client's server.
- During installation of web application unpack apk file and put correct URL into some resource file.
- Pack apk again.
- Sign apk file.
- Call zipalign for this file. Is this step optional or required?
- Now user can open this web application in browser, download configured apk file and install it on phone/tablet
As result we will have custom apk file with correct URL for server side application inside.
User will install such apk on phone/tablet and application will connect to correct server side without any interaction with user.
Is the second approach correct?
Is it allowed to re-pack apk files at all?
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
Repackaging APK is WAY too fragile IMO.

Best to find another way.

EG, app starts, and sends request to public Internet server.

Public Internet server checks originating IP address and responds with special URL.


Or,... something on phone, like IP, MAC address, phone number, country etc. is used to calculate a URL or retrieve a URL from a list.


All that said, APK is a ZIP file and I think you could put some files in that won't require a resign.
 

VladUkraine

New member
May 5, 2014
2
0
Repackaging APK is WAY too fragile IMO.
Best to find another way.
EG, app starts, and sends request to public Internet server.
Public Internet server checks originating IP address and responds with special URL.
We can't use public internet server.
Our users work in corporate local network. Access to internet could be disabled.