Why I can't use JMF on Android? - java

I don't really have or want to use the Java Media Framework (JMF) on Android but I am looking for detailed information about why it's not possible to use it. (I know that it's considered as outdated anyway and I am aware that there may be better ways to achieve certain things in Android using this for example: http://developer.android.com/guide/topics/media/index.html)
Nevertheless I need more information regarding JMF on Android but all I could find is, that "JMF isn't working on Android" - but I wonder why.
So I have two questions:
Do you know any kind of "official" statement, for example from Google or Oracle, saying that JMF isn't supported on Android? I wasn't able to find something like that.
Why is JMF supposed to be not working on Android? I am interested in the technical details and would be grateful for all kind of references.
Thank you!
EDIT:
To be a bit more specific and clarify my approach: I built a tiny test-app and tried to play an audiofile the same way as I have done in a standard java desktop application (which was working as expected). I included the JMF.jar (for now without any modification) compiled, deployed and started the app - no problems so far. The (first) exception (javax.media.NoPlayerException) is thrown when calling Manager.createPlayer().
That was actually the point where I stopped and wondered if it's worth digging deeper, although the result is kind of predictable. I decided to ask about the technical background first, instead of figuring it out the hard way in hours of testing and debugging (the reason is not a lack of interest but unfortunately a matter of time at the moment).

I am looking for detailed information about why it's not possible to use it
Because it was not included in the Android SDK. Lots of things from Java SE were not included in Android.
Do you know any kind of "official" statement, for example from Google or Oracle, saying that JMF isn't supported on Android?
I am not aware of such a statement. They also have not released a statement indicating why Android does not integrate with the Hubble Space Telescope, why it does not include shoe-shining APIs, etc. There are an infinite number of things that are not in Android; it would be impossible to list them all.
More generally, Google faces pressure to keep a lid on firmware size, as the bigger the firmware, the more expensive things get (required storage, OTA update costs, etc.). Hence, they only include a subset of the Java SE SDK as one way of helping reduce firmware bloat.
Why is JMF supposed to be not working on Android?
Because it was not included in the Android SDK. I have no idea if it is possible, let alone practical, to create a fork of JMF that offers a JMF-like API but uses Android media capabilities under the covers.

Related

Android VoIP call implementation

First of all I'm a newbie in VoIP implementation. I need to implement VoIP single and group call in android application. Could you tell me, what is actually the best way to achieve this ? I'm looking for Android SIP library (probably open source) which should:
has good documentation with simple app examples
be ready to use with java
Maybe just native android SIP api will be the best ? But I heard that it doesn't support group calls.
Most of the voip libraries use C/C++ implementation for various reasons. You can use PJSip which is a C voip/sip stack. It has a good documentation but you have to build it yourself using android ndk . It has good documentation and also contains processes to build it for Android and other platforms. But there is no java/android wrapping built in so you should do that yourself. Another option is Liblinphone which is also based on C stack but provides all of the wrapping and implementations out of the box so you don't have to bother so much on native codes. It also has a sample application which you can try yourself. One downside of Liblinphone is that it lacks proper documentation and you have to dig in more.
Regarding the android SIP api, I don't think it is a good option as it has much more limitation and hardly maintained. It is based on Jainsip stack which is a 100% java stack but is too verbose. I personally would like to recomment Liblinphone as I am currently implementing it and am pretty satisfied with it. Best of luck...
Update
Here is the source code of linphone for android if you are interested in it. You can get pretty much idea of Liblinphone for android from it. You have to dig much more into the sources though.
You can have a look at Restcomm Android SDK:
It's open source, with an active community around it
It using SIP for signaling and Webrtc for media so should work nicely with NATs, etc
Comes with 2 sample applications that you can play with and alter their code to experiment
Comes with quick start guide, reference doc
You can check the Olympus sample App right away by installing the .apk from this link
Notice that the SDK doesn't support group calling out of the box, but you could combine it with Restcomm-Connect open source platform to add such functionality very easily. Restcomm-Connect also comes with docker, so you should be able to install it right away.
Please let me know if you have any questions
Best regards,
Antonis

Python for Android Apps

I've learnt python recently and I want to make an app for android. But everywhere on the net, it seems Java and Eclipse are the only ones that can be used.
So, my question is:
1) Can I use python to make an android app?
2) What kind of platform should I use to make an app with python?
Thanks guys!
If you're just looking to run Python scripts, try QPython.
If you're looking to make your Python code run like a native app, or just something more robust than the above, try SL4A.
If you're looking to effectively use Python as a library, and compile an .apk with the Python library included, try Kivy: github.com/kivy/python-for-android.
That said, you'd likely get a lot of benefit from learning Java, and not just for programming natively in Android (which would give you access to a much wider feature set and make your app run more efficiently).
Check out the Scripting Layer For Android, aka SL4A.
Here is a blog for getting started. The blog promises more entries in the series but there don't seem to be any. Still, it is a great starting point. There's quite a few parts to pull together so be patient and check the bottom of that blog entry for dozens of useful links.
If you want to contain everything to the Android device, including the IDE (pretty slick), check this out.
Here's a book from APress that could help with more advanced concepts: Pro Android Python with SL4A

Android development without SDK

To get a better understanding of what I'm actually asking let me outline my situation (I think the wording of my question is off, but couldn't think of how to word it better).
I'm currently working in a team of 4 people to develop a basic OCR app. I'm focused on the algorithm side, developing the pre-processing and implementing the OCR. I want as little to do with the app side as possible; as from what I've read so far, it is quite a steep hill to climb and I have enough to do without learning to develop the app from scratch.
So my questions are:
Is it possible to develop my code in a black-box style that I can hand to the app developer and say "Here's a list of functions, go for your life"
Is it possible to do the aforementioned in a way that I can test without the Android emulators?
Is it possible I can do all that without even needing the Android SDK? (given that I can develop my code to deal with specific formats of information. e.g. int[][] for pixel data)
You can certainly write and develop the algorithm without a dependency on the Android SDK, and ship an artifact (whether source code or a JAR) to the Android developers.
However, you will be able to reduce the length of the feedback loop if you at least have an Android test project that takes whatever artifact you ship to the Android developers, and run at least some tests on it - given the number of differences between the Android and Java SE runtimes, it is practically guaranteed that you will run into bugs due to platform differences.
Update: If you write native code or use a native library, I do not think you could easily give a working artifact without using the Android NDK.
As long as your code has no reliance on the Android SDK then certainly you can develop and test without it. Just be certain your code also has no reliance on other APIs (AWT, for example) which are not on the Android platform if Android is your intended target. Finally, be sure that testing is complete within the Android environment, once you're satisfied things are working in general.

Fastest path to Android development for a non-Java programmer

The decision to jump on the Android bandwagon has been made. The entire development environment has been installed and configured properly. I went through the steps suggested in http://developer.android.com/sdk/installing.html and even managed to "write" the Hello World application and run it on the emulator. :)
Unfortunately, however, I am not an experienced Java programmer and so, despite successfully completing all the suggested steps, and consulting an excellent speedy Java tutorial for C++ programmers, I feel that a lot is missing on the way to mastering Android development.
It would have been great to first master the Java world (note: I didn't say language, as Java is so much more than just syntax), then delve into Android, but in the real world there are deadlines to meet and so starting to develop/learn directly on Android is very tempting...
My question: Is it possible to develop good Android code while skipping the step of being an experienced Java programmer?
Do you know of a fast track that allows mastering both?
I have come from .NET and it was very easy to pick it up.
I bought Android Pro 2 book and that was all I needed.
UPDATE
Well, it seems that a few people have found the book really terrible because of typos and errors in the samples - and even in the book itself.
In any case, as you will find in the comments, this is by no means a definitive answer and please read Amazon reviews and choose the one you prefer. This worked for me since I need to understand the concept and then pick up the samples from Android documentations itself.
I believe a great share of Android developers come from other languages without any knowledge in Java at all. In fact all you need to know about Java in order to write Android code is it's syntax and core APIs: java.lang., java.util., java.net., java.io. etc. The rest is Android-specific APIs and a profound Java programmer won't have much advantage over you in learning them.

Starting with Android: Java or Python (SL4A)

I just ordered an Android smartphone and want to start playing around with creating my own applications. Now the question is which language to use, the native Java or Python using SL4A (former ASE).
I tend to Python, as I know it much better than Java, but I'm wondering what I would be missing using a "second class" language on Android. On the SL4A website it is also stated to be alpha quality software, which is not exactly encouraging.
I'm also not quite sure what the limitations of the scripting environment are and if they would be problematic.
At the moment you cannot create a releasable program with Python (or any other scripting language) using SL4A. I have heard rumours that this is something Google is working on, but even if they do enable it Python apps are likely to be slow and power-hungry compared to Java. Also the scripting API only gives you access to a limited subset of the native Java API. I would not consider using SL4A for serious development work at the moment, only for one-off scripts and prototyping.
Take a look at Scala. It is a statically typed language on the JVM, but uses type inference to remove most of the noise that you get in Java. It also fully supports functional programming, and has a lot of pythonish features. Because it is statically typed it is as efficient as straight Java with none of the disadvantages. IMHO it is the language that Java should have been in the first place.
A lot of people are blogging about using Scala on Android, so Google around for more information.
More likely will depend what type of applications you will develop.
I would start with Java to become familiar with Android SDK. Anyway first you need to look into some examples, tutorials. Most of them are done in Java, and only a few, probably on the dev site of SL4A for that.
Also there is native development Android NDK, that can be programmed with C++.
But anyway Java rules for general applications.
Adding an update to Dave Kirby's answer:
Issue 55, Distribute scripts as APKs, in the issue tracker at SL4A deals specifically with that.
There is a solution being worked out (may be complete by now) described at SharingScripts. The only issue seems to be that you need to have a interpreter APK already installed.
you may want to check out Ruboto it is a framework for developing Android apps based on JRuby which means your JRuby code can call Android APIs and can also be called back from the Android Java side.
Here is an introduction article .
Consider ising Kivy, if you want to write Android apps with Python. The process of packing script to .apk file is described here.
The problem is, resulting .apk will be big (~7Mb for 300Kb data). It is obvious, because you need to pack there Python runtime and all libraries.
Another solution I have heard of, is Pygame for Android, but it works on lower lewel, so you need to draw graphics manually.
Unfortunately, I have not tried any of this ways yet, but it looks, that I'm going to start using kivy soon.

Categories