Question : read / write within a file

What I want to do is the following:

I have a file called : configuration that looks like this :

ATR xx.mm.yy
ATR zz.mm.gf
ATR er.hj.kl
STR gg.mm.zz
STR jk.kl.xx
// other stuff


I want to create method getNames() {} that gets a set of strings  like ( xx.mm.yy)
and store them to the file in the following order:

- get the string e.g. xx.mm.hh
- depending on the origine of the string concatenate ATR or STR (I have already the code for that)
- check if the string exists already in the file
-if yes -- do nothing
- otherwise insert it in the file respecting the order
e.g.
if I a have
STR  xx.mm.y
ATR zz.nn.bb


the configuration file will look like that at the end:



ATR er.hj.kl
ATR xx.mm.yy
ATR zz.mm.gf
ATR zz.nn.bb
STR jk.kl.xx
STR gg.mm.zz
STR  xx.mm.y
// other stuff

Answer : read / write within a file

when coding for mobile devices, you'd have to take into account each possible result..
I'm a bit rough on coding, but for what you posted it seems like it would check whether it's an iPad or not and in this case return a null (since it's a droid). What you DO with the result, is up to you..

There are some other options listed in the link below.
http://www.hand-interactive.com/resources/detect-mobile-javascript.htm
Random Solutions  
 
programming4us programming4us