Or alternatively you can put your asset files under 'assets' directory
in your package. AssetManager helps you opening those files, however,
parsing is really up to you.

Anyway, I let the users of my application edit preferences and for
that I use PreferenceActivity along with PreferenceManager. Might be
useful for you, too.

On Jan 30, 8:59 am, "hmmm" <[email protected]> wrote:
> You can place your ini file (or any file), say config,ini, in the 'raw'
> subdir of the 'res' dir and then use
> InputStream is = Context.getResources().openRawResource(R.raw.config)
> But then, I guess, there's no API in android dealing with ini files
> specifically so you then might want to create your own class to represent an
> ini file
>
> ----- Original Message -----
> From: "Paranoia" <[email protected]>
> To: "Android Developers" <[email protected]>
> Sent: Friday, January 30, 2009 10:32 AM
> Subject: [android-developers] Re: How to handle ini file in android?
>
> i want to use ini file as my config files. how to use ini file in
> android instead of xml file. i mean replace xml with ini in android
>
> On Jan 30, 11:48 am, Dianne Hackborn <[email protected]> wrote:
> > Android doesn't do ini files; we generally use XML for these kinds of
> > things. You will probably need to find a parser elsewhere, or write your
> > own, and compile it into your app.
>
> > On Thu, Jan 29, 2009 at 6:59 PM, Paranoia <[email protected]> wrote:
>
> > > Thanks
> > > but it seems that this method can not handle the ini file with
> > > multiple sections.
> > > e.g.
>
> > > [Section1]
> > > X=a
> > > Y=b
>
> > > [Section2]
> > > U=c
> > > V=d
> > > ...
>
> > > On Jan 22, 2:37 pm, Freepine <[email protected]> wrote:
> > > > Hi, maybe you can try
> > > > java.util.Properties.load(InputStream<
> > >http://code.google.com/android/reference/java/io/InputStream.html>
> > > > in)
> > >http://code.google.com/intl/zh-CN/android/reference/java/util/Propert...)
>
> > > > On Thu, Jan 22, 2009 at 2:14 PM, Paranoia <[email protected]> wrote:
>
> > > > > i can not find any utility to parse the ini file in android. any one
> > > > > can help me?
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > [email protected]
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support. All such questions should be posted on public
> > forums, where I and others can see and answer them.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to