I am Deciding to create an android app using java in android studio to connect, send and receive data using ESP32 with all the available connection methods that is Bluetooth classic, Bluetooth low energy and wifi . Can anyone share any resources or Source codes?
did try some android apps but either not working or slow
Please take a look at the official Android Development Guide. You will find many topics covered, especially interesting for you will be
the guide to Bluetooth Classic
the guide to Bluetooth Low Energy
the guide to Wi-Fi
The guides offer you a good start on these topics. There are many more independent guides online, sometimes even providing a sample app
Related
I have been searching the net for some sort of explantation on how I would get started on coding this but I haven't found anything. I know about ports and streams and basic networking stuff in java but I just can't seem to find any resources describing how this can be translating to android. I looked through the android api (https://developer.android.com/training/connect-devices-wirelessly/) but I actually don't understand any of what is written on there.
Back to the question though. The app would simply do this basic function:
two or more people connected to the same network open the app
when opened , the app automatically scans for all the phones connected to the same network that have this app open
the app would then display the name of each phone with that app open connected to the same network on the screen(in activity main) as a simple array (the name of the phone would just be the bluetooth name a guess)
This might be too complex of a question to answer so If there are any resources such as videos, api, etc. , that describe this process that would be great
NsdManager will fulfill all your requirement. You have to first register the service on the network through NsdManager using IP and port. Then Discover and resolve that service from another end.
https://developer.android.com/reference/android/net/nsd/NsdManager
https://android.googlesource.com/platform/development/+/master/samples/training/NsdChat/src/com/example/android/nsdchat/NsdHelper.java
Good evening,
i am trying to build an app that connects with an arduino uno with BLE. It is not the center of my project and i had to learn Android programming in a short amount of time. That is why i am mainly using the BluetoothLeGatt app as a reference. My question may seem obvious for some of you.
I've managed to connect to my device but i do not understand how to read/receive notifications.
I understand the link between the functions used : boradcastUpdate, onCharacteristicChanged, onCharacteristicRead... but do not understand how the process starts(e.g how to launch these functions). Am i supposed to call an action myself ? Is there a problem with my emiter ?
I find the documentation of Android unclear and have spent a few hours searching for solutions before coming here.
Thank you for your answers
The documentation about Bluetooth GATT is quite clear about how to setup a basic project and its basic elements. You shouldn't have any problems to read/write on any characteristics your Arduino announce just by adapting a sample project like this.
Basically all you need is work with BluetoothGatt class getting a specific BluetoothGattCharacteristic of a service, and write into it like this after you've done the scanning and connecting process to your Arduino BLE peripheral.
I am a highschool student working on a quadcopter project. I am using an android phone instead of a traditional microcontroller because of the phone's speed and other features. The main point of using android phone is for video transmission. I have knowledge in a wide range of programming languages but not so much with networking.
How do I transmit video data from the camera of one phone to another over the network?
If you can direct me on what classes or functions I need to look up on specifically it would also be a great help.
Since I am not that proficient in networking terms and ways it would be helpful, if you would assume that I have minimal knowledge on data transferring over network but I have been using java for years.
Some working example here:
http://code.google.com/p/spydroid-ipcamera/
An then, create a RSTP Client:
http://developer.android.com/guide/appendix/media-formats.html
The following network protocols are supported for audio and video
playback:
RTSP (RTP, SDP)
I am working on one android app. I want to connect my local PC to ANDROID device using Wi-Fi(Local).
just like this APP.
I am new to network programming.
Anyone help me to do this some architecture or example or code.
You could use the Server-Client architecture. Depending on what you want to do you could either set up a server in the phone and have a client on the computer that will connect to the phone. Or the other way around, server on the computer and let the phone connect to it.
Here is another thread that have some example code (there is a lot of other examples and tutorials):
Android - Server Socket
There's no way around this except by hard work. You are expected to read the documentation and work through the examples. There are heaps of tutorials on Programming on Android on the 'Net. Use them.
http://developer.android.com/resources/samples/BluetoothChat/index.html
As you know, the emulator does not have bluetooth support. My question is: is there any workaround to test the bluetooth chat from the sample?
The documentation states there is no Bluetooth support for the emulator. And you really should just test with devices if you have access to them.
I have never tried this, but I have read over before just finding a spare device. So if you are really stuck with just the emulator you can give this a shot. It's not a guarantee but it's something to look into.
https://github.com/cheng81/Android-Bluetooth-Simulator
Last I checked it supports:
switch on/off the "radio"
discovery devices (only other android emulators)
creating bluetooth services
connecting to bluetooth
services
You probably have to test/debug with real devices - IMHO there's no way to get bluetooth working on the emulator, not even a workaround