[General Questions and Answers] GalaxyA325G:
WIP WIP WIP ... I wrote this up in the vi text editor so I'm still formatting it to make it pretty - try not to quote it yet as I'm still cleaning it up - but the steps were tested to work - and I haven't yet added the screenshots!.

Tutorial: How to

MANUALLY

create, from scratch, a 5-levels deep 1-tap shortcut to "Precise Location Settings" spanning two packages (com.android.settings & com.google.android.gms) without having any idea whatsoever at the start what the unique package or activity name will be.

Note this is one of the toughest types of shortcuts you will ever need to make, because you're starting with almost nothing concrete - all you have is you can click to the activity.

And... it's important to note, you're creating the shortcut totally

MANUALLY

(creating the URL:URI completely from scratch!) without using hide-and-seek lookup tables.

This brings up the point that when you need to make a shortcut to an activity deep inside an app (such as deep inside special Google settings), there are various starting points based on how much information you know at the start.

You may somewhat know the package &activity name, or,

You may have no idea of the package & activity names, or,

Sometimes, both the package & activity names may not be reachable from the Android settings or from an app

(but it's there... it's just a hidden activity with no GUI.)

In all cases we can create a one-tap shortcut if we know how.

In this recent summary thread, I covered the starting point when you know the package name and you have at least a vague idea of the activity name.

Now @devnoname120 and I will show you how to create a shortcut when you have no idea what the package or activity name is - but the activity isn't hidden - so you can step down into a set of apps to find it (where, in this case, we start with the com.android.settings "Settings" package which then (deviously so) silently and secretly shifts into the privacy-robbing Google-only com.google.android.gms "Google Play services" package!).

Tricky Google!

Google not only buried the critical setting five layers deep,

But Google also secretly switched packages mid stream!

Which means, at the starting point...

You have no idea what the package name will be

Nor do you know what the activity name will be

This is the hardest use case because nothing is known at the start, other than how to tap your way into the activity.

So this is the starting point for this tutorial.

You don't know what package the activity is located in

And you don't know the name of the activity either

But you do know the five taps you need to do to get to it

No problem.

1. First, you need to figure out the unique package & activity name.

This is done by installing any shortcut-inspector app, where I had

already on my system a shortcut inspector from my tests long ago.

Shortcut Widgets (+ Inspector) by Hamed Nikbakht

<https://play.google.com/store/apps/details?id=com.cemique.shortcutwidgets>

Drat. I just noticed it's no longer in the Google Play Store, so either

find an alternative or use a different app APK repository, such as

<https://apkamp.com/com.cemique.shortcutwidgets>

<https://m.apkpure.com/shortcut-widgets-inspector/com.cemique.shortcutwidgets>

2. Start Shortcut Widgets & Inspector & go to the "Inspect" tab.

3. In the "Inspect" tab, tap the red "Start Inspecting" button.

This will report every public activity that draws on the screen

in the order you displayed them.

4. Press the round "Home" button on the bottom Android system bar.

5. Now go to the activity that is five levels deep in Settings!

a. Settings

b. Location

c. Location services

d. Google Location Accuracy

e. Improve Location Accuracy

6. Once the desired activity has drawn on your screen, you can now tap the "Overview" button on the bottom Android system bar to go back to the Shortcut Widgets (+ Inspector) "Inspect" tab.

7. Press the "Overview" button on the bottom Android system bar.

8. Select the "Shortcut Widgets (+ Inspector" background activity.

9. Note that you will see that you activated three activities where, in my case, one item was the launcher

a. One UI Home com.sec.android.app.launcher/com.android.quickstep.RecentsActivity

While another item was the com.android.settings package which is Android settings.

b. Settings com.android.settings/com.android.settings.homepage.SettingsHomepageActivity

But the activity was found in a different package, namely com.google.android.gms, which is the Google Play services package.

c. Google Play services com.google.android.gms/com.google.android.gms.location.settings.LocationAccuracyV31Activity

Voila! We now have the unique package & activity name

which you didn't know at the start of this tutorial.

10. Tap on the "Google Play services" activity listing.

11. You'll get a summary and a "Test link" & "Add to shortcuts" option.

12. Press the "Test link" to confirm it brings up the correct activity.

13. Hit the "Back" button on the bottom Android system bar (or at the top left of the activity).

14. Again tap on the "Google Play services" option.

15. This time, click the "Add to shortcuts" option in Shortcut Widgets (+ Inspector).

16. Name it whatever you like (e.g., "precise location") & press "OK".

17. Unfortunately, that does NOT put the shortcut on your homescreen - if it did - this would be the end of the tutorial.

It only saves the shortcuts inside the app in the "Shortcuts" tab. Which is useful in its own right, but it's not what we're looking for.

We don't want shortcuts inside of apps but on the homescreen.

Hence, the task at hand is to put that shortcut on your homescreen.

But at least now you know two things you didn't know at the start.

Question = What is the unique package name?

Answer = com.google.android.gms

Question = What is the unique activity (aka class) name?

Answer = com.google.android.gms.location.settings.LocationAccuracyV31Activity

Note: Given we know the two important items, we have _many_ options here, e.g., termux/adb will open shortcuts,

but we have to save a termux/adb script as a widget, not an icon.

Also the hide-and-seek method described in this post will now

work because we finally know the package and activity name.

How to automatically create a shortcut to an activity if you have a vague idea of the package and activity name

But another method is to simply manually create the shortcut,

now that you know the two most critical items (package & activity).

Below we will proceed to manually create a URL which we can then

turn into a shortcut to the "Improve Location Accuracy" activity.

18. To manually create that URL, you need to know the syntax. For that,

install Intents, by krow (free, adfree, gsffree, rated 3.9)

<https://play.google.com/store/apps/details?id=krow.dev.scheme>

19. Start "Intents" & press the (+) & enter the fields specified below.

Action: Select the radio dial for "ACTION.MAIN" & tap the back button

Package Name: com.google.android.gms

Class Name: com.google.android.gms.location.settings.LocationAccuracyV31Activity

Category: Select the checkbox for "CATEGORY.LAUNCHER" & tap "Choose"

20. To confirm the syntax is correct, tap the airplane icon at the

top right to open up the activity.

This should dive five levels deep to "Improve Location Accuracy"!

Press the back button to get back to the Intents setup.

21. Press the "X" button at the top left of the Intents GUI.

This will bring you to the "Favorites" and "History" tabs.

22. Tap the "History" tab to see the syntactically correct intent.

23. Longpress on the desired intent to get a half dozen choices.

Execute intent

Dive 5 levels deep to the "Improve Location Accuracy" activity

Edit alias

Allows you to create @alias but I have no idea how to use it

Copy uri text =>

#Intent;action=android.intent.action.MAIN;

category=android.intent.category.LAUNCHER;

package=com.google.android.gms;

component=com.google.android.gms/.location.settings.LocationAccuracyV31Activity;

end

Remove intent

Removes the intent from the "Intents" GUI

Create shortcut

I don't have any idea what this does as no shortcut is created

Favorite

Saves the intent into the "Intents" Favorites tab

24. Keep "Intents" in the background in case you need to recopy the URI.

25. Now we need to construct an HTTP URI to put into our shortcut.

For that, install "Instant Intent" freeware, by TrianguloY

<https://github.com/TrianguloY/intent>

<https://play.google.com/store/apps/details?id=com.trianguloy.instantintent>

26. With the URI in your clipboard, start "Instant Intent".

27. In the "intent uri" field of "Instant Intent", paste the URI above.

28. To confirm the syntax, tap "Open Intent" which should open the desired activity.

29. Press the topright back button of the "Improve Location Accuracy" activity.

30. That should bring you back to "Instant Intent".

31. Prepend the intent string with https://trianguloy.github.io/intent/

FROM: #Intent;action=...blah blah blah

TO: https://trianguloy.github.io/intent/#Intent;action=...blah blah blah

32. Confirm by pressing "Open Intent" which should open the desired intent.

33. Longpress on the URL and copy it into your clipboard and leave

"Instant Intent" running in the background (in case you need it).

34. Your final step is to turn that URL into a homescreen shortcut. For that,

download & install Shortcut To URL by Mio (free, ad free, rated 4.2)

<https://play.google.com/store/apps/details?id=jp.miotti.ShortcutToURL>

35. Start "Shortcut to URL" and give the shortcut any desired name and

paste the https://trianguloy... URL copied from "Instant Intent".

36. If desired, choose a custom icon for your new shortcut & press OK.

37. You can press "Add Automatically" but I'd suggest you longpress

on the icon in the middle to be able to drag and drop to the

desired shortcuts folder on your homescreen dock.

38. Test your new homescreen shortcut by tapping on it.

Voila!

You now have a one-tap shortcut that dives five levels deep into

Settings which - get this - is no longer in the settings package

as it switches over to a special Google-only settings package

(which isn't part of the normal Android settings!) to bring up

the "Google Location Accuracy" "Improve Location Accuracy" activity!

As always, if you know more than I do on this topic, please add value

because this is four steps where I wish I could make it simpler.

Note: I repeat you can use the previous lookup method; but the

goal in this tutorial was the difficult case of creating a shortcut

manually without knowing (at the start) the package or activity.