I am trying to find a way to develop an Android app that connects to a coin connector. How would I get the Android app to recognize that a coin was inserted into the hardware?
Similar to the setup in this link
https://www.youtube.com/watch?v=p7FowiQbNVA
I can give you a general view about what you have to do,
First of all, you have to receive data from your coin device. Therefore you have to talk to a hardware specialist who can change this event to data, maybe using a USB cable communication or a BlueTooth or Wifi connection.
Then you can received this event data from Android OS and use it on your device. You may also require to use NDK and some C development.
I hope it helps :)
Related
I am creating a multiplayer android game as a part of my coursework. This is my first game. I intended to allow users to connect to the game over a simple network. I don't want to use internet at all hence I wont be using the android game services. How do I go about this. I have no clue at all. I have tried various tutorials but all of them are using a central game server. I just want to create a simple Client - Server network. One user will host a game and others will join.
it's my first time answering a question here. I usually just read here in stackoverflow. I'm also currently working on my first game. It connects devices using wifi peer-to-peer or WifiDirect (without a wifi hotspot). It requires high version of android OS (4.0 or 4.1?) but I believe you can also try the other way on which the devices needs to connect in the same wifi hotspot for lower OS version requirements. The latter, I haven't tried yet.
After I connect the devices on the same network (peer-to-peer), I use sockets to exchange data between them. I use serializable objects for sending data. I don't know if it's the best way but it works for me.
My game can connect more than two players in wifi peer-to-peer. One device acts as the network owner (and also the game server).
See android's tutorial/documentation for WifiDirect connection :
http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html
Be sure to read also the adjacent lessons.
Also, Sockets must be used with Threads so you also need to read about it if haven't.
Hope I helped ^^
I finally got the solution and made the Android application. Simply used java socket programming. It works on Hotspot. This works on client - server framework.
Please find the code here and contact me if you require any assistance.
https://github.com/rohitramkumar308/GameOfCards
and this is the link to the app
https://play.google.com/store/apps/details?id=srk.syracuse.gameofcards
Hope this helps you.
I am working on a very small project, where I have to send a signal via usb to some kind of micro-controller board.
I am completely new to this, although have enough android experience, so just need answers to few questions for now:
1.) Is it correct that I will need some kind of Arduino kit to get even started ?
2.) Isn't there any way by which I can test this using day to day devices or simulator, rather than purchasing the kit itself ?
Please forgive if the question looks silly.
Thanks
Sure! you can communicate with your Android or any other languages like (C#, Java, Php, Python...) with Arduino or other micro controller by USB.
Arduino is very easy to start and you can send signal and perform
the required task.
As you code Android, check this you get clear idea.
Yah! Arduino emulator where you can check or
test. check here
Get to know about Arduino Here
Start with this program (Hello World of Arduino)
Hope it helps
You cannot send a signal out of the Android USB port. You will need to communicate with another device via bluetooth or WiFi, and have that device communicate via USB to the microcontroller.
If you want to avoid purchasing anything, you could write a small web service that runs on a computer hooked to your microcontroller. When your android app runs, it would communicate to that web server, which would in turn communicate with the microcontroller.
Then, when you are ready to purchase an intermediary device, if you design your code well, you'd be able to repurpose the code to communicate via that device instead of the web service.
I have a task to integrate a Bluetooth device into my application. Now my requirement is very specific. The device has a specific communication protocol which relies on certain ACKs but I figured it would make my development much easier if there was a program that let me test communication with the device.
I was wondering if there was a program for Linux, or perhaps a simple Android program which let me communicate with any Bluetooth device with a series of pings using data I enter and simply log the responses.
EDIT: I might not have been clear enough in my question.
I have a scale that I need to integrate into my application, and the scale has a protocol similar to this:
Get a specific byte string from device
Transfer data
Transfer packet for disconnection
Receive acknowledgement for disconnect packet
Disconnect
Now when I have to issue a POST request from my application, I usually build a test script online so I can test if the POST works properly.
I was wondering if there was something similar I could do with the device.
Thanks
Your question is not clear enough. To communicate with a BT device, you need to know what profile your device supports. Depending on that, you can find a way in Android or Linux or windows to communicate with the device.
The simplest way is to open an RFCOMM channel from android/PC and transfer data to and from the device. For this the device has to support the serial port profile (SPP). If you want to do this in Android, look for the BluetoothChat example from google.
If you want to use a PC/mac/linux look at the Bluez python module. It's really simple to use. There are plenty of other options too..
I was looking for something like SENA BTerm. It lets me connect to any device and send whatever data I wish.
It is an extremely useful tool for testing my code.
http://www.sena.com/download/manual_bterm/overview.html is where you can find it.
I am working on a dual application on android sdk and kinect sdk. I want to be able to have the kinect send data to a smartphone application. The smartphone application will then give notifications to the user based on the kinect data. The smartphone should be able (hopefully) to turn the kinect on/off and maybe a few other basic commands. How can I get the kinect and smartphone application communicate?
Cool concept, I'm a huge fan of the Kinect (when used on Windows; I think it's a gimmick for the Xbox).
For starters, you can't directly interface with the Kinect from a smartphone. Kinect needs a USB connection, external power, and a Windows 7 machine with a 2.6 GHz dual core processor. So now it becomes a question of connecting a server application running on the Windows 7 machine and a client application on the Android phone. There's a few ways you could do this (USB, WiFi, TCP), but all of them suffer somewhere. USB would tether you to the computer, making the smartphone app redundant (just use the computer since you're already connected to it). WiFi is probably the best choice if you intend to send serious amounts of data, but would only work in your house. TCP (or UDP) could work for some applications, but if you start trying to stream video your phone will hate you.
I'm going to assume you're not going for a data-heavy application (video streaming to phone). If you're just looking to send off notifications from the Kinect to the Android (for example, use the Kinect as a motion detector and send messages to the Android when someone enters the room), similar to a text message update, you could certainly pull off the TCP/IP solution, and probably quite easily. You'd set up a simple TCP server on the Windows 7 computer with the Kinect, and then connect to it with a TCP request (look at the Client side code). Once you've got that set up, it's easy to send messages between the Kinect and the smartphone app. For starters, just try to get a few quick messages sent over. Server says "HI THERE", Android replies "I HATE YOU WINDOWS", etc, and make sure the messages are making it to their destination (TCP pretty much guarantees they will). After you have that running, just build your apps up around it.
If you're willing to eschew the use of the official Microsoft SDK, the Point Cloud Library (built on top of OpenNI) has a framework and tutorial in place for streaming.
anyone know if its posible to make an application to simulate a touchscreen mouse or trackpad by bluetooth??
How can I make that the PC (or MAC) knows me as a mouse device?
Regards,
Juan
You should have a look at the Bluetooth HID specification. It may be possible, depending on the stack of the device that you are using to emulate a mouse/trackpad. I'm not familiar with the stack on Android (assuming that's the platform you're using from the tag on your question) so I don't know if it's possible from there.
Essentially, you create a HID service on the L2CAP protocol. The service record specifies the HID descriptors which describe the data being sent from emulating device. The HID driver on the host computer should be able to interpret that data.
It might be useful to try to connect to another Bluetooth mouse/trackpad from the desktop (Bluecove on a stack other than Microsoft is a good way to hack around in Bluetooth). Have a look at the service record for the HID service on the mouse/trackpad. Also, look at the data coming from the mouse/trackpad for an idea of what needs to be sent and when.
Alternatively, you could write a server application on your computer that communicates via another Bluetooth protocol (e.g., RFCOMM/SPP) to the input-device emulator app running on your phone. The server application would simulate the input device (e.g., move the mouse pointer around on the screen, etc).
Instead of creating your own project why dont you contribute to the remotedroid project?
I'm assuming you know your bluetooth api's well. Remote droid uses Wifi and OSC messaging to communicate with the PC.
Yes you may use GlovePie with the wiimote connected to BlueSoeil, It will alow you to do anything with you computer with the wiimote. It also has a Language it uses
I think you want this:
Serverless Bluetooth Keyboard & Mouse for PC/Phone
It's even open-source!
Unfortunately it is not open source, it just has a GitHub readme for some reason.
But still the app is quite good!