I am developing an android app in which i want to send (name,email, cell # , address, company, name , picture) from one android phone to another . The problem is that how to send this data + picture . Please provide me some code .
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
see this link Bluetooth sharing , it shows how to share files between devices
I assume that you have experience of developing Bluetooth application in Android. Android Bluetooth API is not supporting OBEX directly, means I can not push any file directly to any device. Android Bluetooth API provide basic functionalities like discovery, connection and data transfer using streams (InputStream and OutputStream).
Transferring file using Bluetooth need lot of coding. We need to manage device discovery, connection, IO etc.
Now I found very simple way to send file using Bluetooth. Android has build-in Bluetooth application which allow us to send file across the devices. Build-in Bluetooth Application use SharedPerference to manage queue for Incoming and Outgoing files.
I find the way to use same technique. Android Bluetooth application use ContentProvider to manage communication between storage and user interface. so I found the way that we can use it’s functionality
Here is the code, Following 6 line allow you to send file using bluetooth, you required only two things 1. URI of file which you want to send 2. DeviceAddress.
Description of above code.
Note: Above code is useful only if we can have URI of file which we want to send. It is perfectly work for Images because we can get URI of images available in Gallery but If we want to send file from SDCard then it difficult because we can not get URI of file available in SDCard.