Bluetooth LE send string data between Android devices via application - java

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.

Related

Android Mobile/Device as a BLE GATT Peripheral & Central Simultaneously

I want to make two Android apps using BLE & GATT Protocol. Implementation like that role of the first app is GATT Client and the role of the second app is GATT Server ( or how to make the mobile phone a GATT Peripheral?) using Kotlin/Java. Both the apps will execute on a same mobile device and when I send an advertisement from one app the second app will receive this broadcast.
Is there any tutorial or article link other than the android official document where it is clearly explained? Or how should i implement this?
You can implement GATT client and GATT server concurrently. In most cases you don't need to know that the same app or another app runs the other role as well, so just develop like you usually would have done if you only implemented one role. Just keep in mind that a GATT client cannot communicate with a GATT server on the same device; it must be another physical device.

What is the difference between services and profiles in a BLE GATT server

I'm new to Bluetooth classic and Bluetooth Low Energy. After I watch the tutorial video on the dev site of android. I still don't understand what is a service in ble and what is the difference between service and profile. Can anyone helpe me?
Thanks.
Profile define all communication functions to a BLE device, you can assume it is a higher level of abstraction, it has one or more service, which expose the sensor data on a GATT server. e.g Heart rate, temperature or Cycle speed. In simple Profile has Services, and Service has Characteristics, Characteristic descriptor.

Android Push Notification from device to other devices

I have been trying to learn android programming following Ravi Tamada's tutorials - AndroidHive for weeks now.
I created an app that performs Create, Read, Update and Delete actions (CRUD). Similar to this .
Now, what I want in my app is to have another feature that whenever there is a new data created and/or updated in the database, the app sends notification to other android phones that have the same app.
I've researched and come across Google Cloud Messaging, which AndroidHive also have a tutorial for. The way I see it is that it is only the server that can send notification to devices and GCM cannot do: "Device to another Device" For instance, "Device creates data -> send to database -> GCM sends notifs to other devices". Correct me if I'm wrong.
So I've searched again and found that you can use Smack for Instant Messaging app. Similar to something that I want my app to accomplish. But I'm having trouble understanding and implementing Smack to Java and Android.
So what I want to know is:
1.) Is it possible for GCM to listen to a device to check if the app has change the database and sends a notification to other devices that there is a change in the database?
2.) Do you have any "noob-friendly" article links on how to have a basic understanding and implementation of Smack in Java-Android?
Thank you.
Check out the official tutorial on the Android developers site:
http://developer.android.com/google/gcm/notifications.html#upstream
You can just upstream a message to the Google cloud and it will be sent to other devices in the same notification group.
I'd suggest that you always start with the official tutorials first and then move on to third-party blogs, it's just easier that way.

how to create live audio streaming between two android mobiles using socket programming..?

I am trying to develop an android app that will allow audio streaming between two android mobiles kind of audio conferencing by using socket programming.
what should i use for audio data transfer? i am using api 10
if you want to link inside a LAN then there is hope; however, if you want to connect through the internet then forget about it, NATs and CGNs and the likes won't let you (well, unless you'll provide a third-party relay server for your app).

Java library to make recorded phone call

Scenario: GSM SIM card is connected to PC using a USB port. I have a audio file. I have a list of mobile numbers to call.
Question: I'm looking for JAVA library which detects the GSM SIM card, and allow my application to make a recorded phone call to this list of mobile numbers.
Extra Information: This is NOT A J2ME application. I studied some of resources from net. I found this http://smslib.org/ & http://www.voicent.com/devnet/docs/javaapi.htm which does not completely solve my problem. Former can only send SMS, latter uses a gateway which actually makes a call & application's responsibility is to connect to the gateway with necessary details.
There is an API called KooKoo and they have developed telephony API for automation. You can find details on Outbound calls here.
You require to send recipient's number and the audio file over the API to play it to the recipient. You need to explore more on the API to understand its capabilities and fulfil your requirements.

Categories

Resources