I am currently developing an android application that useLibsvm library for data
classification.
To use the Libsvm I should provide file text describing data
the size of my data=1,3G
I have placed all my files in assets Folder => copied them in sdCard and then running the
classification
The problem Now is that my application take a lot of time to be installed on my device!
It is possible to compress those files and the decompress them while running my
classification?
And How to do this in Android
move your resources to desktop and delete them from your app, this would be helpful for testing your app.
You could zip the file on the installation and make your service unzips it the first time it's used.
You may zip/unzip using the java.util.zip standard package.
Related
I have a chat app where users share images/video/audio etc. I need organized my directory structure, where i need to keep sent files in separate sub-folder and hide it from gallery apps but user can able to locate with file manager apps.
The only things comes in my mind that create .nomedia file in sent folders but in android 11+ we can't create files just like that. Our users gallery apps messed up with sent and receive images, I am not able to find any solution on StackOverFlow and on other documentations or google search.
On Android 11+ i am using MediaStore to read and write media files. Anyone have any idea how can i create .nomedia files in External Storage like Pictures/Movies/Documents etc.
I am creating .nomedia below andoird 10 like this but i have no idea how to create in android 11+
File file = new File(dir+".nomedia");
file.createNewFile();
I'm trying to download a small file (0.3 KB) from a given zip file that's around 3-5 GB in size.
I have currently been using the native library libfragmentzip using JNA, which is very fast, but has issues of its own that come with using native libraries (like not being cross-platform).
I have tried this solution, but it is much slower and ends up taking minutes compared to using libfragmentzip, which only seems to take seconds.
This is a URL to a test zip file (the extension is .ipsw but it is really a zip). The file I am trying to download is BuildManifest.plist, in the root of the zip.
Is there a fast way to download a single file from a remote zip file without using a native library?
You can insert BuildManifest.plist at the end of the URL.
For example:
http://updates-http.cdn-apple.com/2021SpringFCS/fullrestores/071-34317/E63B034D-2116-42D0-9FBD-97A3D9060F68/BuildManifest.plist
I've got an xml file I need to access(read only) from core. I tried putting it in the Android assets folder since that's shared, but ironically only the desktop version of my app can access it, the Android one doesn't see it at all. "Gdx.files.getLocalStoragePath" points to a different location on the Android version. Is there a spot I can store an xml file so I can access it via core?
create FileHandle object using your file.
FileHandle handle = Gdx.files.internal("data/myfile.xml");
parse that using XmlReader, that is in libgdx bundle.
I have a swing application that uses many data files, these data files will change time to time. How can I load these data files on client's machine? Is there any way to create a folder like structure and run a batch file or so? Any help is appreciated.
There are several ways to do this:
Assume you want to ship your application with the datafiles, you may embed them as a zip/jar in your application-jar-file.
Extract the embedded zip to a temporary local file and use ZipFileSystemProvider to extract the content to some place on the disc.
Here is an example how to extract some content from zip/jar-file embedded in a .jar-file downloaded by JWS.
Same as 1, but skip the zip stuff and instead provide a list of all the resources you want to extract
One other way is to create the files pragmatically using either java.nio.file (java 7+) or java.io.File
I'm trying to create an app and have the ability to save files to /data/data/(packagename)/files or a directory similar to that. The goal would be to have a pdf or doc handler, as necessary, open the files stored on the internal storage and be viewed by the user. I have the code to get a pdf reader that is installed and display the file but I do not know how to package the files so they are installed in a directory like the one above. Also, if I am able to do this would I use getResources to access the files? How should the file structure look in eclipse to make this happen on install of the APK?
I do prefer to have the files stored internally (they are small) and not on the SD card.
I admit I am new to this and am trying to learn as I go. Thanks for the help!
As I understand your approach you only need to place your files to assets folder of your application and then just copy them to the internal storage. Read more here.