Faking bluetooth connection with Android Studio? - android

In an university project we are working with an MSP430 that sends data to a smartphone via bluetooth. For developing and testing purposes another part of the team build a program which allows to send bluetooth data from an visual studio project. We are not emulating the project but instead are running it on an attached phone. Cause it is always a little annoying to connect with bluetooth and to start and stop sending data, my professor was wondering,
if there is a way to make Android Studio fake that there is a connection and to send the data via Android Studio instead.
Or is there another way, that you would suggest for such testing purposes? I'd be thankful for any answer.
Cheers
Ginbak

Related

Which one do I have to use if I want to make bluetooth connection between Android app and Arduino nano 33 IOT? (BLE or Classic)

I am trying to make a android app which can make connection with Arduino nano 33 IOT device.
I realized that Arduino nano 33 IOT has BLE module on it, so I used <ArduinoBLE.h> to advertise the device.
When I was making android app which can make connection with Arduino nano 33 IOT, I tried two different ways. first one is use classic bluetooth(BluetoothAdapter), and the second is use BLE bluetooth(BluetoothLeScanner).
But it is a little confusing which one I have to use. If I use classic, the App can search device but connect. If I use BLE, the App cannot even Search devices.
I asked a question on stackoverflow one week ago, and a kind person answered me that I have to use BLE.
So I tried it, but it is still not working...
is it ok to use classic version to make connection with BLE? or not?
You can use either BLE or classic Bluetooth on the Arduino nano 33, however, my recommendation is to use BLE as well. This is because you'll find more resources online on how to develop and use BLE, and also your application will end up using less power (hence the name BLE).
I would start with the Arduino BLE page itself which you can find here:-
https://docs.arduino.cc/tutorials/nano-33-ble-sense/ble-device-to-device
The copy the peripheral example which you can find on the page above. After that, as a sanity check, I would use the nRF Connect app on Android or iOS to make sure that the peripheral example is working as ukBaZ suggested. If everything is working by then, then you're good to start developing the Android app.
The Android app isn't going to be straight-forward but luckily there are a lot of resources that can help you get started, including the following:-
The ultimate guide to Android BLE
BLE programming on Android tutourial
Making Android BLE work
After that you should hopefully be able to connect and talk to your Arduino nano from an Android app. Remember that your Android app has to be the central that connects and reads the data, while your Arduino nano has to be the peripheral that advertises and hosts the data.

Android App code for BLE UART communication

I am working with a peripheral device that communicates with an app via BLE UART.
To test and modify the peripheral’s firmware, I want to find a starter Android app that can communicate with the peripheral. I want to be able to modify the app along the way as I modify the peripheral firmware.
I got the Nordic nRF Toolbox app working in Android Studio and running on my tablet. However, when I look through this project it is far too difficult for me to understand right now. I have worked through several tutorials that offer a far simpler solution, however not a single one of them has ever fully compiled correctly at the end – I assume they are all out of date. So it has been a difficult journey so far.
I need the app to be able to scan for devices, and allow the user to connect to one – and then be able to communicate with the BLE peripheral via UART.
Can anyone point me to (a) a starter app with code on GitHub or similar, that they have tried recently, or (b) a tutorial / walk-through, that they have successfully completed recently?
Thanks in advance for any suggestions
Garrett

iothub-service-client support for android app

I have made a simple program on Raspberry Pi 3 with Python using Direct method on iothub and able to on/off LED using device explorer and getting response.
Now I want to make an Android app where I can on/off devices and get back a response, but I found out that there is still no support for iothub service client on Android,
Now I want recommendation for a better approach how to access Raspberry Pi with my Android app.
Have you considered using Xamarin? Our .NET SDK has support for Xamarin. Android support is currently in development, please check back for release update.

Analog Input from Arduino to Android Studio

I am coding an application in Android Studio that uses analog inputs from an arduino. I am trying to send analog input from an Arduino Pro mini to an Android App. However, I cannot connect straight to the phone (USB port isn't available). The method I've thought of is to connect both the phone and Arduino to PC and read the Analog input using Android Studio and Use my phone to run the application instead of an emulator. Would this work in real time.
Is it possible to have the Android Studio run the app and the app still reads information from the Arduino real time? The application reacts to analog inputs from the Arduino. So I need to find a way to access the arduino in android studio and run the app through android studio in place of its emulator
I can't find any sources so if anyone has a clue please help me. Thank You!
You should post this to the Arduino StackExchange forum: http://arduino.stackexchange.com.
A couple things:
Android Studio is just for developing Android apps, it's not going to help you read data from the Arduino. You would need to write a separate app for the PC that would moderate between the Android and Arduino. Not fun.
When you say "USB port isn't available" I assume you mean the host port. Actually, many newer Android devices are able to be a USB host, so you would just need the right dongle to be able to connect the two. Then you would use the classes in package android.hardware.usb like UsbManager to connect to the Arduino.
Another thing you might think about is getting a BlueTooth shield for your Arduino and connecting to the Android with BlueTooth.
Hey! Wanna be a real Evil Genius(TM)? Write some code to flash the LED on the Arduino like Morse Code or Navy signaling, then write some Android code to read the video from the camera and turn the LED flashes back into data! Impress your friends! Put it on your resume!
Just some random ideas to get you going. I think the folks on the Arduino StackExchange forum can be more help.

Android app connect with Windows app on my desktop

I am trying to develop a Windows Desktop app similar to Task Manager which can monitor my PC with Visual Studio Express. Now I want to develop one app for my Android phone with which I can connect to this Windows App from anywhere and see some of the graphs and little info (light weight) on my phone in a secure way.
What tools do I need on my desktop and Android phone to develop the app. How can I develop and connect it? If you can help me it will be great.
Thanks.
Probably the easier way for you to do this is to create a server application which both your apps connect to which will need to be on the internet or on a network where both have access to it. The desktop app would be sending its' information and the phone application would be requesting that information. As for what the server needs to be, that is agnostic, however using REST or Websockets (More ideal but a bit harder to work with) for communication would probably be ideal.
To get started I would suggest looking up a tutorial where you do API requests to a server (On either Android or Windows Store Apps). Then look at building your own server application to distribute your own API.
I hope this helps.

Categories

Resources