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!
Related
I'm trying to program an app using android studio that receives data (blood sugar levels) from the app tomato (which calculates blood sugar levels automatically every 5 mins or so). The tomato app already exists and is made by a company.
So I was wondering if doing this is possible. if so, how?
I saw this post: Is it possible for an Android app to use data from another app? which is very similar to what im trying to do but i didnt find an exact solution/answer to this.
Any opinions and help are very much needed and welcomed.
You would first need to know how the app is storing the data, you could check your phone's storage using the Device File Explorer in Android Studio. If they have exposed the data then you are able to check and read the files that the app has exposed. However, I have a feeling that they would not be leaving them in plain text for you to take.
Upon some further reading, it seems they read from a device called a MiaoMiao Transmitter. You could ask the producer of this product for a developer kit and see what they say. This would come with documentation as to how you can get data from the product. However, if they do not provide you with any help, you will need to do some investigation as to how the device functions.
Perhaps it sends android broadcasts when it is taking a reading? This is just speculation of course. This is very niche and I believe that is a reason there are only a few apps that use the device - they are trying to lock out "non-verified" developers. However, when there is a will, there is always a way! ;)
Best of luck!
I have been able to avoid database, webserver setting 20 years, but now I face it. I found so much information that I rather ask before messing all around with a broken system.
So, I need to host about 10 discussions that have about 25 messages each, older I want to remove. So this is really light weighted. My first idea is to have data in JSON format only because I have some experience on that. Data will be accessed from android application.
Now I have been boiling my brains with, mongodb, micro_httpd, libmicrohttpd, json-server, nginx, nosql, nodes, mariadb, mongodb... and it is time to make decisions.
While data is accessed from android application I wonder do I even need any webserver, actually, I dont necessary want that people can browse to host and read everything from browser. Idea is to use example Get to get sender, subject, message into android textviews and same to opposite direction. Thats why I started to think some api or database that can be connected from internet, but webserver is also ok, if stuff can be hided.
This is not a tutorial place, but if someone with experience could propose some setup for me and directions? I have googled pretty much all tutorials. In first setup I would be happy just to receive and send messages to database/api/webserver/webservice, but later on it would also be nice to have some authentication, and one important, somepoint there will be spam coming anyway and I read something about putting sender ip address five minutes to halt. Captcha would be very appreciated, I guess I could open one in android webview. And from our team leader, apache is not an option while it can leak some information (though I didnt see that dangerous). And to remind, this seems something really light.
I think Firebase is the best solution for you: easy to use, no server database complications, easy to implement. Watch some up-to-date videos from the web and you are set.
Currently involved in a University project and could use any help from members regarding rootkits designed for Android.
I have little knowledge of Android malware and the project so far has got us decompiling apks to view the java class files (if readable) and the AndroidManfiest.xml file. I have also managed to root a phone in the uni lab using various adb commands and pushing files over to it.
What I would like to know is if it's relatively easy to spot malicious rootkit code within a class file? Is there something I can look out for? Is it a case of getting su status or does it involve adding users? Assume to next stage would be to then contact a server so the developer has remote access..
Also, is there a system or service that can process an apk to spot if it contains a rootkit (not just malicious)?
reply:
hi sorry about late reply - tried responding immediately but wasn't allowed as I'm new, but then forgot!
Thanks for the info! I appreciate that I may sound naive, but I guess I have to be seeing as I don't know anything about rootkits or the way they work..
You're right, they are not asking about 3rd party scanners, that was just my interest. So on that topic, are you saying there are scanners out there that specifically look for rootkits in a sample? Or is this detection all part of the overall AV service they offer.. If specific to rootkits alone, then I would really like to know which ones, so i can research them..
Also, with regards to exploitation of a bug - I assume you mean a bug within the Android OS? Would this mean that when patch updates are pushed out from Google then the rootkit is unable to function?
Thanks
A mallicious rootkit tries its best to get certain access, secretly. So any generalisations you make about how it does its business will probably be already worked around by any good rootkit.
"setting su status" is hardly worthy of being called a 'rootkit', that's just 'using root permissions' that you seem to have given the app. A rootkit would look for a way to actually get this without permission, by exploiting some sort of bug.
Systems of services that spot those things are commonly called virus and/or mallware scanners. Yes they exist.
Not to be negative, but this seems like a naive post about the subject, and probably not a good start for a project: I'd say using a 3rd party malware scanner is probably not wat is asked?
You could, for instance, look for known exploit-methods. One that for some reason comes to mind is the overflow, but that's just a random thing. Read up on rootkits, their methods, heuristics to find them etc.
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.
First, let me say that I know nothing. I am reasonably intelligent, and I can learn .... but what I need to know is what exactly it is that I need to learn. Consider me a hobbyist that just got started. I have a degree in math so logic makes sense to me, but it was all abstract math so I never even used Matlab once in school.
I want to develop an application for android. I want this application to take input (text and camera images) from the user, and store that input along with certain meta-data (i.e. time of input, geo-location of device when inputted). I also want that data to be transferred to a server (I have complete admin access to a server, but haven't learned much about it yet either) and stored there in a manner which can be accessed by a desktop or web application which I will also need to develop. The android device may not always have an internet connection at the time of input (but will be taken to a wi-fi hotspot for uploading when completed), and after uploading the data to the server I will have no further need for the data on the device.
I have done a bit of research, and discovered the following gaps in my knowledge, and remedied them in the following ways:
a) I'm going to need to know how to program in android - I have worked through these tutorials at developer.android.com, purchased and partly read this book(1), and just purchased this book(2).
b) I believe I am going to need to know something about JSON - I have just purchased this book(3), after reading just a little bit about JSON on the web.
c) I will need to learn what I need to with the server to prepare it for the data - No idea where to start.
d) I will need to decide how to access the data, and learn how to develop whatever it is. - No idea where to start.
I am not able to post multiple links, so I have moved all the books down here ...
1 google.com/search?q=isbn+9780321741233
2 google.com/search?q=isbn+9780321749673
3 google.com/search?q=isbn+9780470526910
My question(s):
If this was your project, how would you go about doing this? What languages will I have to learn? Can you recommend any books, online tutorials, etc. for each of those languages in the way that they would apply to my project?
Thank you for taking the time to read my query, and thank you for any help you may provide.
Book: Pro Android 2. I have it, I've read it, and it shows you how to do just about everything. I bought it for the sole purpose of developing a client/server application in Android, and I completed the app in two weeks.