I want to develop an App which is just like snap chat,to send video files to friend.Is there any third party API to do this.What are the possible ways?
One way is using Sockets. You could basicly send information how many bytes the file has and then transfer it to other Socket where you will read it. You should take a look at this question.
Edit:
In this solution you don't need any third party, it is java api.
You can use sockets but you can also use the PubNut API if you want focus in your app and leave the networking to a third party.
I hope this help you.
Socket is good for transferring files, but i think you cannot transfer large files. And your application will allow lots of unwanted/unauthorized video being transferred between users.
You need to learn about XMPP protocol and Open Fire Server, which are widely used by applications like WhatsApp (not sure what they currently using).
This may help you i think...
Try: Here is the example link to transfer files usind asmack and openfire server http://harryjoy.me/2012/08/18/file-transfer-in-android-with-asmack-and-openfire/
Related
I have integrated socket.io into my android application to make a chat application. Now I wants to upload and share files like images, mp3 or doc file etc. How do I upload a file with socket.io I cannot find any documentation for doing.
It is not a good practice. This may lead blocking heartbeat messages between client and server if upload progress is long.
You may upload file with http post and send download link to chat peer. By doing this, a new connection is established for uploading and never breaks socket.io session.
I believe it should be a good practice to do in Android, as it works pretty well on web JS for small files such as Images, PDFs, etc.
But ya sending the whole file in a single shot is not a good practice(theoretically there should be no problem in doing that using socket.io), but it's better if you can the fragment the file into smaller pieces (maybe 2^10 to 2^20 bytes), and send it in pieces, doing so will also allow you to know the percentage of file's data transferred.
I am not good with JAVA, but I hope you can find a way to do that fragmentation thing.
But there is no inbuilt resource available in socket.io to transfer files, but you won't have any problem in sending pure Buffer(including '\0' in it) if you can manage to create a JSON object in JAVA without involving strings. As '\0' inside Strings messes them up.
On an Android device, I'm trying to list down mp3 file names (list view) , stream/buffer a mp3 file , download the mp3 file available in the cloud.
I was thinking about couple of approaches that I can follow to get this done
Host mp3 files on a server, & probably create a web service which gives me the above functionality and at the client side, I should be consuming the web service. ( Single server for both Web service & hosting mp3 files ).
Host Mp3 files on a server1, Deploy a web service on server2, this way I can easily structure and manage mp3 files.
What is the usual approach that app's like Google Play Music, Saavn ... follow ? If there is any other solutions I can look into, please suggest them.
It would depend on the amount of space your data will occupy, the bandwidth available on your server infrastructure, the kind of speed you need, how fault tolerant you want it to be, the budget you have etc and many more factors.
Generally, I'd suggest you use a single server to host your data and application logic in the beginning. If/when you start getting more users for your service, then you can start thinking about scaling up using a more distributed architecture (like maybe firing up a couple of instances of Amazon S3) etc.
Your client mobile app should be implemented in a way that it doesn't need to know what kind of backend architecture is supporting it so that you can easily change the architecture later without affecting the client side code. Look into RESTful web services for this.
I want to transfer images and files from Android SD Card to PC Server(FTTP Server) using wifi connection? kindly help me if you can......I will appreciate your time and help
here is an example on how to use a wifi connection, from here, you need to use commons ftp to transfer file.
there is an existing question similar to yours.
There are some free apps available that can be used for this. One is SwiFTP: https://market.android.com/details?id=org.swiftp&hl=en
Hope this helps! I couldn't determine from the question whether you'd like to code this kind of app yourself or simply use it to transfer the files.
I need a fast way to upload files to a ftp server.The files will be used for a primitive chat.Something like a timer and every 5 sec checks to see if the file x was added,if it was added open it and show it.
So please tell me an easy way to upload a file,because from google,I got only hundreds of lines of code.And yes,I need it for a FTP server.
Also it would be awesome to tell me a way to acces a file trough ftp open it and show it.(don't really need to download).
You should use the org.apache.commons.net.ftp.FTPClient library - it's free and implements fairly easily with Android. You can find a pretty easy how-to at the bottom of this blog post:
http://hoang17.com/posts/android/android-how-to-upload-a-file-via-ftp
That article should be especially helpful as it shows you how to store a string as data in a specific filename.
To be honest though - FTP seems like the absolute worst way to create any form of chat communication. :)
Cheers.
I want to write the application which will transfer file from android (nexus1) to some other server by using GPRS.which protocol should i use and how to implement that?
HTTP. It's the most reliable protocol on a mobile device. There are plenty of libraries (including built into Android) that will aid you in that, and I'm sure you can find some good tutorials on the net.