I am working on an Android app using Android Studio v 1.4 and the minimum sdk version is 14 and what I am trying to do is building a simple VPN client that implements PPTP and L2TP protocols.
I have googled and searched here in Stack Overflow and I have looked at the Android sdk VPN sample called toyvpn and also looked at the official documentation for the VPN Service class.
How to implement PPTP or L2TP with VpnService on Android Platform?
Is there any code samples,libraries or even a starting point to such an implementation.
The question is an interesting one. There is a fundamental flaw though in how it is phrased. I think the question is too general. However, I still think it is useful for direction.
First as others are saying VPN's are very complicated and I am sure many others would recommend not taking that on. However, there are many solutions for your needs. You mention PPTP.
"Don’t use PPTP. Point-to-point tunneling protocol is a common protocol because it’s been implemented in Windows in various forms since Windows 95. PPTP has many known security issues..." taken from this article.
The going recomendation is to use OpenVPN. Now if you go to their site they ofter already built software at a price. I assume this is not what you are looking for in the end.
What you can do is leverage the OpenVPN libraries and build it out yourself. Since it is opensource you can use the libraries for your benefit but you have to do the implementation work. What I have found for you is the GitHub repository where OpenVPN is leveraged in Android.
Source
I would certainly take a look here. It is probably a useful example that you can build from. This way you can come back and ask code specific questions if you are hitting a wall.
Lastly, VPN's are a two way street. Having it on the Android( client ) side still requires a server side implementation. So I would also think this article would be a beneficial part of the learning process.
I hope this helps.
Related
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
Greets!
I am developing (trying to develop) a VoIP SIP application for Android, and after two weeks of bickering with mjsip, pjsip and the sdk's libraries, I have settled on JAIN-SIP. The libraries look great, in theory. No need to learn any android native code, lots of documentation (yet not enough, since I'm here), etc.
My first attempt was using the Android SDK's SIP libs (yes, I know they're based on JSIP), and it failed after the SipManager.open() refused to open the profile for communication with the server, with no exceptions or any sort of output to help me diagnose the issue. (If you have a potential solution please look here) After dicking around with mjsip and pjsip I decided that, being on a schedule, it would take too much time to figure out the native code, so JAIN seemed like the perfect solution... or is it?
Problem is- the JAIN SIP libraries use the same name, in the packaging, as java's core libraries, therefore causing a dex issue with dalvik. But ok- theres an "ant make all-android" solution to build the sip stack source into a single .jar prepared for android. WRONG. Only the "gov.nist" packages get refactored, leaving the "javax" packages as they were before, causing the same dalvik dex problems. But wait!- theres JarJar, a tool that repackages your jar and refactors the packages, resolving the dex conflict. WRONG. Repackaging using JarJar also renames the references to the actual javax.net packages that the stack requires for encryption and whatnot, causing exceptions and crashes and all sorts of issues. So I spent the majority of yesterday refactoring the javax libraries by hand, which led to
...Caused by: java.lang.Error: Unresolved compilation problem:
So here are my questions...
Has anyone come across any android-ready jain-sip libraries that really work out of the box, without the need to rename,repackage, and refactor?
Maybe my JarJar rules are wrong? Can someone provide me with rules to rename all the packages and references to "javax.sip" and "javax.sdp", but NOT "javax.net"?
Are there any other SIP libs for android (that dont require any knowledge of the NDK or native code)?
Why is this still such a pain in the back in 2014?
P.S. Before pointing me to a google page or other stackoverflow questions, consider that I've been stuck on this for two weeks now, doing nothing else but trying to solve the issue- I can assure you, the internet has been thoroughly searched and the solutions either don't apply or don't work.
Edit May 2016 - The accepted answer is now out of date, refer to thejoelpatrol's response below for the newer solution. HERE
You can find Android specific JAIN SIP packages renamed to com.telestax here https://mobicents.ci.cloudbees.com/job/jain-sip/ (android-jain-sip-ri jar) that we have built at TeleStax to overcome the native JAIN SIP Android issues.
We are working on creating a Mobile SDKs that integrate WebRTC media as well so it's easier to implement messaging and video calls in native Android Apps
We will create a blog post in the coming days on how to set things up. I'll update the thread here once this is done
The accepted answer is out of date. The official builds now include a version suitable for Android, linked from the homepage: https://jsip.java.net/
I'm using them now and can confirm that they work fine.
There are a few extra gotchas but it's not hard to make your own build. It's really just 3-4 Eclipse commands away. Since there is so much demand I will make a proper script to do it, but I will aim for end of the month unless it's super urgent.
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.
I am a complete Android and C in general noob,
I have done a lot of web programming (which I am imagining is largely irrelevant here), some javascript (not jQuery just raw JS), I have also developed a .net app and done a course in java programming at uni last semester,
I know that Android uses Java in some places and C in others, I have looked at the SDK documentation here: http://developer.android.com/guide/topics/appwidgets/index.html
My aim is to build a simple dashboard widget that pulls data on a minute-by-minute basis from a JSON/JSONP API, I have thus far struggled to find any decent tutorials for real Android noobs such as myself, especially in the app widget category, If anyone knows of any good resources (online or books are fine) consisting of basic good practises, start-up guides and quick tutorials to get me up to speed would be great as I have absolutely no idea where to start (especially in the C end of things), I have found the SDK documentation does have some good stuff but it isn't exactly what I am after (built on very old builds of Android and thus most of the cool new features aren't integrated or taken into account).
Any recommendations would be very much appreciated!
On a side note, If all goes well with Android I would also be looking to move onto iOS so Objective-C start-up and tutorials would be great (Visual Quick Pro guide style would be perfect!)
I personally started reading and understanding the Android Application Fundamentals. Then I downloaded the Android ADT (Development Toolkit), configured it on Eclipse as well as the SDK (including samples).
Once that's set up, I started with the ApiDemos. You find its source code directly in the downloaded SDK <sdk-install-location>/samples/android-9/ApiDemos. Try to debug the code in the IDE, modify it and see how it reacts.
Finally, have fun :)
Well, I started with the Android developer documentation:
http://developer.android.com/guide/index.html
If that isn't as organized as you'd like for a complete beginner, you might want to try the FAQ since they have a lot of good tutorial links there, which happen to be very thorough:
http://developer.android.com/resources/faq/index.html
Once you get the basics, which the tutorials will do for you, the first link to the developer guide will be where you'll spend most of your time. There are even links in the guide for getting started with your IDE of choice, or getting started using no IDE at all.
To get a more specific answer, you'll have to ask a more specific question.
If anybody knows about 'voice to text' conversion using java, please give me some knowledge.
Thanks!
as far as i know, the way to use this is the JSR 113 Java Speech API 2.0
The advantage in using would be the offline functionality without an internet connection.
But unfortunately the leading company seems to terminated their intentions for this project, the homepage is down (http://www.conversay.com).
Looking at answers to a similar question, the prospects don't look encouraging. However I did find something despite the relative dearth of activity around JSAPI implementations.
Take a look at the Java Wrapper for Cepstral TTS project on Sourceforge. It relies upon the Cepstral TTS engine which is available for several languages and speakers as well versions targeting desktop, mobile and telephony server deployments.
Disclosure: I have no relationship to Cepstral nor have I used their products.
For speech recognition, see also this thread. If not using android, you might want to check out CMUSphinx.