Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

How to configure android application before or during instalaltion?

OP VladUkraine

5th May 2014, 10:47 PM   |  #1  
OP Junior Member
Thanks Meter: 0
 
2 posts
Join Date:Joined: May 2014
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?
6th May 2014, 02:31 AM   |  #2  
Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 3,299
 
6,431 posts
Join Date:Joined: Jan 2011
Donate to Me
More
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.
6th May 2014, 08:05 AM   |  #3  
OP Junior Member
Thanks Meter: 0
 
2 posts
Join Date:Joined: May 2014
Quote:
Originally Posted by mikereidis

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.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes