I'm working on Device Policies with Android for Work and have almost finished the task but for one thing - how do I make a white-listed app automatically installed?
In the white-list of apps for the Work Profile, I can see the app I've added. I'd like to make its installation automatic (or would like to know if that's possible in the first place). Here's the screen-shot:
The row is clickable, which, I hoped, would lead me to a screen with options. The URL implies so, but all I see is a blank screen.
Sorcery?
Normally, you should see a screen with "Preferences section" with 3 checkbox to set as you want :
Auto-install
Prevent users from uninstalling the app
Allow users to add widgets on the home screen
(labels might be different, I use GApps in French and I'm translating it for you right down)
And of course, you have to check the first one.
If you don't see it, it may be simply because of rights administration, even if I'm doubting, because you managed to add apps to white-list, so...
Are you allowed to make this kind of setting ? You should check what are your rights exactly. If you're not the super administrator, you should be at least Android for work Administrator. Check also if your rights are for the whole domain, or just some specific "organizations".
These settings may be changed in the users section in the Google Apps Dashboard.
Related
I am writing a cross-platform app in Xamarin. The app requires certain permissions or it is pretty well useless.
We want to make it as easy as possible for the user to manage the apps permissions.
In iOS the permissions can be accessed on a per app basis (General then scroll to the list of apps at the bottom of the screen, tap and control all the permissions for that app) or a user can grant/revoke access to one particular permission. For example, the user can go to "Cellular Data" and control which apps can use cellular data and which cannot.
That was always a bit unclear to me, so it makes more sense now.
Ideally I would like to put the screen below into the Settings of my app. So there would be a little gear icon for Settings and one option in Settings is "Permissions" and tapping that would show the screen below (in essence). That would be easier to the user I believe.
OK, if we cannot do that can we still have the permissions entry and it would take the user right to the screen below?
Thank you very much,
Bryan
You can try navigating to the settings app in iOS using this :
UIApplication.SharedApplication.OpenUrl(new NSUrl(UIApplication.OpenSettingsUrlString));
I have successfully published a (very simple) Instant App linked to my personal website.
When I click on my website's link, I was expecting the app to start directly, but instead, I first see a screen with 2 buttons: "Open app" and "Open in browser":
Why?
Other instant apps that I tried do not show this screen and open the app directly (the desired behavior).
We call this screen the "speed bump". It's a security feature. You're right in noticing that it doesn't always trigger. But there's nothing you, as a developer, can do to control whether it shows. The intention is for it to be a black box from your perspective.
This is designed in my opinion to happen at least once to give the user an opportunity to decide what to use: either browser or the instant apps feature.
So I am using the Home sample to build an application that creates a second home screen for the user. The idea is to be able to have only one user account yet restrict certain access to chosen applications. I have managed to ensure that all of the applications are invisible in the XML yet I am struggling with how to change this to make certain apps visible.
Is it possible to write a whitelist of accepted apps for instance the preinstalled apps or child friendly apps for children who game using the android device and then put in a Java method to access this white list? This is the only way I can think to make it work.
If anyone knows the correct way can you please help.
Thanks.
Ok so I discovered how to do this.
In the home sample they provide a for loop in the Home.java file that covers all apps and displays them. It take a simple if statement to restrict the apps that can be viewed -
// for loop is here
if (info.activityInfo.applicationInfo.packageName.contains("com.android"))
//then the rest of the home sample is here.
Still very basic but provides me with a good enough UI so that kids cannot see apps I don't want them to.
I want to enable/disable the Android market programmatically for my kids app (with a checkbox). Is this possible? How?
Generally, no. You cannot affect the behaviour of other apps from your app. There are tricks that allow you to monitor what has been stated and you can bring your own app in the foreground to sort of 'block' it, but this is neither supported, nor guaranteed to work on all devices and Android versions.
To disable the play store, do as you would with any other app if you were going to delete it, however in replace of the delete buttin wil be a disable button.
If you do not want to disable it all together, you can open the app, click menu, and then settings, and then half way down on the list you are abe to set a passcode for purchases.
EDIT
I know hat you said programmatically, however this could still be a solution as to what you may be looking for instead as a workaround.
I am creating an Android application for a customer which will be pre-installed and distributed together with the handsets. Now the customer asked me to lock down the ROM to prevent the future users from using anything else apart from this one app. I.e. no browsing, no email, nothing which could create any costs etc.
Now after some googling it seems to be relatively straightforward to remove applications from an Android image. But even if I can remove the web browser, email client, the Android Market App etc, how can I make sure that the user will not reinstall those apps via the USB connector? As Android is just Linux I am sure there are ways of denying all users the right to install new applications (or actually denying them pretty much anything apart from using this one app).
If somebody could point me in the right direction it would be much appreciated.
EDIT:
To clarify things a bit, the customer does not want to use the android devices as phones, even though they are phones. With 100€ touch screen phones becoming available, it becomes viable to use those phones for just one specific purpose. In my customers case, the device will be used as something like a POS system: the employee uses the phone to process a certain kind of customer request, and for this the app needs to have a data connection which will accrue costs of course. Now obviously contracts can be set up that will oblige employees to pay any irregular costs themselves, but why make it that complicated?
This is not about taking freedom away from users but rather about using android phones as general purpose touch screen devices with a data connection that employees can use in a business environment without shooting themselves in the foot with unexpected high data connection cost.
There's not really a whole lot you need to do to make a single-purpose device. If you play your cards right, it should be something you can do without having to tinker with the ROM.
The quick-and-easy route would be to deploy your application as a replacement for the stock launcher, just like any of the other home replacements that are available. Setting that as the default would cover most of the opportunities for casual tampering, since it would leave no other way to launch or install anything else. The only other things I can think of off the top of my head that you'd need to do are snag the search button so it doesn't bring up the default Android search box atop your app and the green key so the phone app won't come up.
You would, of course, need a way to get to the original launcher to maintain the device and install new versions of your app. I'd accomplish that using a "Maintenance" menu item somewhere that asks for some form of authentication (e.g., a password), changes the home app back to the original and launches it. When you're done doing what you need to do, set your app as the default launcher and you're back in business.
Edit to address MAINERROR (now Octavian Damiean)'s comment:
Any activity in any application can register itself as a home application by adding an intent filter on the android.intent.category.HOME category. It's literally four lines in the manifest, and you don't have to write any code to support it. Take a look at lines 77-82 in the stock launcher's manifest for an example of how this is done. (Ignore the filters on DEFAULT and MONKEY; they're not necessary.) Once the activity is selected as the default handler for the category, it becomes the first thing launched at boot and what comes up when the Home key is pressed. HTC Sense, aHome, Panda Home, etc. all use this mechanism.
Launching the stock home (or any other application) explicitly is about five lines of code.
Side note: There's a application on the Market called Home Switcher that lets you launch any of the activities filtering on the HOME category or set one as the default.
Unless the handset manufacturer adds a lot of shovelware, the stuff that runs in the background should be inconsequential and won't get in the way.
There was a similar question already somewhere. You can indeed limit the functionality of your device by the amount you want or have to. In order to achieve this you will definitely have to build your own modified ROM.
You will have to touch the ROM because you will have to get rid of several applications running in the background. One you won't need them anyway and two as you don't need them they would only consume resources.
You might want to take a look at http://source.android.com there you will find more information about the sources which will hopefully direct you where you need.
Blrfl's answer is great, but it still has a problem: if the user long presses the HOME button, the recent applications popup will appear an the user will be able to launch another app.