I have an xml file (contains images) in the file. The file size is about 50M.
When i read it in flex
on iOS it read well, no problems. Everything is ok
but on Android always it gives me error #1085.
The file and code are the same in Android and iOS.
The XML file is valid - I have tested it on XML validator.
Can anyone tell me what to do?
Check the encoding of the file... it might be that the file is saved with a different encoding on android.
Related
I have a requirement like this. I want to read .webarchive File. I have one file with .webarchive extension and i have put that file in asset folder. I want to read that file on android webview. Is it possible?
I googled and found some useful link. This git content is really helpful.In this what it does is, put extracted content of .webarchive file in asset folder and from there data is shown on webview. My query is that i don't want to put extracted content in asset. I have file in .webarchive extension and want it to be opened directly in webview.
i guees zipInputStream is just for file name with zip format extension,and another thing is that i read some where that only that zip files will be extracted with ZipInputStram which have been zipped with WinRar Software,Well in my case what i tried is I have tried to unizip webarchive file with follwing method http://pastie.org/8516247 and here is a log what i am getting
http://pastie.org/8516249,
now from this log you can see command is not even entering inside the while loop at line number 6 which is proved by this:
log 11-29 13:01:46.903: V/Decompress(19936): 1
And if i am using any zip file inplace of test.warc at line number 4 than command is entering in while loop,that means this ZipInputStream is completely ignoring .WARC file,isn't it?
So if any one have idea how to extract .webarchive file or read .webarchive file without extracting it than please help me.
If any one having idea then please help me
Thanks
WebKit Bugzilla
Bug 42716 – Implement WebArchive for Android
That was RESOLVED WONTFIX in 2012.
Still, what's there could be a good starting point, or point of continuation towards an acceptable answer to this question.
I have a text file "test.txt" under the Resources, and a function "parseSth(char* str)" in the "util.cpp" to read the "test.txt" do something.
However, if I use like this parseSth("text.txt"), the ios and android all cannot find the file. And use parseSth(CCFileUtils::sharedFileUtils()->fullPathFromRelativePath("text.txt")) will work fine on ios, but cannot find the path.
Why? How I can do?
I suppose that your file is embedded into APK file on Android and thus doesn't have a path to it per-se.
Use the following function to extract data from the file (it automatically handles apk/sd card differences).
FileUtils::getInstance()->getDataFromFile(filename)
I need to save a xml file from sdcard to my android app, in res/values. How can I do this? Can anyone help me?
just use the java file command for your xml file on sdcard.
File file=new File("/mnt/sdcard/example.xml");
and using DOM or SAX parser you can parse the data(information) from it for your application.
Thnx.
EDIT: parsing local xml file using Sax in android, Read XML Resources in Android, using XmlResourceParser: XML parsing interface or Here or Here Look at these tutorials.
They are just folders in an Android project when you develop. When the app is compiled, everything in src and res is turned into binary code, and packed in one apk. Therefore I don't think that you will have res folder or anything like that in the device.
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.
I would like ask if there's a way to download an android layout from the Internet into the "res/layout" folder.
I was thinking in getting the file using an HttpUrlConnection and a FileOutputStream, like discussed in here Android download binary file problems but I can't fgure out how to put it into the "res/layout" folder.
Thanks!
Unfortunately the layouts in your 'res' directory are compressed at build time and include baked-in resource IDs that match your pre-built R.java. So it wouldn't be possible to take a new layout file at runtime and inflate it in the same way.
However layouts can be built up programatically (new Button() and so on), so you could probably make an XML format and reader that was quite similar to the standard layout format.