i am new to android development and had question regarding custom screen saver.
The requirement is for a tablet which will always be plugged in so battery life wouldn't be
an issue. The required app should behave as a screensaver in that during inactivity, the tablet should launch this app which contains a flash file that displays a series of images and video. When activity is resumed then the tablet takes the user back to the program they were using.
Can this be done via an app without requiring any hacks?
cheers,
abhi
There is no concept of a "screensaver" in Android.
There is the lock screen, which can be modified via custom firmware, though AFAIK it is implemented in Java as part of the OS and therefore could not be replaced via a Flash APK.
Related
I want to prevent remote screen recording of my app using third party apps like Anydesk, Quicksuppport, Teamviewer etc.
I have used below flag for activity :
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
but the above flag doesn't work for all devices.
Any other work around for preventing remote screen recording?
The apps you mentioned are operating with either permission of CAPTURE_VIDEO_OUTPUT or CAPTURE_SECURE_VIDEO_OUTPUT. Unfortunately, if they own CAPTURE_SECURE_VIDEO_OUTPUT, then setting the FLAG_SECURE on your window has no effect from their viewpoint.
Sadly, I don't think there is a better (or more effective) way to achieve the desired behavior.
If you make your app a device administrator, then (on certain api levels) you will have the ability to disable screen capturing on the entire device, but setting this up is a lot of hassle, and it's probably not what you want to do in the first place.
I have an customer project where I have to make single task android device. Customer isn't able to escape the application which my company have developed. Also customer isn't able to start any other application and our application is started when the device is booted. Overall all the customer is able to do with the device is run our application.
Is there any other way to make this work than rooting the device, disabling all system buttons and making our application the launcher. I have something like 400 devices for this purpose so rooting all those would cost lot of time.
I also read Google's tutorial about COSU devices but found it very confucing https://developer.android.com/work/cosu.html#testing-plan
Androids own screen pinning is not good enough because customer can escape the app. Some may suggest to use some kiosk application like SureLock but my company's goal is to find clear solution for this without using any third party apps. Also running our app via some kiosk application is not our goal.
I found some posts on the Stack Overflow with similar question, but not the answer I'm looking for.
If someone has some tips for this question I would be very grateful.
Single purpose devices built on top of Android can get difficult to implement. There are a few different options, but each have trade-offs.
As you mentioned, rooting devices will functionally get you what you want - however it will be time consuming with hundreds of devices to root, difficult to maintain, and you will (potentially) introduce security issues to your devices and app.
Another option is using Google's Lock Task Mode for COSU devices[1]. The link there has a nice graphic showing the features of lock task mode:
1 app pinned to the home screen
only apps white-listed by the DPC (device policy controller) can be locked
Home and Recent buttons hidden
exit by calling stopLockTask()
There are some downsides to using Google's solution for this. First Google recommends creating (and therefor maintaining) an entirely separate DPC app to run as a device owner and set policies[2]. You'll also be dependent on Google Play to manage application updates and be required to have Play accounts associated with each device which "are used to identify a single device that is not tied to a single user for simplified, per-device app distribution rules in COSU-style scenarios"[3]. To automatically get your DPC app on devices your "DPC must be publicly availble on Google Play, and the end user can install the DPC from the device setup wizard by entering the DPC-specific identifier."[3] You'll also need to upload the user application to Google Play[4], which may be an issue for some who don't want their apps on Play. Going this route gives you features you need, but can be complicated and also ties you and your customer pretty tightly with Google/Play services and their workflow.
You can also look at enterprise mobile deployment platforms like Mason[5]. In your case, you can create a custom Android OS in a few minutes with your app locked in kiosk mode (+ other features like disable camera/sms, remove apps and hide settings, etc.) and then deploy it to all of your devices remotely. Mason also supports OS and app updates controlled by you if your requirements change.
DISCLAIMER: I work for Mason
[1] https://developer.android.com/work/cosu.html
[2] https://developer.android.com/work/cosu.html#create-dpc
[3] https://developers.google.com/android/work/requirements/cosu
[4] https://developers.google.com/android/work/play/emm-api/samples#push_install_an_app_on_a_device
[5] https://bymason.com/
I went to the same problem before. I spent at least 3 days doing research. I tried to find many solutions but I found zero.
How I solve is
1. Up To JellyBean
- Use System Alert Dialog (And make it transparent and small size like 2 * 2 And display in some corner(User can't see it)). User can't press home button If there is system Alert dialog
2. After JellyBean, This method doesn't work. The user can press the home button even though there is System Alert Dialog.
so what I did is, start the service on stop and start the same activity again and again(within sec). So user can't see any difference.Don't forget to make activity as single task so that even though you start same activity from service, again and again, new activity will not create (So Ugly way )
- You can simple make screen full screen. make sure in kiosk mode try to check if the screen is in full-screen mode. if not make it full-screen mode(its not hard to do)
- other way is to make launcher app but when ever you pressed home button it always asked to choose launcher app. if user mistakenly choose default/ other launcher app, this solution doesnt work
Good luck
Make your application as a launcher application by defining in manifest file.
After that go to setting of your mobile device and change default launcher application to your application.
I've got a sticky situation. I'm developing a kiosk-style tablet application on JellyBean, and we're stuck with JellyBean.
We don't install a standard launcher on our Android tablets, and instead supply our own Home Screen/Launcher app, so that our application starts on system startup.
We were using a WebView for our GUI app. The WebView that comes with JellyBean is buggy and deficient in many ways, so our app doesn't work correctly in the WebView.
However, Chrome runs our app perfectly, so we want to switch to using Chrome, which we would launch from our own Home Screen application on startup.
We need to start it in full-screen mode, just like Launchers do when they launch any app/URL via a link that was placed on the Desktop.
I can't for the life of me find out how launchers pull this off.
I've tried adding --app="xxx", and/or --start-fullscreen to the /data/local/chrome-command-line file, but all to no avail. The additions options show up on the "chrome://version" screen in Chrome, but they have no effect.
Does anyone have any clue how they manage to launch Chrome in full-screen mode?
These tablets are all rooted tablets, completely under our own control, so no solution is out of bounds.
Thanks for any help!
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is it possible to configure an Android install to run a single app?
So, basically, I'm currently working on an android application that is intended for use on dedicated tablets inside of classsrooms. While using this app, we don't want the students to back out and go messing around, ignoring what they're supposed to be doing. Is there a way to:
a) Have an app launch on startup, so there's no initial access to the home screen
b) Lock the app so it can't be backed out of, and will be the only thing to run
The only way to achieve what you're looking for is:
Modify Android at the firmware level
Make your app the homescreen replacement.
Option 2 is considerably easier. Basically, you tell Android that your app is the replacement home screen, and then set it as the default on each device. That way, whenever the device is unlocked, your app will be shown, and pressing the home button will only launch your app. This essentially stops the device from opening up any other apps, unless it is done via notifications, which you can take away by making your app full screen. The only possibility left to leave your app now is via recent apps, or a service that launched apps on a device shake or something. You can get around this by making sure that no other app was launched prior to yours, or clearing the recent apps manually. The service can be gotten around by simple not installing any app that does that.
You can look into the default home screen app, which is open source and available at:
https://android.googlesource.com/platform/packages/apps/Launcher2.git
I've done a fair amount of research on this and the options are not pretty:
1) Write your own Android home screen
This one is involved but seems doable. Theoretically you could choose to write a home screen that only includes a link to your app and doesn't allow any other icons.
Try this link
2) Create you own lock screen
This may give you more control over the device, but the only options historically have been to use unpublished APIs that have been now been changed to disallow this.
In the application,I am trying to a make activity show when user opens the screen lock (screen unlock) and when activity finish user open screen lock activity run back.I am trying
Intent.ACTION_SCREEN_ON
but it is not working properly. And I also used
USER_PRESENT
but I am not able get expected answer
I tried to find on google but was unsuccessful ,so I am confused how to make this type please tell me fast.
What version of Android are you targeting?
I have been able to get USER_PRESENT working fine on 2.x devices, by declaring it in the manifest.
On 3.x & 4.x I was unable to get it working at first. On these later versions you need to run the activity at least once before the system will allow you to register for the event. This is not needed in 2.x.
Intent.ACTION_USER_PRESENT not received on HoneyComb or ICS (Samsung) devices
android app with service only
I have succeeded with this on 2.x, 3.x and 4.x devices and it works. A simple option for an activity to run, if your app is a background app, is a welcome screen with configuration options on it. This would not be out of place in a background app, and satisfies the conditions.