How to connect few android devices? - android

There is restaurant, and I have wrote app for them. Now my task is to create device communication: only single app (on a single device) should work at one time. I.e. when user starts to use application on one device, apps on other devices should show warning "Please, wait...". How I can do this?
I am thinking about creating lock-file on some server (maybe on dropbox open folder???). At start app should look to this folder and if the lock file is exists - wait. If there isn't lock file - app will create it, performs all users tasks, delete lock file, and closes.
Another idea - is to use bluetooth connection... Maybe at starting app should seek for bluetooth device with special name... if it isn't - open bluetooth communication with that lock-name and begin to work... But the problem is the device os 1.6.

I think you're on the right track, but maybe a little far down the development path to think of this now.
Anyway, create an exclusive lock that you expose in a webservice you've deployed on apache (obviously, that service will also expose an unlock method too).
Use a local wifi network (one you install in the restaurant) with a tiny linux box and you're in business.

Related

Log all user and network activities Android

I would like to create logfiles of the activities on my Android phone.
The goal is to be able to trace back any suspicious activities of apps and check if the phone's been hacked.
In this question someone suggested using a proxy server.
But using a proxy changes the ip used and a lot of services (i.e. Netflix) block mobile traffic coming from either server ip's or home ip's when making mobile requests.
The question is already 3.5 years old so maybe the options have changed.
As for the network traffic an option to setup a local proxy on the device itself with a possibility to set logging rules would work though.
How could you setup a local proxy on an Android device?
However this is only the first part as to find possible suspicious activities. But without logging the actual phone activities it will be difficult (or impossible) to actually find out which malicious code or app is doing this.
How can we log activities on Android?
I think when loggin all user activities like touch events etc. and all calls between apps would suffice.
Can this be done without rooting the device? And if not how would one do this on a rooted device?
I would prefer to have this device independent, but I use an Oneplus 6 with Oxygen OS.

android app interact with system bluetooth pairing dialog

I am researching my first attempt to write an android app. I basically just need a "dumb" app that runs on the device and looks for the Bluetooth pairing pop-up request and selects the "Pair" option.
I have found a lot of examples of this when the application I'd be writing is the one instantiating the pairing, but in this case, it's not - it's more of an "out-of-band" scenario. A device will initiate a pairing request with the phone & and app this "dumb" app would be running on. All I want to do is have this app detect when that happens and accept the pairing requests so I don't have to constantly do this manually.
I know there are automation frameworks that can do this, but that is such overkill for a what seems to be a simple task - just sit there and every # seconds (maybe 15) do a quick check for the pairing pop-up dialog and press pair
Is this possible?

How to block specific urls in Android

I am developing a parental kind of App in which there is a requirement to block specific urls from all the browsers in the Device. I think this is an old question but couldn't find any solution yet on stack.
Do you have any working solutions. Assumption - The device is rooted.
Regards,
sha
I have two resources for you:
Since the device is rooted you can work directly with iptables. iptables will give you very precise control over all coming and going data packets. Check out open source projects like AFWall+ on GitHub for iptables in action.
If you want to be able to run your app on unrooted devices look into creating a fake VPN. You don't send any data to an actual VPN server, you simply use the VPN API to filter all the information coming and going. Check out Disconnect (whenever they actually share their open source code...) or OpenVPN which is what Disconnect builds on.

Broadcasting a File over WiFi, without Client App

Target:
Sending a file to connected peers. The connected peers should recieve the File without a preinstalled app.
Situation - Question:
I'm writing an app that opens WiFi-direct or a WiFi-Hotspot for other devices. The other devices connect to the device (Main-Device) where the App is installed on. Now the Main-Device should broadcast a file and every device connected to the Main-Device should get a notification, that it could receive a file. But, the other devices should not need an App to receive the file!
Is this possible? Cause all I found till now describes how you can send something from one to an other device if both installed the same app. Using sockets and one device becomes server and the other client.
Reason:
I try to create a game, which just is installed on a Main-Device. Other devices can join the game by connecting over WiFi, then they'll receive a HTML5-file from the Main-Device which they can open in their browser. As soon as they have the HTML5-file they'll be able to interact with the game on the Main-Device.
But I don't want to force everybody who likes to join the game to download the app. Another Point is, if this is possible, I don't need to rewrite the app for other systems. Cause every Smartphone/Tablet has a Browser.
But, the other devices should not need an App to receive the file! Is this possible?
No, it isn't.
I try to create a game, which just is installed on a Main-Device. Other devices can join the game by connecting over WiFi
That, is possible. What you need to do is build a captive portal.
Basically, all DNS names resolve to your server's IP address, and all traffic that would be routed elsewhere is not routed to the internet. How you do this depends on your network setup. There is a lot of software available. I've used Untangle before with decent results: https://www.untangle.com/store/captive-portal.html

Starting and stopping an Android app remotely through PC or another smartphone

I have an Android Data collection App which collects sensors data. First, I enter the activity name in this app and then press the start button. After the recording is completed, I press the stop button and exit the app. For another activity, I restart the app again.
In my experiments, now I am using 5 smartphones on a participants's body while performing an activity so its bit difficult to start and stop this app for each activity manually as each activity is for 3-4 minutes and is a bit annoying.
I want to control this app remotely, either through another smartphone or PC. For example, like Airdroid:
http://airdroid.com/
However, Airdroid doesn't have the ability to start and stop (plus enter any data) at this point.
Is it possible to enter a name in this app, start it and stop it on multiple smartphones at the same time remotely ? May be using Bluetooth, local WIFI, or internet.
To summarize, I want to the following actions on an app remotely:
1) Start an App
2) Enter a name in its field (it can be worked around too so its optional)
3) Press start button
4) Press stop button when needed.
I looked it up online but most work has been done on controlling PC though smartphone and not the other way around.
Thanks
Zubkan
Integrate a HTTP server into your app, then you can control it easily using a web browser. A very nice option for Android is NanoHttpd, which comes as a java class.
Edit: Some additional notes:
This probably requires the phone to be connected via WiFi, because carriers might not allow this. And if the phone isn't rooted, you cannot run the server on Port 80, but Port 8000 or so will do.

Categories

Resources