Android Anim Folder - android

In my Android SDK folder on Windows I have found anim folder with lot of different .xml files, but in my application in eclipse when I try to load one it only shows me few of them. How can I access those rest without creating custom XML file and pasting the code into it? I mean can I access them like R.anim.file.xml ?

Yes. There is an R.class file precompiled and given for you by the Android SDK. You can simply refer to it by android.R.anim.slid_in, android.R.anim.slide_out etc.
Find more out about it here: http://developer.android.com/reference/android/R.anim.html

Related

Correct drawable folder for SVG assets

I assume the correct folder is drawable-nodpi.
I just need to know this so that I can set up PNGexpress in Photoshop to generate the folder automatically (on asset export) and know that im not forcing my developers to move the files around a bunch on their end.
Fire and forget type approach - best to be sure than assume though!
Thanks!
If you create the SVG from inside of Android Studio it puts the file inside the drawable folder. You can check it here: https://developer.android.com/studio/write/vector-asset-studio.html in the 7 step of the section "Adding a material icon".
So, with this, I would choice to use the drawable folder to keep the same behavior as Android Studio.

Is there a way to add such folder in Android project that do no get compiled up to **apk**

I was looking for a way to add some such folder in my Android Project that do no get compiled up to my apk file.
Why I need it :-
We need to maintain proper documentation for project (that actually
everybody needs to ;) nothing new),
but I find it very irritating to look out for that documentation
folder again and again.
.
I am open for any way i can make dcocumentain folder easily one
click accessible (I am already doing it thru taskbar sortcut. ) But
I want it to get the ease of version control thru Eclipse likewise we
do it for our project
IDE :- Eclipse
I got a way myself :-
I had an idea that if I create a folder in my application project with
some anonymous name that actually android has not listed in its
directories ("I am talking about the default one like "res", "src",
"anim"......)
Then either it should "raise an error" or should "ignore" it while compiling to form apk file
luckily it ignores any such folder. now i can put all the documentation in my project.
NOTE:-
My answer empirically driven
I had tested it by creating a "Docs" folder and then copied 1 GB of
random data (includes almost all type of files we came across from
multimedia to zipped ones).
Then I build the apk and the size of the apk was in-effective of all
this..
but when i copied the same data to assets it was showing a huge change
in size of my apk file..
Consider using Javadoc in addition or, if possible, instead of any other documentation.

Android load and modify file

I have a short question about writing to a file in android. I am writing a game where I use a xml file to save some data about the level stats. Now I have seen that if I save this xml file in AssetManager it is not possible to change it (only permissions to read files).
Now because I can only modify files which are in the filesystem of android (using openFileInput and openFileOutput to work with it) I wonder where I have to save my (already existing) xml file in my eclipse project so that I can use openFileInput to load it and change it via code.
Do I have to make a new folder? E.g. project_path/files/myxml.xml.
Is it even possible to load a file which was created (outside the AssetManager folder) before installing the .apk to target?
If it is possible does anybody have some example code?
I hope you understand my question.
There is no such place. Installation of android apps does not include an automatic step that would copy your content from apk to the internal folder (and your application does not reside in the folder either).
You will have to create your XML file in code, possibly checking for its existence before each access (or using some other marker).

Data in XML: where to place it

I am trying to design a new Android application.
For that application I will have an XML file that will be located somewhere on the server. This file will be generated from the mySQL DB.
For now (developmental phase) I got a simple and small XML file that I need to put in the Android Eclipse project in order to read it and present the data on the phone.
I just tried to put this file in res/values, but compiler gives me an error: "Invalid start tag".
Looking through the stackoverflow and google I see a lot of different answers and google even give me an answer of how to parse xml file on Android. ;-)
So is there a "standard" place where such XML file goes in Android Eclipse project? Think about it as the data that is read from the DB.
Some answers are to place it in the res/xml folder. I just made a brand new Android project and I don't see such folder in it. Do I create one? Shouldn't it be done automatically?
Some says you need to put it the res/raw folder. Again it is not present in the Eclipse project. Do I make one? Shouldn't it be present already?
Please clarify.
Shouldn't it be present already?
It doesn't have to. There can be thousands of folders inside res/ folder. You don't want to have them all at first.
Do I make one?
Yes. Add folders when you need them.
Some answers are to place it in the res/xml folder.
Some says you need to put it the res/raw folder.
The difference between these folders is that files inside raw stay the same you put them and inside xml are parsed when APK is created and put there in a binary, optimized form, similar to what happens to layouts, AndroidManifest and other.

how we can remove a file from the assets folder at runtime in android?

how we can remove a file from the assets folder at runtime? Is it even possible?
Here is a discussion about it:
http://www.mail-archive.com/android-developers#googlegroups.com/msg16172.html
Seems like the apk is read only and you wont be able to modify it.
Edit:
Check commonswares answer here:
Security of Android assets folder
He is saying the same thing, you can't modify it at runtime.

Categories

Resources