I have an application with a lot of data resources in the res-drawable folder, is it possible to put the res folder in expansion file or i need to make changes in the code? i tried to read about this in the expansion files documantation but cant figure it out.
is it possible to put the res folder in expansion file
No, sorry.
i need to make changes in the code
Yes.
Related
I want to add my one file (example mp3) inside an apk so that when user start that application for the first time it should copy that file into phone memory.
Can someone give me some suggestions regarding how to do this?
Try putting the mp3 file in the assets/ folder. if your project doesn`t have one, create one on the same level as your res/ folder. Then, when the app runs, save the file to the sd card.
Have try to put your file into raw or asset folders.because when AAPT packaging for .apk with .class then its focuse goes to res folders and then at last to manifest file...so when you puts your file into these folders then these files takes their space into .apk.
And use a variable to know your Application is installed for very first time then make folders(where you want) to copy that file...
I am planning my android app with some files in the app folder, but i didn't figure out how to add files to my project. I don't want to use the files as resources because the user should be able to save or download more files in the same folder and i just wanted to add the basic set of files.
Can anyone help me? :/
I don't want to use the files as resources because the user should be able to save or download more files in the same folder and i just wanted to add the basic set of files.
There is no direct means of doing this. If you package your files as assets (in assets/) or as raw resources, you are welcome to copy them out of your APK into internal storage on first run of your app.
can i create folders, besides raw folder, for storing different kind of files?
For examples, my application need to count all the images put in a folder.
So, I need a specific folder for images only, and other folders for sounds, for .txt etc!
But when i tried to create a new folder, I couldn't reach it :(
It is just a hunch, but you might have more luck using the assets folder instead. You can certainly use it to store embedded web sites which have subfolders.
In general you cant create custom resource folders. But you can use assets dir and place your resources there. You can make as much subfolders in assets dir as you need. But android won't help you to manage your files in assets dir. Read this.
I'm trying to develop an application for android...
The question is, I need to Edit or create(if not existing already) an XML file in the Resources folder or Assets folder(anyone will do)...How can I do that?
I can get the XML file to open from the Assets folder using the
getAssets().
But I need to modify its contents and store it again somewhere....
I don't want to save it on the memory card....Please Help...
I hope you guys will do....Thanks in advance...
The question is, I need to Edit or create(if not existing already) an XML file in the Resources folder or Assets folder(anyone will do)...How can I do that?
You don't. Assets and resources are read-only at runtime.
But I need to modify its contents and store it again somewhere
Store it in a file using Java file I/O.
I need to place a raw *.txt file in my android-project to read from it and output general terms and conditions in a dialog.
However, Eclipse shows, that my .txt file contains errors (see title). It's not an xml file and should be treated like a raw file. Why the error?!?! How can i fix it?
Thanks in advance.
Solved:
Eclipse restarting does NOT help.
Creating a file with the eclipse 'New File'-Wizard on the raw folder helps. It's kind of a bug.
DONT: Create a file in another folder and put it in the res/raw folder afterwards. Eclipse doesn't recognize the file has been move to a folder where problems should be ignored. Alittle buggy tho.
It sounds like it is interpreting it as an XML file; is it in res/raw or assets/ ? Non-xml resources should be put in one of those two project directories.