I have just starded to work with Android and I have to create an app that takes a picture and then sends it to a pc via bluetooth.
The problem is when I have to send the image, because I can't find a simply code to do this.
I can have everytime the uri of the picture I took before, so i need a code that searches for the active devices near mine and then sends the picture to the one of them I choose.
Please help me!
Thank you
For discovering nearby bluetooth devices, you can refer following links which will help you to understand it better:
http://developer.android.com/guide/topics/connectivity/bluetooth.html#FindingDevices
http://developer.android.com/guide/topics/connectivity/bluetooth.html#DiscoveringDevices
And if you want to Enable device bluetooth without asking the user. You can use this in your manifest file.
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
You need to understand BluetoothServerSocket Programming in android.
http://www.programcreek.com/java-api-examples/index.php?api=android.bluetooth.BluetoothServerSocket
Follow this link ... Hope this will help you.
https://developer.android.com/guide/topics/connectivity/bluetooth-le.html
Follow this link to understand bluetooth in android.
Related
I need some help with an excruciating problem...
I have an app using DatagramSocket sending broadcast udp messages on my local network, and this work perfectly when I run it on mobiles android L (5.x) or lower.
The project has the follow permissions: internet, access_network_sate, access_wifi_state, change_wifi_state, change_wifi_multicast_satate, interact_across_users, and other permissions.
This bolded permissions was used on my app, during traffic of messages.
During the implementation TimerTasks, AsyncTasks and Threads was used to create the DatagramSocket properly, depending of the use, because I know this is necessary to send messages on network (it is necessary run network reader|writer out of main thread).
But the app not working properly when mobiles android M (6.x); anyone message is sending, and I don't have any ideia what the cause of this problem.
I'm try search about permissions on Android M, and I can see news on system permissions, but don't see anything about my specific case.
I will be very grateful if somebody can help me.
Hello everyone I've been trying to connect a GearS2 device with an Android phone using the accessory SDK, but every time the service is created and I start the connection the method "onFindPeerAgentResponse" is returning the peer as null and the result integer 1794 which is FINDPEER_SERVICE_NOT_FOUND.
I don't know if I'm doing something wrong in the config files, the manifest or the service profile.
Did you manage this? I would say to take a look at the Samsung example provided for a companion app # http://developer.samsung.com/gear check the "COMPANION TYPE : HELLO ACCESSORY" It helped me a lot.
Share some code if this example doesn't help find the problem.
Cheers,
Ricardo
I am working on a Help alert android application for which I need to detect the RF signal from my android application, I had googled but not find anything concrete, Please can anybody help in this case about the Receive RF signal in android.
Do provide more information of the data you are looking for or on the application your are making.
You can try referring to getGsmSignalStrength () ;
Additional information can be found at
[http://developer.android.com/reference/android/telephony/SignalStrength.html][1]
I'd like to share information between my own app running on 2 different phones via a bluetooth intent.
Lets say i have some data on phone a, then i will tap synch and it will start the same app at phone b (if it's not already open) with a bundle containing that "data".
My app on phone b acts acordingly.
Is that possible?
I am not really sure if this is what you're looking for.
Intent i = new Intent(Intent.ACTION_SEND); i.setType("image/jpeg");
i.putExtra(Intent.EXTRA_STREAM, Uri.parse(fileLocation));
startActivity(Intent.createChooser(i, "Send Image"));
This intent shows all available options for file send such as Email and Bluetooth. Choose Bluetooth and the device initiates bluetooth discovery.
Thanks!
From my understanding, it is not possible.
Use BluetoothSocket and BluetoothServerSocket instead
I recently saw this interesting video about NFC, and i know you are talking about bluetooth.
but watch this video http://www.youtube.com/watch?feature=player_detailpage&v=49L7z3rxz4Q#t=768s
Timestamp added, starts at: 12:48.
What they did is starting the app trough nfc but probably they send the data trough bluetooth. Its really user-friendly.
In this way you do not need to push the button sync but just bump eachother phones together!
I hope this helps you maybe further,
Daniel
I think you must make use of BluetoothServerSocket to accept incoming connections. Exchange data with server once connected. To get started check out this doc.
Start-up
You could find the source code in your SDK. Download samples from Android SDK manager. Select 'Samples for SDK' from the required SDK version.
Go to
<location of android-sdk>/samples/<version>/
Open 'Bluetooth Chat' application. It has almost everything you need.
Thanks!
By the way, don't forget to accept the answer!
I am developing an application that will make SIP calls using the SIP APIs. I want to use the SipDemo code as my starting point, but when I run SipDemo on my devices (Nexus or Galaxy Tab) I always get "Registration failed. Please check settings." I am using the same username/password/server information that works successfully in Sipdroid.
I inserted log messages in setRegistrationListener to follow what's happening, and I will see onRegistrationDone fire, but then it seems to register again, because it will then see Registration failed with the error message "registration timed out" followed by registration failed with the error message "cannot initiate a new transaction to execute".
I've been beating my head about this for a few days, and I've got a deadline rapidly approaching. Any help on this issue would be greatly appreciated, or if you could point me to some other examples/tutorials of how to use the SIP APIs.
I fixed it! The demo wants to use UDP by default, but I was able to make it connect by hardcoding the protocol to TCP. I have a netgear modem from charter cable, and I have seen several reports of it blocking access. I assume the two are related, but for now I'm just happy to have it work so I can continue my development.
Thanks for the help!
Check the logcat, it should have more information about what failed. Also if you have control over the server, check the server logs as well.
Seems like you are not alone http://code.google.com/p/sipdroid/issues/detail?id=60.
I would suggest that you try what people tried there: i.e.
Try another router.
Change port in code. Read the link for more details.