Monday, March 05, 2007

Ok, a few posts ago,  I put up a screenshot showing a asp.net web application that I use to hold all cab files that comprise a mobile line of business application.

However one of the biggest challenges we face is how to configure a mobile device with all those settings for database connection strings, URL for SQL Compact Server tools etc.

Additionally  how do you easily allow end user to move from your dev to test to live environment without having to deploy new cab files?

For a while we we have been doing the following,  in mobile application we add a text file (we use the name application.config) configured as content.

It contains all of our configuration keys prefixed with a profile number like -

 

<configuration>
<appSettings>

<!--Profile On Lan CRP -->
<add key="1 profilename" value="CRP LAN" />
<add key="1 interneturl" value="http://10.2.102.16/sqlmobile/sqlcesa30.dll" />
<add key="1 upgradeurl" value="http://10.2.102.16/handheld/CRPSetupMobileLabelling.CAB" />
<add key="1 RepServerName" value="GSERP01" />
<add key="1 RepDbName" value="JDE_CRP" />
<add key="1 RepPubName" value="JDE_CRP" />
<add key="1 AutoLogonBarCode" value="1" />

<!--Profile Remote CRP -->
<add key="2 profilename" value="CRP REMOTE" />
<add key="2 interneturl" value="https://mobile.gs-marketing.com/sqlmobile/sqlcesa30.dll" />
<add key="2 upgradeurl" value="https://mobile.gs-marketing.com/handheld/CRPSetupMobileLabelling.CAB" />
<add key="2 RepServerName" value="GSERP01" />
<add key="2 RepDbName" value="JDE_CRP" />
<add key="2 RepPubName" value="JDE_CRP" />
<add key="2 AutoLogonBarCode" value="" />

SNIPPED HERE....

 

Then on a screen in our mobile application we enumarte each settings key, and display a drop down list of available profiles.     Using a screen like the following:

Top part of screen sets the AD account mobile device uses and subscriber.  The admin password at the bottom as we don't want any old user being able to change this :-)

These settings are stored i.e subscriber, AD credentials (encrypted) and profile selected are stored in the registry.   The dropdown list shows our profiles like 'CRP Remote', 'Live Environment', 'Testing on Laptop'.   To enumarte the profiles we use the following code:

 

public Hashtable GetAllProfiles()
{
Hashtable ret = new Hashtable();
foreach (string key in _list.Keys)
{
if (key.ToLower().EndsWith("profilename"))
{
string val = key.Substring(0, key.IndexOf(" "));
string ourkey = this.GetString(key);
ret.Add(ourkey,val);
}
}
return ret;
}

 

The final step is that we create a method for retrieving our settings from the config file that references the selected profile.  Like so:

 

 

public static string AppSetting(string key)
{

AppSettings oAppSet = new AppSettings();

string profilename = ""
profilename = oAppSet.GetString("currentprofile");  // READ SELECTED PROFILE FROM REGISTRY

if (Settings.Profile != "")
{
profilename = Settings.Profile;
}

if (profilename.Length > 0) profilename += " "  // NOTE IF WE DON'T HAVE A PROFILE SELECTED STILL RETURN A VALUE

string result = oAppSet.GetString(profilename + key);

if (result != "") return result;

return oAppSet.GetString(key);

}

 

So there you have it, we can deploy one CAB with all of our profiles let an authenticated user move from test to live etc.  without requiring a new cab.    It works great and makes mobile deployment work very smoothly.

Monday, March 05, 2007 10:08:46 PM UTC  #    Comments [0]  |  Tracked by:
http://9ll-free-porn.info/82930484/chaotropic-salt-nucleases.html [Pingback]
http://9lp-free-porn.info/74455291/index.html [Pingback]
http://9ls-free-porn.info/65624456/boys-wearing-girls-clothes.html [Pingback]
http://9lm-free-porn.info/04533391/tiny-underage-teen-models.html [Pingback]
http://9lr-free-porn.info/77503938/index.html [Pingback]
http://9lk-free-porn.info/52901576/index.html [Pingback]
http://9lt-free-porn.info/64952959/television-show-50-sexiest-men-2006.html [Pingback]
http://9lk-free-porn.info/31040076/directors-escorts-london.html [Pingback]
http://9lr-free-porn.info/28844559/hot-mazda-girl.html [Pingback]
http://9lo-free-porn.info/41273400/how-to-lick-pussy-.html [Pingback]
http://9lm-free-porn.info/53003951/index.html [Pingback]
http://9ll-free-porn.info/66087503/index.html [Pingback]
http://9lt-free-porn.info/70417702/index.html [Pingback]
http://9lq-free-porn.info/11777823/index.html [Pingback]
http://9lm-free-porn.info/34134534/index.html [Pingback]
http://9lq-free-porn.info/90953574/name-change-or-baby-name.html [Pingback]
http://9lo-free-porn.info/92061481/statistics-bad-effects-from-seeing-nude.html [Pingback]
http://9ll-free-porn.info/55857800/index.html [Pingback]
http://9lm-free-porn.info/34970689/young-life-of-neil-armstrong.html [Pingback]
http://9lk-free-porn.info/60589456/index.html [Pingback]
http://9nb-information.info/71070070/loan-approved-lenders.html [Pingback]
http://9nb-information.info/41928348/security-guard-mod-securityguardmilitary-jo... [Pingback]

Theme design by Jelle Druyts

Pick a theme: