I need a library that can open zip file like virtual file system programmatically and work with inner files and directories (read JSON, install apk). Is there are any library for that? The main thing, i shouldn't extract zip.
As far as I understand the problem , You can use it. https://github.com/hzy3774/AndroidP7zip
Related
If I have a .txt file in a project folder of an Android project and I build this project as .apk. This file is accessible for the user from the Device Explorer or in hidden into the .apk?
(I apologize for my english)
You can also access the streamingAssetsPath (read only):
https://docs.unity3d.com/ScriptReference/Application-streamingAssetsPath.html
and the persistentDataPath (this is a folder where you can read/write data, accessible to your users... but you can access this folder only after the installation):
https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html
To read files in the streamingAssets on Android you need to use WWW class but everything is explained in the docs (with an example).
Read this to understand if you really need to use Resources folder or it's better to use streamingAssetsPath:
https://unity3d.com/learn/tutorials/topics/best-practices/resources-folder
if you want to undestand the difference I suggest to read this:
https://forum.unity.com/threads/resources-vs-streamingassets-for-mobile.494804/
Unity will produce a .apk-file.
Your .txt-file will be baked in if:
Its referenced by something in the scene
Its in the Resources folder
I am trying to link my Android app with a third-party archive. This archive, libvpx_new.a,is one among many archives that are being created as part of building webrtc for Android (on Ubuntu). I copy this archive and the header files into C:\ThirdParty directory on Windows. My Android app tries to link with ThirdParty/libvpx_new/libvpx_new.a.
When the build runs, I get link errors such as:
xxx/arm-linux-androideabi/bin/ld.exe: error: cannot open
C:/ThirdParty/libvpx_new/source/libvpx/vp8/libvpx_new.vp8_dx_iface.o:
No such file or directory
If I simply copy all the missing object files (in appropriate subdirectories), my build goes through. It is as if the archive file libvpx_new.a contains links to the object files instead of storing the actual functions.
Is this possible? If so, is there a way to fix the archive file to just absorb the object files instead of pointing to them? Regards.
It turns out archives can indeed store external links. Such archives are called "thin" archives. Look at Turn thin archive into normal one to convert thin archives to normal archives.
I am trying to link to an external file from a shared repository between my iOS and Android apps. This does not present a problem for iOS, but it does for Android. My current solution is to create a copy of the file from the external repository and place it in my projects Assets folder. This solution works, but is not much of a good one in my opinion and involves too many extra steps.
Using Eclipse, I am able to link to a resource. It's as simple as copying a file into my Assets folder and being prompted to either copy the file or link to the resource. If I link to the resource and try to run my app, I get a FileNotFoundException. If I copy the file instead, the app file is found just fine.
Ideally, I'd like to link to the file so that when I pull a new update from git then I don't need to copy the file over every single time. I'd prefer to link to the file.
I don't know what Eclipse uses "under the covers" for "Link here" drag-and-drop stuff. However, it is an Eclipse-ism. Android's build tools are fairly isolated from Eclipse proper, and so they won't know about those links.
Using a hardlink, or perhaps a symlink, at the OS X filesystem level should work, as both Eclipse and Android's build tools should treat it like a local file.
How to load a jar file from assets folder of android application during run time. Loading from assets folder is my requirement. Is there any way to do this. Please help ..
I got the answer.I am adding this answer here. Because this may be helpful to some others searching.
There are steps to accomplish this.
You have to make a copy of your JAR file into the private internal storage of your aplication.
Using the dx tool inside the android folder, you have to generate a classes.dex file associated with the JAR file. The dx tool will be at the location /android-sdks/build-tools/19.0.1 (this file is needed by the Dalvik VM, simply jar can not be read by the dalvik VM))
Using the aapt tool command which is also inside the same location, you have to add the classes.dex to the JAR file.
This JAR file could be loaded dynamically using DexClassLoader.
If you are making a JAR from any one your own library, you have to do this steps (1-4) every time when there is a change in your library source code. So you can automate this steps by creating a shell script(in Mac/Linux/Ubuntu) or batch scripts(in Windows). You can refere this link to understand how to write shell scripts.
Note : One situation for implementing this method is, when it is impossible to add the JAR files directly to the build path of core project and need to be loaded dynamically at run time. In normal cases the JAR files could be added to the build path.
please check this link for the detailed code and implementation.
How to load a jar file at runtime
Android: How to dynamically load classes from a JAR file?
I saw here that someone listed the contents of the manifest of the official Facebook app's APK. Is there a way to decompile that, or is that info available elsewhere?
An APK file is just a JAR - change the extension to .JAR, and use a decompression tool to decompress it.
If you're using windows, you could just use WinRAR - that should decompress JARs.
In addition to that, a JAR is just a regular ZIP file - so you could technically just change the APK extension to .ZIP instead, and open it up using pretty much any decompression tool (as mentioned by Peter).
Here's some more info on JARs:
http://en.wikipedia.org/wiki/JAR_file