I'm writing an Android application that need to extract 7z archives.Pressed for time,I've searching of third-party libraries or source code which can be used in my project.
At first, i find J7zip from http://sourceforge.net/projects/p7zip/files/J7Zip/
After modifying the two sample classes, it works in my project, that's exciting! but the problem was: 1. It would cause out of memory errors when extracting larger archives 2. It only support archives with Copy or LZMA codec. I'am so sad about this...
Then, i find this:"J7zip on Android - Extracting From an Archive and Listing Contents" in StackOverflow. My requirement is seriously similar to this question.As it mentioned andro7z, it contains C/C++ code from: http://sourceforge.net/projects/p7zip/files/p7zip/; I believe this's a good solution for me.
andro7z not contains "How to use" doc and I'm new about JNI, i have no idea about how to modify the andro7z to suit my project. So, anyone had implemented extracting 7z archive with andro7z? Could You share me the demo code or steps to implement this? thanks!
I have finished this project by myself,the classes under folder "jni/7z" and "src" need implemented by yourself;if you need to support encrypted archive, you should call methods in 7z.dll or modify the source code in C/CPP folder, C/CPP are 7z source code.
Related
I'm currently trying to find a solution to have an AIR native extension including a C - library for Android that is using JNI.
So far, I tried to pack the .so lib into a jar, which then is packaged into the ane.
As I learned here, I have to unpack the .so from the .jar first in order to access it.
The code found there seems to be working for a regular android project, unfortunatly when doing this for a .jar which is then packaged into an .ane, it seems to lose scope, resulting in a
FileNotFoundException: File path/to/my/lib was not found inside JAR
I already double and triple checked all paths and the contents of my jar. It's all there and spelled correctly.
Q1: How do I get access to the .so from actionscript?
Q2: Is there any other way to package/address the .so besides the regular extension-jar into the ane?
Q3: I really don't know much about the inner working of the .ane mechanism. Is it also possible to skip the .jar-wrapping and use the .so directly from actionscript?
As always, many thanks for any input.
It becomes a bad habit of me to answer my own questions, but anyway...
Sometimes the docs can help. Here in the adobe docs I finally found the solution.
Simply copying the .so to the libs/armeabi-v7a folder in my ane package directory includes the lib into the ane, so I can use the .so from inside the java code of my extension.
Sorry for bothering.
I am trying to compile ffmpeg for a android. I have found several posts on this theme but non of these seems to work. If tried to build ffmpeg like it is posted on [1]. Did anybody successfully compile ffmpeg using theses tutorial?
I am not sure how to realize step 4 to 5.
STEP4: Configuring ...
STEP5: cd to your NDK root dir, type make TARGET_ARCH=arm APP=ffmpeg-org
It seems to me that building an application like it is explained in the tutorial in step 5 need some previous steps. Unfortunately I have no app in the folder to make. I am using the current android ndk release 3 and checked out the actual ffmpeg releases from [3] and [4]. I am thankful for every advice.
[1] http://slworkthings.wordpress.com/
[2] http://gitorious.org/~olvaffe/ffmpeg/ffmpeg-android
[3] http://ffmpeg.org/download.html
After looking around the net. The only working solution I found is supplied by Bambuser which ported ffmpeg to use in their android application.
Code is here: http://bambuser.com/opensource
Basically you copy the .so files to your jni/lib directory, along with any .h files you might need, create a JNI wrapper through javah, and it works.
EDIT:
Since this post was written a few packaged ffmpeg projects for android surfaced, one of the easiest ones to compile and use is here: https://github.com/guardianproject/android-ffmpeg .
It takes the approach of statically compiling a binary (not a library) that is ran through shell command in run time. Search github for 'android ffmpeg' for forks and related projects.
Did not find a well packaged method based JNI implementation, though.
I found a guide on ffmpeg on android here:
http://rxwen.blogspot.com/2010/05/use-ffmpeg-to-setup-streaming-server-on.html
He explains in another post how he got to do native programming on android to install ffmpeg. Hope it helps.
I will provide a more updated list of sources which will explain how to build and, in some cases, even use FFMPEG on Android.
This is the guide I liked the most: http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/
If you need more options, you can take a look at these, which are equally good:
https://github.com/guardianproject/android-ffmpeg
https://github.com/halfninja/android-ffmpeg-x264
https://vec.io/posts/how-to-build-ffmpeg-with-android-ndk
In NDK r3, when you use the make command, the NDK will simply use the name of the folder in the "apps" folder for the name of your project. This assumes that you have your FFmpeg source files and android.mk somewhere within NDK/apps/ffmpeg-org/jni/
In otherwords, ensure that your foldername is set to ffmpeg-org.
EDIT: You might find it worthwile to use NDK r4 which changes make to ndk-build. In this new NDK, you don't need to have your project set up in any particular way, as ndk-build simply searches your project for Android.mk files to tell it what to compile.
I want to learn how to decompress a .rar file in android. Zip files can be easily decompressed using ZipStream. Is there any similar way for rar files.
I just realized this with jUnrar from here
https://github.com/edmund-wagner/junrar
Create a new package within your Android src directory called
com.github.junrar
You should delete com.github.junrar.vfs2 because it has some dependencies and you probably won't use it anyway.
You will probably get some errors about the logger class. You can either remove the few logging lines or like i did write a tiny wrapper which communicates with android.util.Log. I did that and changed the includes.
If you finished importing the code take a look at jUnrars testutils.
I used this and it worked out of the box:
https://github.com/edmund-wagner/junrar/blob/master/testutil/src/main/java/com/github/junrar/testutil/ExtractArchive.java
Hope it helps
RAR isn't very commonly used (except in certain niches), so you won't find support for it built into the Android libraries. Probably the easiest thing to do is to get a Java library that handles RAR files, as covered in this question:
RAR archives with java
I want to how a .mk file works and where I have to use it? I have some downloaded source code and it includes lots of .mk extension files and I am stuck not knowing how to handle it.
Seems like you came across a project using native code - Android NDK.
Check the samples provided on the link for more detailed information about building and running such a project.
I am trying to compile ffmpeg for a android. I have found several posts on this theme but non of these seems to work. If tried to build ffmpeg like it is posted on [1]. Did anybody successfully compile ffmpeg using theses tutorial?
I am not sure how to realize step 4 to 5.
STEP4: Configuring ...
STEP5: cd to your NDK root dir, type make TARGET_ARCH=arm APP=ffmpeg-org
It seems to me that building an application like it is explained in the tutorial in step 5 need some previous steps. Unfortunately I have no app in the folder to make. I am using the current android ndk release 3 and checked out the actual ffmpeg releases from [3] and [4]. I am thankful for every advice.
[1] http://slworkthings.wordpress.com/
[2] http://gitorious.org/~olvaffe/ffmpeg/ffmpeg-android
[3] http://ffmpeg.org/download.html
After looking around the net. The only working solution I found is supplied by Bambuser which ported ffmpeg to use in their android application.
Code is here: http://bambuser.com/opensource
Basically you copy the .so files to your jni/lib directory, along with any .h files you might need, create a JNI wrapper through javah, and it works.
EDIT:
Since this post was written a few packaged ffmpeg projects for android surfaced, one of the easiest ones to compile and use is here: https://github.com/guardianproject/android-ffmpeg .
It takes the approach of statically compiling a binary (not a library) that is ran through shell command in run time. Search github for 'android ffmpeg' for forks and related projects.
Did not find a well packaged method based JNI implementation, though.
I found a guide on ffmpeg on android here:
http://rxwen.blogspot.com/2010/05/use-ffmpeg-to-setup-streaming-server-on.html
He explains in another post how he got to do native programming on android to install ffmpeg. Hope it helps.
I will provide a more updated list of sources which will explain how to build and, in some cases, even use FFMPEG on Android.
This is the guide I liked the most: http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/
If you need more options, you can take a look at these, which are equally good:
https://github.com/guardianproject/android-ffmpeg
https://github.com/halfninja/android-ffmpeg-x264
https://vec.io/posts/how-to-build-ffmpeg-with-android-ndk
In NDK r3, when you use the make command, the NDK will simply use the name of the folder in the "apps" folder for the name of your project. This assumes that you have your FFmpeg source files and android.mk somewhere within NDK/apps/ffmpeg-org/jni/
In otherwords, ensure that your foldername is set to ffmpeg-org.
EDIT: You might find it worthwile to use NDK r4 which changes make to ndk-build. In this new NDK, you don't need to have your project set up in any particular way, as ndk-build simply searches your project for Android.mk files to tell it what to compile.