Bluetooth remote for an Android - android

I am new here so I am sorry if my question has already been answered I just could not find an answer!
So I have this first year project in university with a Lego Mindstorm Robot. We are programming the robot on the lego software which is quite easy. We had the robot do a certain function when he receives a message via Bluetooth. The only problem is that the program that we found on the play store wants the user to type in the message and press send but this is not good enough for our project as we need to use our phones as remote controls to turn the robot left and right. So I want to ask you is it too hard to create an android app that consists of 4 buttons each sending a message as follows: left, right, up and down? So far the only programming apart from the lego one I have done is Python and I am only familiar with the basics of it (types, functions, classes, loops, if-statements and the turtle module). From what I have heard Python can't be used to program android so thats why I am asking you guys for help!
Thank you very much in advance! I hope I have made myself clear on what I need to know!

Related

How can I access of websocket using MIT App Inventor?

Before asking my specific question my overall objective (in case there is a better way to do it) is to log data from a particulate matter sensor (PMS) with GPS co-ordinates on my ride to/from work to see how bad the air on my commute is.
So far I have the PMS connected to a raspberry pi, and am recording values from it using a python script.
I'm recording all these logged values to to a log.txt file following the process outlined here: https://www.perrygeo.com/raspberry-pi-real-time-sensor-plots-with-websocketd.html
I've then set-up a websocket (using websocketd) from the pi, which I can access from my computer. This just spits out a current time-stamp, and the particulate matter reading I'm interested in (again following tutorial linked above).
My question is how to access the data from this websocket in an Android App - ideally using MIT App Inventor 2 (as I'm a newb in Android). My google-fu has failed me on this one.
I'm also happy to be told that a websocket is not the best way to do it - I could serve up a JSON file on a webpage instead and parse that from the android app if that'd be easier, but had thought a websocket would be better/faster.
Having done a bit more research there is an extended discussion on this here:
https://groups.google.com/forum/#!topic/ai4a/pL4bHmJKnH0
It's suggested that I might be able to use a socket rather than a web-socket - I'd also be happy to do that.
Ok, it seems to do anything beyond the basics in MIT App Inventor 2 you need to add "extensions" which is what I was missing from my google search terms.
Specifically the following extension did exactly what I was needing - hope it's of help to other people who stumble upon this question (including me in the future!):
https://community.appybuilder.com/t/websocket-client-extension/1761
Finally I noticed that using the websocketURI with the host-name of the server machine (in my case raspberrypi did NOT work - I had to use the IP address. If anyone know why that might be and how to make the host-name discoverable on android please let me know!

Can I build this quiz client app?

I've been programming for over 20 years, but mostly in the VB and SQL. As a side job, I host game shows at local bars and restaurants (Trivia, name that tune, etc.) and I'd like to develop an android app that I can install on mobile devices to give to customers to interact with the game.
I'm trying to make the game shows more interactive than just pen and paper (and time-consuming, manual scoring). I can get Kindle Fires for $40 each, so I thought it would be cool to create an app that will allow the user to do 3 things:
Choose an answer from a list (Multiple choice), and everyone can answer
Buzz in (blocking other users out)
type in an answer
I'd like the tablets to send the responses to a central "hub" or application that will record the answers so it can automatically do the scoring for me. If possible, I'd prefer to be able to have everything connect through an ad hoc wifi network that I would set up on site (that part I know how to do, too).
I'm not looking to have the questions appear on the phone at this point; I have an office-based application that automates a powerpoint presentation based on questions/answers and other parameters imported from a database/spreadsheet. (VBA is nice and easy for me.)
Ideally, the quiz questions would work like this:
I project the answer where everyone can see it.
After announcing the questions, the tablet apps are "activated" and
the user can then select their A, B, C or D answer (or buzz in, or
type an answer depending the type of questions/quiz).
My hub application would then receive the following information:
team/player name, answer choice, time it took to answer the question
(because I'm thinking of using a points tier that gives faster
players get more points, either based on time ).
The catch is, I don't even know where to begin from an android development standpoint, as I have no experience in that realm. In most programming cases, I know keywords to search on, but I'm totally flying blind here.
Does this seem like a feasibly application? There are systems online that I can buy, but the buzzers are expensive and the software has some significant limitations that prevent me from spending the money. I'd rather develop something myself and spend $40 per client unit and load it up with my software.
(Then, of course, license the whole kit and kaboodle and make a mint and retire in 5 years, living the good life off of my pub quiz empire...)
So, if you have any suggestions on starting points, or specific methods and processes to being fiddling with, an IDE...any help would be greatly appreciated. Once I'm up and running, I will reward you with extra points if you ever come to one of my events.
Go full kotlin !
Android works well with Kotlin and you can have a server quickly setup with : https://start.spring.io/#!language=kotlin
https://kotlinlang.org/docs/tutorials/kotlin-android.html
A good client for Android is provided here :
https://github.com/square/retrofit
You will probably have hard time to get started. Using same language for every part of the system will make things easier.
Also, Kotlin is less verbose than Java and will prevent you to make the usual mistakes found in Java world.
Also, if you create an open source project out of it, you may be eligible for IntelliJ.
Your very first stop is : http://try.kotlinlang.org/#/Examples/Hello,%20world!/Simplest%20version/Simplest%20version.kt
Get to know the language by trying it out. When you are in ease with it, start looking at Anko (https://github.com/Kotlin/anko).
To do the project in an easy way, break it down in milestones.
Simple app which shows 4 buttons (choices) and shows a message for each button. (Eg. you clicked "1")
Small server with spring boot. It should display whatever you post to it. (An "echo" server)
Improvement of the simple app to POST something to the server and display the answer in a dialog.
At that point, you application is practically done! You would have understood enough to complete it. The hardest thing would be behind.
Don't think your are smarter than the flock. Do these milestones, at least. You will be thankful to yourself.
This post may seems unrelated, but I explain how good Kotlin can be in such projects : https://www.linkedin.com/pulse/why-do-android-projects-cost-less-than-ios-christian-baune

Building a Client-Server Application and need help starting out

I am looking to make a messenging application for both Windows and Android over Wi-Fi. I have looked around for answers and have come back with a loads of articles that mention Client-Server applications, which is what I want to be using, but they do not mention clearly how everything works or where to start. Could anyone point me in the right direction?
Extra Information:
If possible c# for the server-side as Im more skilled in c# than other languages although I don't mind learning a new one.
Articles I've Read:
http://csharp.net-informations.com/communications/csharp-socket-programming.htm
http://www.dreamincode.net/forums/topic/33396-basic-clientserver-chat-application-in-c%23/

Importing Artificial Neural Networks in Android App

This might sound a bit of a stupid question, but I'm doing a project where I'm using an ANN to diagnose Sepsis in patients using various vital signs as inputs. The aim is to then develop an Android app that allows a user to put in the inputs and will return a risk score (% likelihood of sepsis, etc)
I'm constructing my ANN using Matlab (using their pattern recognition network wizard), and I'm using MIT App Inventor 2 to build the App itself.
Where I'm struggling, is understanding how one would actually put the ANN into the app. Can anyone explain how this works to me, or even just point me in some vague direction?
There is a matlab-compatible programming language called Octave, and it works on Android as well. You might want to take a look at it, it's called addi.
Matlab/Octave is great for scientific prototyping. Once you enter the realm of mobile applications, the best option is to re-write the libraries in Java. It could be painful but with a proper design you will be able to scale your app without depending in Matlab/Octave hacks.
If this absolutely positively has to be present on Android, on the phone itself, the straightforward way to do this is to write the software in Java and then write the Android GUI around it.
But does the software absolutely need to be on the phone? Maybe. But if not, why not make the Android part a client that communicates with a more powerful and flexible remote server? The server can implement in whatever language it likes.

What is involved in connecting an app to a mac via Bluetooth?

I realize that this is the kind of question that frequently gets a lot of (well deserved) "what have you tried" comments and down-votes, but I'm hoping that by the time I'm done asking I can avoid that.
I've been looking around but unable to find the answer to how one goes about writing an application that consists of the following three things:
An Android app that connects to a host device via bluetooth
Communication io layer that sends signals back and forth on
that bluetooth connection
A host resident native app (preferably Unity3D, or AIR) that can receive/send messages back and forth to the connected app.
I have written many Android applications so I am not in need of any kind of "getting started" hand-holding, rather I just need some guidance (preferably in the way of a web link or book tutorial) on what it takes to utilize bluetooth and how one actually communicates via it.
Thanks in advance for all useful tips.
Here are a few links that I found in terms of Bluetooth connections
First of all the dev guide(I assume you have already looked here, but if not this is a good place to start)
http://developer.android.com/guide/topics/connectivity/bluetooth.html
http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html
This one is a basic tutorial on how to Bluetooth on android
http://luugiathuy.com/2011/02/android-java-bluetooth/
This is a long PDF on Bluetooth programming in general (I haven't read it, but from what I have seen it looks over in depth) it covers java and OSX, but not android
people.csail.mit.edu/rudolph/Teaching/Articles/BTBook.pdf
Here is a similar SO question which might contain helpful links
Code samples for Android Bluetooth programming
This is the best Bluetooth open source project that I could find for android, it doesn't fit your description over well, but here it is anyways
http://code.google.com/p/bluetooth-remote-control/source/browse/#svn%2Ftrunk%2Fsrc%2Fpro%2Fapus%2Fblueremote
I realise that a lot of these links are simpler than what you really want, if I find anything more complicate I will add that.

Categories

Resources