Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
We have a strange requirement where we have to trigger 1k android apps for a digital wall having devices. We do not have WLAN/INTERNET connection.We want to run an animation in all the devices , synced together.For this we need a trigger to initiate android apps.
I was working with Sound frequency check, but not sure if it is feasible to trigger each and everyone without lag.
Please provide any other suggestions.
You can use a time-based trigger. I expect that you have at least connection to a your mobile provider network which you can use to synchronize clocks. Once you do that, you can use any means of communication with the devices to notify them about the next time to run your animation at a given time.
For example, you could send a SMS message with the time to all devices containing the time when to trigger the animation. There will be a lag before all messages are delivered but if the trigger time is in future further than maximum lag, you will still achieve synchronization.
Or you can use another sensor, such as microphone, camera, maybe even Bluetooth. If you write your application to be triggered by a clap or flash, all devices may trigger at a reasonably similar time (especially if they were the same model with the same installed apps). It depends on how much precision you require. If e.g. sound is not precise enough, you can improve synchronization with time again - set the animation to run at the nearest second/ten seconds/... boundary after the trigger event.
All in all, it depends on your exact requirements (precision, ...) and you will probably need to do some experimenting. Internet connection would probably be the most precise trigger, though. Almost all Android devices have access to WiFi and setting up an access point is not difficult
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Ok I'm in a sticky situation here.
I decided to make an app for my anniversary that shows a notification with a message every day at 8 a.m. That's it no complicated interface or anything.
Thing is I might have got myself way in over my head since although I'm not very new to programming I am new to android studio and java.
So do you guys know any sites and/or that would help me make this very simple app since I don't really know what to search for?
Thanks in advance.
I would suggest starting with the activity tutorial.
Then, have the activity create a notification .
Now you probably want to use the AlarmManager tocreate a notification every day at a set time.
My guess is that the final activity will have buttons to toggle the repeating alarm (set with AlarmManager) on or off. This alarm will persist even when you close out of the app/activity. When the 'alarm' goes off you can point to a routine that creates the notification.
Having it all working together might be hard (I am a newbie in Android) but these are the core components you would need and taking it one step at a time will help ! If I have time I will try to come up with a skeleton.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm building a Java application that will run on a battery-powered, cellular-enabled device (not a mobile phone by the way), and needs to send commands to a server.
These commands are in the form of JSON-objects, so they can easily be serialized and deserialized.
As internet connectivity may not be completely reliable, and the battery of the device may run out, I need a way of saving my commands to disk in case the battery runs out (which could, in some cases, cause power to switch off without warning).
The commands can be 'worth' a few euros a piece, so it's important that I take every precaution (within certain bounds of course) to make sure no commands are lost. Sending a command twice is not a problem, as every command is tagged with a GUID, and my server will make sure duplicates are ignored. The queue may contain up to a thousand commands, but most of the time it will be empty.
What I'm actually looking for is a Queue-like (FIFO) object with a backing file store that is made to survive an instant crash. I need to be able to peek at the next in line, and remove it after processing is finished.
Up to now, I've been working with MapDB 3.0, but the documentation is a bit confusing as to how to create a queue-like object. And besides, it seems to be a bit much for what I'm trying to achieve
You could have a directory of files. One file per message. The file name could be a timestamp or name which records the ordered. A directory with 1000 files should still perform ok.
Once you close the file, it should be persisted to disk, although exact how safe any operation is will depend on the device and how it is implemented.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Does anybody know where I can get the current plain-and-simple-no-nonsense UTC time accurately and really quickly? Our system clocks are variable due to a number of factors but we need a guiding light to run one of our applications. I was wondering if there was a free service where I can get the time via HTTP without much overhead (i.e. I prefer not to scrape it off somewhere like Google search's with a lot of other data because the application would be looking it up quite often). Does anyone know a reliable service for this?
Depends how accurate you want to get and how much you trust the source.
Possibilities include:
http://www.timeapi.org/utc/now
http://timezonedb.com/api
http://json-time.appspot.com/time.json
It really depends on how accurate you want the time to be. If it is to synchronise apps/servers, then using a http request to an external server may not be the best approach as you have to take network latency into account. i.e. the time returned may be in the past if the round trip for the request is slowed down by the network, especially if your going via a proxy. And if the apps are running on different machines, with variable network latency the times will not be synced.
An alternative approach would be to ensure that the machines you are running have there systems clocks all synced. A common solution for this is NTP (Network Time Protocol), which allows servers to keeps there clocks updated accurately.
Here a resource for NTP configuration on Linux, I am sure Google will find you more.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am looking to develop a little Java piece that can capture an image using a digital camera and I can't find a suitable API - I know this is duplicating similar questions but they are old, and after finding lots of old old threads everywhere complaining about the lack of an API I am asking again to see if anybody knows of where this may have been developed - and offered free of course (mine is just a personal project - no distribution).
I want to capture still images from a digital camera, or a DSLR - I have applied for Canons SDK but I do not think it will be approved as it will not be benefiting them at all.
The image must not be a screenshot of a feed retrieved from the camera - I want to capture a native image using the shutter of the camera - and retrieve it in the app for processing - this way I do not get an awfully grainy image, I get one at full quality.
I have been looking into a few API's but if they are not extortionately expensive (JTWAIN), they simply do not do what I want (JFM).
So, are there any out there? Am I just looking in the wrong places?
apparently Xuggler seems to do the job, you can use it with or without maven or even build it yourself, even ant is possible. There are quite a few tutorials on the subject, even on SO
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am in the process of designing my first Android application and have a best practices/design question. So not necessarily looking for code, but for someone to lead me in the right direction as far as research goes.
I am looking to have an application where a user kicks off a timer. When that timer has expired, the application will run some code. I need the timer to continue to run even when the user closes the application and/or reboots the phone. So even if the phone dies, once it is charged and turned back on I need my application to kick off and recognize the timer has expired and run some code or continue counting down (essentially checking to see if a particular date and time has been reached). In addition, I want the user to be able to re-launch the application and end the timer pre-maturely if desired.
I thought I was on the right track by creating a local service in a seperate process but further research shows that may not be best practice and to look into alarm manager with broadcast. So my question to the masses...what route should I be tacking to achieve my goal?
Thoughts/Suggestions? Thanks in advance!!!
I thought I was on the right track by creating a local service in a seperate process
That is an anti-pattern (everlasting service) on top of an anti-pattern (separate process).
what route should I be tacking to achieve my goal?
Use AlarmManager, plus a BOOT_COMPLETED BroadcastReceiver. The BroadcastReceiver can detect missed events, plus set up a fresh AlarmManager schedule.