8

I am trying to clone my app for using multi-user accounts for the same app. This is inbuilt feature for many manufacturer now. Some apps also support in doing so, like Cloneit, Parallel etc.

My issue is my app doesn't appear in the lists of applications that can be cloned. Neither in the manufacturer option nor with other cloning apps. Is there any setting I am missing in my app? for it to be eligible for cloning Thanks

xrnd
  • 1,273
  • 3
  • 21
  • 38

2 Answers2

6

----UPDATE----

My apologies, I did not read your question thorough enough. I thought you were asking about supporting mult-user accounts. That was not your question.

So let's chat a bit further, but I'll leave the multi-user stuff below if it helps anyone else.

So first of all, when you make an app, it is available to all users on the device unless you hide it from some users. That is default behavior as long as the device supports multiple users.

Parallels, Cloneit and other apps are doing something completely different though. They are "not using multi account" they are making you a virtual environment that runs in parallel to your active one, allowing you to make exact copies of the app, but in a whole new active directory.

---QUICK LESSON---

See the way Android works is each application has a package ID, this basically it's unique username for your phone.

Android has various user-groups to access areas of the device, folders, and administrative settings. We have come to know these user-groups as "Permissions".

When you install an app, it will request to be added to each respective Linux User Group (permission) so that it has the right and ability to touch the respective ares of the Android OS and file system. Post-Marshmallow, you have to be added to the permission (aka user-groups) at run-time by requesting in code and allowing the OS to get user feedback to add you to the group.

Parallels, basically clones all of this behavior and makes a new environment for apps to be installed again, but in a different space, so user-groups, permissions etc, would have to be reobtained and the new space which is just normal coding practice, nothing unique about that statement.

However, Parallels indexing process of finding apps that it can clone is based on it's current environment, settings, and support capabilities. So if you compiled your application with settings, SDK, or anything that is not currently supported in the parallel environment, then your app would not be available for install.

Think of it like this. If you go to the App store from a phone that is running OS 6.0, you would not see apps that are written for 7.0 or 8.0 as they are not compatible and therefore, they don't show up in the list to download and install.

Parallels, does not necessarily clone your exact OS, it may have it's own packaged OS that it spins up. I can't speak to how/what Parallels or any other device creates their virtual environments for installation and cloning.

So all of that to say, check your compile SDK, check your target SDK, and check your minimum support. There is likely something in your compiling settings that is not compatible with Parallels virtual environment.

Start by creating a dummy app, and target something older, and make it more compatible. See if it shows up. If it does, then move up your SDk target and other versions until you see that it no longer shows up, then you will know which values affects it and why.

Hope that helps, please do update us on what you find in terms of support in Parallels.

OLD DISCUSSION, LEFT FOR SHARED KNOWLEDGE, NOT RELATED TO ABOVE

---MULTI-USER DISCUSSION for OEM App Development---

As of 5.0 Android, multi-user is disabled by default so the manufacturer must modify.

    frameworks/base/core/res/res/values/config.xml:

<!--  Maximum number of supported users -->
<integer name="config_multiuserMaximumUsers">1</integer>
<!--  Whether Multiuser UI should be shown -->
<bool name="config_enableMultiUserUI">false</bool>

https://source.android.com/devices/tech/admin/multi-user

to allow the device to support multi-users.

As for using the Cloning apps, they each have their own methods of indexing apps, and handling this cloning process. Some may only index on app startup, others may index at install, so I would say you should confirm the behaviors of the cloning app you wish to play with.

Now if you are certain the device you are using supports multi-user then let's continue.

If you are a system level app intending on managing users, you will need permissions to do so as shown below:

    <permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" android:protectionLevel="signature"/>
    <uses-permission android:name="android.permission.MANAGE_USERS" />
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"
                     android:protectionLevel="signatureOrSystem"/>

Here is a helpful link for setting up and handling switching between users in your application.

http://light-green-android.blogspot.com/2015/11/talking-between-user-android-profiles.html https://source.android.com/devices/tech/admin/multiuser-apps

But again, this is only if you are building a system level app for an OEM.

Sam
  • 5,342
  • 1
  • 23
  • 39
  • Thanks for your answer @Sam. One query, what to add in manifest to enable mutiuser as app developer ? As the support doc says, manufacturer has to add resource overlay to support multiple users https://source.android.com/devices/tech/admin/multi-user – xrnd May 09 '18 at 02:22
  • Indexing explanation helped! I could see my app clonable in one of the cloning apps. But I still don't see in my device settings "app clone" feature. Don't know if only social media apps are allowed.. Or there is a setting I am missing. – xrnd May 09 '18 at 02:26
  • Updated my answer, my apologies for not reading your question more thoroughly. – Sam May 09 '18 at 18:42
  • @Sam As you have said **Cloneit and other apps are doing something completely different though. They are "not using multi account" they are making you a virtual environment that runs in parallel to your active one, allowing you to make exact copies of the app, but in a whole new active directory.** what if my app is allowing this how to prevent this? any suggestions please – Vidhi Dave May 30 '18 at 04:20
  • There are a few options, but it's probably not what you are looking for. First you have to remember that a new virtual environment may as well just be a brand new phone. Your software is not aware that it is in a virtual environment vs the physical device OS. Checking for other installs or things like that is not going to work for you. You can try playing with manifest flags like allowBackup=false to see if that causes there process problems on cloning, but doubtful. You may be best to force single device login with a server api, or license registration or – Sam May 30 '18 at 16:12
  • you can find a unique ID of the device hardware like telephone service provider, and send it to your server api as registered installed and prevent another app launch from using the same, but that could get messy and that ID is not guaranteed to be there. But there are a couple ideas for you at least. – Sam May 30 '18 at 16:13
1

Give latest appcloner a try. I'm pretty sure it allows you to do this thing. It can clone almost any app you like.

Gihan
  • 3,144
  • 2
  • 9
  • 36