Hot to open property file in my application??

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Hot to open property file in my application??

Postby Premier » Mon Jul 20, 2009 2:10 pm

Hello,
i want to use a property file in my application.
I putted config.properties in my application package. When i try to open it by
Code: Select all
getApplicationContext().openFileInput("config.properties")
exception was catched. The message is "unable to find config.properties in /data/data/myapplication/files/confi.properties".

I can put the file in that folder in emulator and, so, it will find the file. My problem is real device, how i can put config.properties in that folder on real device?

Thanks in advice, regards.
Premier
Junior Developer
Junior Developer
 
Posts: 21
Joined: Fri Jul 10, 2009 4:04 pm

Top

Postby TheChosen » Mon Jul 20, 2009 2:55 pm

Why don't you use the shared preferences within your application? You don't have to worry about file permissions then: Data storage within android: shared preferences
TheChosen
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Tue Jan 06, 2009 7:18 pm
Location: Germany

Postby Premier » Mon Jul 20, 2009 3:23 pm

TheChosen wrote:Why don't you use the shared preferences within your application? You don't have to worry about file permissions then: Data storage within android: shared preferences


Thanks, it is very usefull, but config.properties is a my example just for post on forum :)
Really, i need to read a xml file, so i need to open it.

How i can do?

Thanks
Premier
Junior Developer
Junior Developer
 
Posts: 21
Joined: Fri Jul 10, 2009 4:04 pm

Postby TheChosen » Mon Jul 20, 2009 3:31 pm

Just a few lines further down on the web site that I told you, you will find files as a storage as well...
TheChosen
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Tue Jan 06, 2009 7:18 pm
Location: Germany

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 6 guests