send data from 2 bluetooth to android device - java

I need to send simple data-an integer- from two bluetooth devices to an android device. I know that the Bluetooth Chat is the base upon it, but it refers to connection of only one bluetooth device. Does anyne has managed to change it or has any hint to give me??
Any help would be very appreciated!

Related

Android Send files via Bluetooth programmatically

I have a java android app that list all nearby Bluetooth active devices, and the user can pair with a device.
I want to make the user when is paired with another device to send files or images via Bluetooth.
How can I achieve that in android (java)?
If you're doing this over classic Bluetooth, have a look at the following links:-
Bluetooth file transfer for Android
Android Bluetooth file sending
How can I send a file through bluetooth with Android devices
Android: Send image via Bluetooth
If you're doing this via Bluetooth Low Energy, have a look at the following links:-
The ultimate guide to Android BLE development
Bluetooth LE send string data between two devices
Transfer image through BLE in Android

Bluetooth LE send string data between Android devices via application

I'm completely clueless on how to use BLE. I need to create an application for Android devices that sends a small string from one Android device to the other. I am NOT using any sensor type devices. I only need to send a string from one phone to another phone using a BLE connection. From what I understand, I need to create a custom service and implement a GATT server on a central device and have a peripheral device access it as a client but I'm not even sure if that's what I need for my situation. I have scoured the internet and nothing I have found deals with this topic specifically. I have no idea how to create a GATT server for this purpose and what I need to include in order to create a service. Can someone please explain to me what I need to do or point me towards some resources that are useful for A COMPLETE NOVICE? Thanks.
You are right so far. You need to create two applications on two different Android devices as follows:-
Android App A on Device #1: An app to act as a GATT Server to host your data that you want to send. For that, you will need GATT Server API.
Android App B on Device #2: An app to act as a GATT Client to connect to Device #1 and read the string data from the GATT Server using GATT Client API.
BLE is a relatively complex technology but luckily there are so many resources to help you get started. I recommend that you first understand how BLE technology works and for that I the following links are useful:-
Introduction to BLE Video Series
The Basics of Bluetooth Low Energy
Introduction to BLE GATT
Getting Started with Bluetooth Low Energy
Getting Started with BLE GATT
Once you have a better understanding of the protocol, the following links are useful for understanding Android BLE development (in addition to the video posted in the comment):-
The Ultimate Guide to Android Bluetooth Low Energy
Getting Started with Bluetooth Low Energy in Android
How to use Android BLE to Communicate between Devices (With Examples)
However, before going through any of these, it's always a good idea to get a feel and practical understanding of how the technology works. For that I recommend using the nRF Connect Android app to connect and read data off devices. This way, you'll be able to relate to the new information and hopefully understand the new concepts easier.

How to send a notification from an android app to another android device using phone number?

I am developing an android application and i need to send a notification from the app to a phone number (another device).
Can anyone tell me how can i implement this? any methods or API i can use?
Thank you in advance
I don't think you can do it without developing server-side software that Android devices will connect to. In your server-side software you can use FCM(Firebase Cloud Messaging) or any other framework/library to send notifications to one or group of devices.
Problem is that you need to have connection to the other device and you can't know if that device is connected to internet and even if it is you don't know the address of that device. 99.99% that you need server-side software.
the easiest way (but the most expensive i guess) is to have the first device send a request to a server (whose backend you have to build, eg. php) that will send a push notification to the second device via Google Cloud messaging service.
that's not so easy because the second device to receive the notification must register at GCM and the first device must identificate the id of this device (the common way is to have a common id like username)
There is on possibility without using server side code, Send SMS to the second Phone and read the SMS in second phone and display your notification in second phone. It will cost the SMS charges in both phones.
Create an API that communicates with the users of the application this will be able to send updates to the registered users at real-time.
http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/

How can I use serial communication (port) via Android Bluetooth to send data?

How can I use serial communication (port) via Bluetooth to send data?
I need to send serial data through an Android device to a Bluetooth model (BlueSMiRF Silver) (that is connected to an Arduino board).
I was literally sitting for three day trying to understand how to do that...
Would be nice to have more details about what you tried and where you are stuck.
On the Android side the first step is to pair with the BlueSMiRF module. You should be able to discover the BlueSMiRF and pair from the "Bluetooth Settings" on android. You might have to put the BlueSMiRF module in discoverable mode (and you can set the a pin code for it).
Once paired, to be able to send and receive data you need to connect using a Bluetooth socket. To communicate with the BlueSMiRF module you need to use the Serial Port Profile (SPP) and create and RFCOMM socket. For an example you can have a look at this post.

Sending SMS(s) through my company's software to ANDROID phone

Can anyone point me the right direction as to how write a program that contacts and sends a SMS to the ANDROID phone?(ONLY asking for resources to help my coding)
Program Requirements:
1.When the SMS sending function is selected in my company's software,program will contact the ANDROID phone(connected through the USB) and the ANDROID will send the message to the target.
2.Program should also be able to delete the SMS from the sent messages or outbox folder in the ANDROID phone so that no trace of it is left behind.
I do not intend to have a GSM Modem ,only the ANDROID phone is connected through a USB for SMS sending.
If anyone can offer any words of advice,it'd be great.If not,please do not waste your time.All help is appreciated.
Here is a great resource to help you get started with Android Development and the Android SDK.

Categories

Resources