Update/alter Android Preferences dynamicaly

by Lars Nielsen Lind » Tue, 04 May 2010 02:36:39 GMT


Sponsored Links
 Hi, I have tried to find a way to update the Android Preferences
dynamically.

Under the /res/xml directory I have placed a XML file with
CheckBoxPreference elements. During application usage some of the
preferences CheckBoxPreference elements may vary in numbers. Sometimes
there may be 10 items and at other times there may be 35.

I have tried to place the XML file in the /assets diectory (where read
and write is possible) and then tried to replace the
R.xml.<XMLFileName> in the
addPreferenceFromResource(R.xml.<XMLFileName>) with the Assets file -
but that won't work.

Is it in anyway possible to write to, during runtime programmatically,
the XML files placed in the /res directory - and if - how do we do
that?

Is it possible - programmatically - to create and delete the entries
in the preferences - thereby omitting the XML file?

Any help is appreciated.

Thanks,

Lars

--



Update/alter Android Preferences dynamicaly

by TreKing » Tue, 04 May 2010 03:58:36 GMT


 On Sat, May 1, 2010 at 4:28 PM, Lars Nielsen Lind <larsnielsenl...@gmail.com




Nope. All /res/ content is read-only.



Sure. You have a PreferenceActivity, I presume? In onCreate() you should be
able to create and all the preferences your heart desires.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
 http://sites.google.com/site/rezmobileapps/treking 

--


Sponsored Links


Other Threads

1. Tubuh kita di Android (lanjutan Acer Iconia Tab Review)

Kebetulan salah satu yang membuat saya ngiler nyoba tablet android 3.0
honeycomb adalah ini

http://bodybrowser.googlelabs.com/

<http://bodybrowser.googlelabs.com/>Ya pencarian apps ini awalnya ketika
seorang rekan psikiater yang minta tolong untuk bisa menjelaskan
bagian-bagian otak, tapiii....karena pakai galaxy tab dengan sedikit tweak
untuk resize ukuran apps, alhasil atlasnya acak adut. Nah padahal saya
pernah review fitur google body browser
http://www.tanyadokteranda.com/berita/2010/12/sekarang-google-earth-jelajahi-bagian-tubuhmu
pas
baru rilis testing. Eh kemarin waktu ngetes iconia tab kok di market free
untuk langsung download, wah...jadi mau nangis dulu waktu sekolah mau gak
mau beli atlas anatomi 1jutaan....gak bisa diputer2, gak bisa dipilih
layering organ, beratnya bisa buat nampol maling. Atlas anatomi 3D paling
murah adalah ngopi CD punya temen yah. Tapi kalau bisa gampang dibawa2
gimana dong..masa gak mupeng.

Yang jelas anak sekolahan sekarang harus lebih pinter, aplikasi makin
keren2, manfaatnya juga harus sesuai harga gadget yang ndak murah.
Kemarinnya saya ditelpon temen, adiknya yang SMP minta dijelasin macem2
tentang anatomi, nah kalau ada yang seperti ini akan lebih mudah. Saya aja
bingung sudah semaju itu ya kurikulum SMP?

Salam weekend,
-- 
G. Bimantoro
[y!] thebratasena
[[ b...@bratasena.com
[f] http://facebook.com/g.bimantoro

-- 
"

2. Problem in hard reset

Hi
i am trying to implement the factory reset in gingerbread. I want to
implement it in manual mode by pressing some
key combination. and directly booting in recovery mode.
I noticed that someone has been successful in eclair.


Can any one give me some pointer which code i need to look in android
framwork.

thanks in advance
qiu

-- 

3. Android Connect to python and send current location

4. searching for an app in Android Market

5. TextView looks great, but drawText() looks crummy !

6. SOAP response : URL data causes error

7. Layout sizes not determined when I need them