Setup simple bluetooth server console? - android

Hi i wanna work with some bluetooth communication using my Android device.
How can i test bluetooth connections easy?
Let say im creating a simple application that will send the message "Hello World" upon connection. I would like some sort of server application console i could fire up on my iMac and have my android application connect to.
The server application should just be a console or something that displays all the data it receives and maybe a input to back a response.
Is there anykind of program that allow this ?
Or do i really need 2x android devices to create a simple server / client interaction with bluetooth?

this Android Bluetooth Chat App will be good starting point .
you can make this connect to the mac over serial port profile.
The example above is for the latest Android versions (it is possible to accomplish this with 1.x versions of android also, you will have to use the appropriate api that are supported in older android versions also)
For Programming in the Mac refer to This

Related

How to test OBD-II device ( for car ) response on android and iOS?

Currently I am upgrading an android and iOS app that will show Car RPM, speed, turbo and other things using OBD-II device (bluetooth). Most of the code was written on an old app source code and I am using that code on a new screen.
The problem is that I don't have a device for testing (I have just used code from an old source code ). I have a text file that has the response returned by the device. How can I send that response to mobile app using any windows/mac software ?
I mean is there any software available that will allow to connect mobile app via bluetooth and then I can send response. eg RPM, SPEED etc ?
Here is a sample response that I want to send via bluetooth (PC) to mobile app.
,$OBD-RT=2,76,1193,-40,0,103,-26,75,15.29,12.0,48,29.41,0,581.3,14.7,0.00,3.70,0.000,0.855,0.000,0.000,0
,$OBD-RT=2,76,1181,-40,0,103,-26,75,18.82,12.0,48,38.43,0,581.3,14.7,0.00,3.67,0.000,0.855,0.000,0.000,0
,$OBD-RT=2,76,1183,-40,0,103,2,103,18.82,12.0,48,38.43,0,579.1,14.7,0.00,5.04,0.000,0.845,0.000,0.000,0
I have attached 1 screenshot of the app
So is any software available ( for OBD-II) that will allow the mobile app to connect via bluetooth so I can send the response to the app ?
There isn't such an emulator as far as I know and if there is, normally not so reliable. But there are some devices such as Freematics that can emulate the vehicle's OBD II. In such devices there is a lack of multiple response from emulated ECU. (which as I see in your app is necessary and you probably want to have 6 requests together).
If you're serious about developing an OBD2-app, you should acquire a hardware simulator, i.e. the DIAMEX OBD2 Simulator. It's the next best thing apart from using a real car.
1
I did run into an obd II simulator I found in the google app store which I installed on one of my development phones https://play.google.com/store/apps/details?id=com.beastovest.obd.simulator
On a second phone, I installed the Car Scanner from the store (free) https://play.google.com/store/apps/details?id=com.ovz.carscanner
The setup is pretty simple. Just pair the device from the simulator to the scanner.
In the simulator, I can change engine values and I can see the commands and the changes in the scanner. You can see the rest of the communication as well. The simulator is $5. Very nice for that price. I can also see the complete communication which I need for my app development. I also speed up the understanding of the ELM327 commands. Here is the spec: https://www.elmelectronics.com/wp-content/uploads/2017/01/ELM327DS.pdf
Hope that helps anybody.

Communicating between Android phone and Android TV

Does Android have any built-in communication APIs that lets a native Android app running on a phone communicate with a native Android app running on Android TV? The only solution I can think of is where the Android TV app creates a socket and the client app on the phone would connect to this socket.
EDIT:
I'm looking for a solution where no user interaction is required to setup the communication. Bluetooth requires the user to pair devices. NFC requires being very close to the device.
Yep, I implemented this by two ways, since P2P is disable on a lot of Android TVs, I kept socket and firebase solution, both works:
for socket purpose:
https://jayrambhia.com/blog/android-wireless-connection-1
For firebase, I did a page where the firebasetoken is display in a QRCode, the mobile app scan it, and we send a notification with the auth params to the Android TV App wich can connect to our back end.
Does Android have any built-in communication APIs that lets a native Android app running on a phone communicate with a native Android app running on Android TV?
You have the same options that you with any pair of Android devices:
Direct ordinary sockets, if the two devices happen to be on the same WiFi LAN segment or are otherwise directly reachable, and you are comfortable with the security ramifications of having an open socket connection
WiFi Direct (where available)
Bluetooth
Indirect communication through Internet-hosted facilities (e.g., FCM) or possibly some locally-reachable server that is not on the Internet (e.g., WebRTC)
NFC, though probably few Android TV devices have NFC support
About the only thing that I can think of that might be more unique for Android TV would be those that offer an infrared (IR) receiver, but I have no idea how much apps can tap into that, and few Android devices have an IR transmitter.
There is a guide from the android developer website
https://developer.android.com/training/connect-devices-wirelessly
Network service discovery (NSD)
P2P connections with Wi-Fi Direct

Send data/message from server to android (not using GCM / C2DM)

We have a system running on an Intranet. The android app is running on a PDA client. We facilitate communication using web services done in .NET.
My question, is there a way for the server to send a message to the android app to trigger an action in the PDA (kinda like receiving SMS) ?
Previously, we used sockets since the PDA was running on Windows Mobile (as mentioned we've switched now to using Android). I've read this can be done using Google Cloud Messaging, but the system cannot connect to the internet, hence, I need alternative.
We can go back to using sockets, but I'm worried the battery life would take a huge hit.
Thanks
you can use xmpp protocol to implement this.asmack is a library available for android .(smack is for java which has some issues with android). you can use this on intranet .

Exchange data between google-glass and a android device

The scenario:
I have a android app running my in cellphone. I´m the owner of this app.
I have a google-glass synced with this cellphone. I´m developing a my app for google-glass using the new GDK launch a few weeks ago.
I want to send a data from glass to cellphone and then receive a answer.
No internet connection is necessary, so i´m planning to use Bluetooth to this data communication.
I can create a Bluetooth socket connection, however this will obligate me to manage it.
There is no android high level abstraction that permit me to call a service or a activity directly on the cellphone?
AFAIK, there's no direct pipe between them, the glass is basically a phone with a different set of inputs and outputs. You can create and manage the connection, and it's yours.
AFAIK, there is no other way to do this, as Travis said there's no direct pipeline between them, seems to be true. You can use use BLUETOOTH Chat Application included in the Android SDK.
Just change the input method to voice input in the application
Install that Application in both the devices
Try It
change the code accordingly to send files too.

Need to use WLAN in android

I developed an app for android tablet, Now i need to perform certain actions on the app through my android phone using WLAN... How to do it?
Your app can create a server socket to receive client requests, and then interpret commands that your remote client sends to it. This page might help you with the Android server socket part of things.

Categories

Resources