Connecting to Sphero sprk+ android - android

I am trying to connect my Android App to Sphero Sprk+ . The Sphero-SDK comes with samples to connect to sphero robot. I have tried that but could not connect to the sprk+. The reason I think is that SPRK+ requires proximity detection profile for Bluetooth LE (4.0 and onwards). Is there a hack or source code that connects to sprk+ ? I tried the Android's Bluetooth LE sample code for the heart rate monitoring profile , and I was able to detect and connect to the SPRK+ . But being a newbie , I still am looking to understand if the sprk+ is a GATT server or GATT client . Sphero lightning Lab connects to sprk+ when it is brought close to the mobile device. So, I understand the code should use proximity detection profile.
UPDATE :
Already figured out the solution. If anyone is looking for a Sample - you can check out the code here - https://github.com/tswapnil/PC-controlled-Sphero/tree/master/app/src/main/java/com/example/swapnil/buttondrive

I was able to connect to a Sprk+ in an Android App using the beta branch of the orbotix/Sphero-Android-SDK repo. I belive the RobotLibrary.jar in that branch has the necessary updates to interface with a BLE device. This would allow you to avoid getting into the internals of how BLE works.

Related

How to connect arduino and android app with gsm internet?

I am making a prototype for my final paper (Electronic technician) and the purpose is: A real-time car tracker using GPS and arduino UNO to this, and an android app (made in android studio with Kotlin) to connect the arduino and receive some data to help the user in case of accidents, robbery and theft. The main problem is, how can I connect the arduino GPS and the android app in long distances? With internet? For this, we thought about using the GSM800L module to this function, but we don't have any Idea to implement this two ideas together, we know Kotlin has some functions to GSM, however, we don't know how to use it in the code. If someone has the answer to this questions, I would really aprecciate it.
You need a mediation device.
Arduino GSM in the car
Android app
Server of some sort, with a database and connectivity to the internet
Arduino sends data over HTTP or even better using MQTT.
Android app read data from server or even better get notifications and update the screen.

Android 3g wifi simultaneously

I am using Android studio 2 and java, and i am writing an app that i need to be connected with a piece of hardware through wifi (parrot ar drone 2) and also "trigger" some events (takeoff land etc) through 3g network. I have made a simple app using parrot sdk that do some simple things to my drone successfully . I am facing now the challenge that these simple things i want to be driven through my server (i am thinking of websockets).
So my problem is :
If my device is connected through wifi to the drone, how could i also connect to the internet in order to get "triggered" to run some commands?
I was thinking that would be great if o could connect my android device to the drone and with some way be connected to internet.
After some research i have found that may be this functionality be available to android 6 BUT i have not found any example yet.
Generally i trying to find a solution (software or hardware).
I appreciate a lot any kind of help or suggestion about my problem.
Thx in advance
I don't think it is possible to connect to 2 W-Lan hotspots simultaneously with just one chip. Where did you find that information?
You can set up your Android device as a WiFi hotspot and have your drone connect to the internet via that.
At the same time your app can connect to the drone, assuming your drone has some sort of local server like connection your app connects to.
You can check this in practice quickly by setting up a Wifi hotspot, connecting your drone and then using a ping utility on the phone to make sure you can ping the drone successfully.
If you want to connect from a remote server to the drone then you are dependent on your network allowing inbound connections, which is often not the case. A common workaround is to use some form of mobile push notifications to send a message to your app asking it to contact a server on the internet, which will then tell it what action you want to perform on the drone. In others words:
send message to server on the internet somewhere to tell drone to take off
your server triggers a push notification to the app on the phone
the app contacts the server and asks 'what is the message for me'
the server responds to the app with the 'tell drone to take off' message
the app messages the drone to tell it to take off

how can i send message from an android device to another android device using Wi-Fi Peer-to-Peer?

I want to create chat application using wifi peer to peer,am already establish communication between devices using docs ,but am little bit confused when am trying to transfer data.First time am working with peer communication,Please help me how can i achieve this.is there any sample chat app for reference. Thank you

How to use android as ANCS content provider?

I'm trying to demo android side service (content provider in ANCS lingo), that communicates with embedded device that supports Apple Notification Service (ANCS) notification consumer. Reason for this is, that the embedded device only supports ANCS. As the ANCS BLE side things are publiced by Apple, this should be possible and I've already added that service + associated characterics to android side gatt server. Embedded device is nordic nRF52 and SW is nordic ANCS demo. Demo works OK with iPhone and apparently with the desktop version of nRF control panel (if added with nordic supplied config and if you have windows machine, which I don't).
However I cannot seem to be able to bond the device with android, that's required before connection. The advertisement is in limited discovery mode (before bonding) so I cannot find it via regular scanning from settings. Also bonding from java code doesn't work. With mBluetoothDevice.createBond() I get ACTION_BOND_STATE_CHANGED callback with state 10 (BluetoothDevice.BOND_NONE) with old state 11(BluetoothDevice.BOND_BONDING). Apparently I would need to exchange keys here, but no idea how to do that.
Also dunno if anyone has done this same exercise before, but any other tips would also be appreciated! Thanks!
Problem was that the phone BLE stack was corrupted or in some invalid state. REboot and removing battery solved the issue with the bonding.

Android: bluetooth listen thread for incomming data only

i am working on an android app in which I need to only listen for incoming devices an log the data they are sending using Bluetooth, device sending data is basically a digital Bluetooth enabled thermometer which just sends the data. Problem is i don't know where to start as i m new to android programming. Just a step by step Procedure would be enough to guide me on the right track . i tried Bluetooth chat example but i didn't took me any where also i wasn't able to understand it.
Regards,
Rafiq Ahmed
First thing you need is to know how to make the connection with the thermometer. I suppose that, since the device is paired to the smartphone, you only must to manage the connection as a server (On the android-phone). Here you got a summarize:
Change Bluetooth permissions:
http://developer.android.com/guide/topics/connectivity/bluetooth.html#Permissions
Enable and set up the bluetooth: http://developer.android.com/guide/topics/connectivity/bluetooth.html#SettingUp
Find the device: http://developer.android.com/guide/topics/connectivity/bluetooth.html#FindingDevices
Connect with it: http://developer.android.com/guide/topics/connectivity/bluetooth.html#ConnectingAsAServer
And manage the connection:
http://developer.android.com/guide/topics/connectivity/bluetooth.html#ManagingAConnection
And last thing, I recommend you to pair the device before running the application, at the adjust menu of your mobilephone. Since that, follow the previous steps and all will be fine. If you have some doubt ask me, I had the same troubles about bluetooth connections with arduino and HC-06 bluetooth device
Hope it helps

Categories

Resources