I am trying to port pulseaudio to Android. I have compiled pulse audio on Ubuntu and it works fine with my build. However, I want to do this on Android and for that I need the list of files that are compiled during "make". I have disabled a lot of optional components by passing args to configure.
Is there an easy way to find the list of files that are being compiled so that I can use them on Android and discard rest of the files.
I know the hard way to do this using a strace and look for all open calls for .c files, but that obviously is not a good option (especially when the file count is very high).
Thanks,
If you run make -Bn, you should see all the compiled files.
Related
As clearly stated in NDK documentation,
The new .apk will embed your shared libraries, and they will be extracted automatically at installation time by the system when you install the package on a target device.
Now, suppose I included only a subset of all possible libraries, say only the armeabi one. Trying to install on an x86 device will result in the following error:
Installation error: INSTALL_FAILED_CPU_ABI_INCOMPATIBLE
Is it possible to disable platform checking and proceed anyway, since the application is able to fallback to a pure Java implementation of the native code?
My guess would be that it is not, however I believe including a nearly/effectively empty library for other platforms of interest would solve your problem at limited effort or package size impact.
I don't know for a fact that you'd actually need a valid .so for an architecture to pass the test, as opposed to a dummy file in the right folder with the right extension (assuming you never try to load it).
But even if you do need a valid one, you could just build the hello-jni sample for all architectures or something like that. Having a jni function you can call that returns if the library is usable or a stand-in might also be a simple way of solving the detection problem.
I downloaded LAME for Windows. It have two files, one is lame_enc.dll and another is lame.exe.
I want to convert an MP3 file from 320kbs to 128kbs.
In Windows I use command line: C:\Lame\lame.exe --preset cbr 128 "320.mp3" "128.mp3" - it works good. My question is how can I call lame.exe from my Android project? And what steps must I take to achieve that?
Thank you for your replies!
You can't call Windows executable files in Android, because they have different architecture.
It easy to understand, you can't run apk file on Windows if you don't have any converting or simulation softwares.
You can use extended libraries such as ffmpeg, lame to change bitrate of mp3 files. You can access this link to build shared library in Android:
http://developer.samsung.com/android/technical-docs/Porting-and-using-LAME-MP3-on-Android-with-JNI
You can't just "run lame executable from Android", because Android does not run Windows' executable files. Analogical you are not able to run MacOS applications in Windows without converting them/using emulator/etc.
I advice you to use something different than LAME for this job - I haven't used any of such, so I can't reccomend you anything right now.
EDIT
It seems that you may also easily port LAME for Android - Lame MP3 Encoder compile for Android
Is there some sort of alternative toolchain or language for Android, which can generate standalone APK files?
Ideally it should not depend on the huge and ever-changing, ever-upgraded official Android SDK.
As a parable, I am looking for a rough equivalent to how PowerBASIC and Mingw targets plain Windows just fine, despite Microsoft releasing new Visual Studios all the time.
Bonus points if this language or toolchain itself is an Android program...
As you may or may not be aware, the Android toolchain is based on a few simple ideas:
Your code is compiled using the plain old java compiler, and linked against the Android stubs (android.jar) for linkage against the system library.
After being compiled, the code is converted to dex format. You can actually run this yourself, just do a dx --help. The job of the dx tool is to take Java class files and convert them to dex code, a pretty straightforward compilation which involves going from a stack based to register based vm, and a few other changes.
After having this in place, an apk is built using a set of apk tools. It used to be apkbuilder, but this has since been deprecated. You can actually run this yourself as well. All an APK is is simply a collection of the manifest, resources, and a single file for all the code in dex form. (I.e., many .class files compile to a single .dex which is quite a bit smaller because of a wrapped web of pointers).
So the Android toolchain isn't really all that complex. The custom build process is handled by ant build rules, which are defined in an SDK wide build.xml, which you can find in the platform-tools/ directory (iirc). However, to generate new baseline projects using this custom build environment you simply use the android update project command.
While I'm not sure if this is the response you'd hoped for, I hope it will disambiguate the build process. It's not really all that complex of a toolchain, the majority of it is off the shelf Java, and not Android specific (all that makes it Android specific is library specific stubs for dynamically linked system code). Beyond this, once you have a set of classes, you need only run a few commands to make an executable APK which Android unpacks. I would suspect that any tool targeting the JVM (and capable of linking with the Android specific dynamically linked API) could perform a similar process of producing class files and using this toolchain to compile the rest of the way, though obviously the automated ant build process makes it much simpler.
EDIT:
After some more digging, I found this relevant android-developers thread. An unsettling quote:
At this time we simply don't have the resources to support people who
want to use their own build system, but we really wish we could. In
many ways we try to make it easy on other tools vendor by clearly
separating logic to eclipse or ant specific code (hence the multitude
of jar files everywhere in the tools and in ADT), but this is not one
of them.
However, you may also find this link helpful.
Terminal-IDE and AIDE are pretty much what I was looking for. Both runs on Android.
I am android developer.I am not aware of ant in android .I have downloaded a code from internet But It has file called build.xml but I am not able to find out what it is doing and for what purpose it is used please give some advise or some kind of tutorial.So I can understand its working thanks in advance.
When you are developing your application, Eclipse is the most convenient way of building the project.
However Ant is most useful when you come to produce a release version. You can set up your Ant build, such that it takes the same source files as the Eclipse project, yet produces a signed, zip-aligned version of the apk in completely separate output location.
By means of a custom build.properties file you can specify source and output locations, keystore names and locations and passwords. It also takes care of any Proguard obfuscation you may want.You can do all this from the command line with a single statement and know that you are going through a repeatable process, not vulnerable to a mouse click in the wrong place.
Have a look at Managing Projects from the Command Line and Building and Running from the Command Line
Take the build.xml from the sample project referred to and use it as a basis for your own project. It works pretty much out of the box.
This build file is an alternative (and less common) way to build your projects using ant.
Eclipse (and the Android plugins) do a n excellent job of saving you the trouble - just use the plugin to build your projects and export APKs.
I have some java code that I want to share with some classmates however I do not want to share the source with them.
What is the standard method to provide someone with a Java executable that they can use but they cannot see the source.
Not sure if this is relevant but the code that I will be giving them will be run on android.
It depends on what you mean by "they can use".
If you just want them to be able to run your application on their phones (or emulators) you can give them an .apk file, which is the standard format for Android Applications. The easiest way to produce an .apk is to use the Android Development Tools (ADT) plugin for Eclipse. Otherwise you'll have to use the aapt command.
If you want to allow them to add your classes to their applications you'll have to give them a .jar file containing your compiled .class files. However, it is possible to turn .class files back into .java files using a decompiler so you if you really don't want them to see your code you may be stuck.
There are tools - known as obfuscators - which make the decompiling process harder, but personally I wouldn't bother with them here as they also make debugging harder too.
It won't be possible for anyone to turn your .apk back into source. Android uses a different Virtual Machine to standard Java and so has .dex files with Dalvik bytecode rather than .class files with JVM bytecode, and currently there are no tools that turn .dex files back in to .java source files.
Package only the class files into a .jar file and don't give them the source.
Edit: Android has its own way of packaging applications, I would suggest using it.
Android doesn't use the Java runtime. I only uses Java as a source language, it runs a custom runtime with a custom bytecode format. You can decompile the .dex byte code, but not to Java source code, at least not at the time of this post.