Android Question Running a hidden app

gz7tnn

Member
Licensed User
Longtime User
I want to create a suite of apps along the following lines:
A Primary app will be visible on the device. When it is run, it will search for any other installed apps that has a specific naming convention, and list them on screen.
Tapping any entry in that list should then run the selected app.
I intend to have a specific naming convention for the other apps (klc.xxxx) and just list those with that in the name.

Users would need to download and install the additional klc. apps based on their requirements.
What I ideally want is to give the users the option to "hide" the additional apps to avoid clutter on their device, but to be able to run them from the Primary one.

Having searched the forum I have found how to hide the icon for an app - ie not present an icon in the list of available apps. That approach uses the manifest, and does work for me.

I have also found how to create a Primary app that will run the hidden one (manifest approach).

In addition I have found code that can be run from an app that will 'hide' the icon.
But the problem I have for this approach is that the code I have in my Primary app that runs the secondary one raises an error and does not allow the secondary one to start.

The error is:
android.content.ActivityNotFoundException:Unable to find explicit activity class{klc.Hide0/klc.Hide0.main}; have you declared this activity in your AndroidManifest.xml?
Hide) does have this in the manifest -- <action android:name="klc.Hide0.main" />

I have attached 3 files:
kLCBasic is the primary app that is used to run the secondary ones.
Hide1 is the code for the manifest appproach - which works (app is created as 'hidden')
Hide0 is the code for a secondary app that has the option to hide itself. This is the one that then fails to run once it becomes hidden.

All 3 would need to be installed to see the effect. Then open Hide0 and press the 'Hide Icon' button.
After that this app will not be able to be run from the Primary.

I hope someone may be able to offer a solution that would allow Hide0 to be optionally hidden by the user, but still run. I am using B4A V2.70

I hope that is not too confusing.
 

Attachments

  • klcBasic.zip
    5.4 KB · Views: 271
  • Hide0.zip
    8.9 KB · Views: 291
  • Hide1.zip
    7.2 KB · Views: 293

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

gz7tnn

Member
Licensed User
Longtime User
Hiding the app icon no longer works. It worked in older version of Android. Starting from Android 4.0(?) an app cannot start unless it was previously started by the user. A hidden app cannot be started by the user.

Hi Erel
Thanks for your reply. You mention that it is not possible from 4.0.(?). I have a tablet and phone on 4.4.4 and they both run my sample Hide1 ( hidden via manifest entry ) without any problem. If more recent android versions dont support the hidden functionality then I will stop pursuing this approach.

To expand on what I am after, just in case there is another approach that could be taken.
We all carry loyalty cards around in our wallet, you know those ones you get at coffee lounges where you buy 5 and get one free. Wouldn't it be nice to have just one card.....
I want to emulate this 'one card' concept in an app by having some way of having a central app and then adding each outlet , but not cluttering the home screen of their phone with a lot of separate app icons. Each outlet would have their own app created and available for download - tailored to their preferences.

So is there any way to achieve this, or is it not possible.
Any comment would be welcomed.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
It can be confusing as there are cases where Android will allow the app to start. For example if you are using USB debug mode. Once it is started it can later be started again even if it is hidden. However this will not work with an app that is installed from Google Play.

Why don't you create a single app with all the required functionality? You can use in app purchases to enable more features.
 
Upvote 0
Top