Pausing/resuming an upload request using Webdav on Android - java

I'm planing to build a Webdav client for Android and I'm not sure what's the best library to use. Basically I would like to allow the user to pause and resume an upload request to a Webdav server. Is there any way to do that?
I' ve looked around and apparently I've got the choice between these libraries:
Sardine
JackRabbit
Jakarta slide
Sardine looks like the most stable solution for now. I've seen nothing about pausing and resuming a request though.

I'm the original author of Sardine. I created it because Slide and Jackrabbit were too difficult to use and not well supported. The intention of Sardine was always to be run on servers, not mobile devices. Also, the design has always been around making a request and getting a response. Nothing about pausing. I have also heard that there may be issues getting it working on Android (dependencies).
That said, I hate to say it, but I think you are pretty much on your own. If you'd like to join the Sardine project to contribute patches to it to make it compatible with Android and support features like pausing, I'd love to have you (assuming you write good code. hehe).

As far as i remember sardine is not fully compatible with android (some missing dependencies)
About your question, i don't think is pause/resume is a part of parsing lib (which sardine i basically is). This behavior is related more with HttpClient.
However i think this is even too low abstraction level for it.
The best solution would be to implement such mechanism by hand. It's not pretty, and is connected with AIO sockets

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

Implementing PPTP/L2TP Protocols on Android +14

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.

LibGDX - Connecting cross-platform clients to a server (HTML5/GWT, iOS, Android and Desktop)

Over the weekend I set up all the networking for a game I was making. I was basing it off this tutorial: GamesFromScratch.com Basic LibGDX Networking. It said that it only supported TCP but I was okay with that since I could figure something out and there was a bunch of material online on how to make real time games without UDP. After I finished, I tested it on desktop, android and then on HTML5/GWT. Desktop and android worked but GWT didn't. I did some research and found that Gdx.net does not support GWT, the article didn't warn me :/ Basically now I am trying to find an alternative solution that will work with ALL libgdx platforms.
I looked into Websockets with Socket IO. Here are the Java libraries I found for the: Client and Server. The server library says it works well with the client one which is reassuring. It seems like a good solution but I have a few questions:
- Would the client library work on all platforms? It seems that it would work on android and desktop since they don't have to convert to another language but what about GWT and iOS? And not only just work, but also be able to connect to the server using the server library.
- Is there anything I need to watch out for when using websockets?
Thanks.
EDIT: I did a little bit more research and I found Jetty. I looked around and it seems to be GWT compatible, I just need to know if it is also iOS compatible. And could I use Jetty as my server api also?
I did it. I did a lot of research in the past few days and I finally found this post on stackoverflow.com that told me about 2 great libraries including one I could use with the client that supports GWT.
It works great, the only thing is that I will have to use 2 WebSocket libraries for the client, one on html and another for all the other platforms but that's okay, at least it works.
The libraries are: Client and Server.
you can use Kryonet which provide network for PC, Android and iOS(not tested). On this library you can build server side or client side app.
In GWT you have WebSocket and you must use other library to connect with server.
When you start game, you can inject right implementation client for GWT can be example: gwt-websockets and kryonet for other platform.
Next, you must change kryonet default serialization implementation by own, supporting json. In my project i use LibGDX json serialization.
Currently, i don`t have support for gwt but i will work on it in near feature.
Jetty in my opinion is too heavy for client and isn`t simple so much. But witch Spring, you can easy create server service based on REST or http communication.

Silverlight / Java Applet equivalent?

My society was hit in the face with the NPAPI deprecation in the google browser.
We were using Silverlight for a long time and we are curently looking for any replacement solution.
What was good about applets and silverlight was the easiness for the applications to access the file system and get the rights to automatically save anything into the computer.
Beside it was compatible with the major OS and almost all Browsers, which was a great thing for our customers.
But chrome decided that NPAPI causes too much security problem, and they will remove it by september.
I'm looking for a simple way to provide access, at least to the file system of the customer.
asp.NET gives us anything we need, on the server side, but it can't do a thing on the client side. With silverlight we were able to use the clipboard,save multiples files on specific directory, send mails from the client etc.
I thought about making our own plugin on several OS, but that would be a lot of work. So i was wondering if there were a simple compatible solution that already exists.
You could build a FireBreath2 plugin to provide this functionality -- FireBreath2 will work on chrome w/ native messaging, and the functionality you describe shouldn't be too hard to do cross-platform. Keep in mind that you've got some serious security risks to protect against, though.
FireBreath2 as of this writing isn't quite production ready, but it's pretty close. ActiveX support isn't complete yet, but it shouldn't take that much work to finish it. It would require a good understanding of C++ and a willingness to help with the project since it's not 100% ready for prime time yet.

Options for Client Server Communication in Android

I'm currently in the research phase of my dissertation project.
My project is a ticket booking system for a mobile device and I have chosen to target Android.
I anticipate the need for a client/server architecture with a central server, and so am currently looking at how Android could communicate with such a server. The server would grant the client access to ticketing information, and the client would send information about ticket bookings to the server. I'm looking at Java EE for the server as Java is the language I'm most experienced with.
I'm aware that Android comes with java.nio and java.net, as well as some org.apache packages, but am also looking for libraries/technologies that would be possible to use with Android.
So far I've not found anything massively helpful on the internet, so I'm seeing what SO can suggest.
Specifically I am interested in knowing:
What support is there for various middleware technologies in Android? e.g.
RPC based middleware
CORBA
Message based middleware
Web services such as XML-RPC, SOAP, REST
How well (or not) do existing Java libraries work when used on the Android platform? (e.g. If I wanted to use a library/API designed for Java SE rather than Android what problems might I encounter?)
Ideally, as the focus of my project isn't meant to be the communication between the server and client, I could use an existing middleware to handle the communication, but I am prepared for the worst case, which is having to write my own.
What support is there for various
middleware technologies in Android?
My personal opinion -- though I do not feel I am alone in thinking this way -- is that only protocols specifically designed to run over the Internet are remotely suitable for use with a mobile client. So, of your list, the only one that I would even entertain would be:
Web services such as XML-RPC, SOAP, REST
Some people have been maintaining an Android port of kSOAP2. However, I get the distinct impression that most Android developers working in this area have tended towards REST and REST-ish protocols. If nothing else, that's what all the fun Web sites and services are using for an API, particularly compared with XML-RPC (old) and SOAP (old and icky).
I have successfully used both the java.net.URLConnection and Apache HTTPClient libraries in Android for communicating with REST-style endpoints -- both directly and through third-party JARs -- with no real Android-specific issues.
How well (or not) do existing Java
libraries work when used on the
Android platform?
It is difficult to answer that in the abstract. Android implements a substantial subset of JavaSE, but not all of JavaSE, so there's a chance that any given JAR will expect something Android does not offer. Similarly, Android does not use environment variables, command-line switches, or a variety of other things that developers focused on the desktop might have introduced as semi-requirements. So, some things have worked for me with nothing more than a recompile (Beanshell), and some things have worked for me after removing redundant classs (JTwitter), and some things looked like they were going to be ghastly to get working (JavaMail).

Categories