home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.mobile.android      Discussion about Android-based devices      236,147 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 234,616 of 236,147   
   Marion to Marion   
   Re: How to create a one-tap shortcut dir   
   01 Nov 25 14:48:17   
   
   From: mariond@facts.com   
      
   Marion wrote:   
   > Hence, my next step may be to explore whether an intent can open the   
   > Maps app info screen to reduce the tap count from 6 taps to 3 taps.   
      
   Think of an Android Intent as a little instruction slip we hand to the   
   system that says "please do this action, with this data." The system then   
   figures out which program or component can handle it.   
      
   The intent I'm considering uses the action   
    ACTION_APPLICATION_DETAILS_SETTINGS   
   with the data   
    package:com.google.android.apps.maps.   
      
   When the system receives this intent it launches the Settings activity   
   that shows the info page for that app. From there, we can tap   
   Permissions, then Location, then toggle the precise location option.   
      
   This is an explicit intent because we are naming the exact component we   
   want to open. An implicit intent would be more like saying "show me any   
   app that can view a map," and the system would present a chooser of apps   
   that can handle that action.   
      
   For example, with a PC attached over USB, the adb command might be   
    adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS \   
       -d package:com.google.android.apps.maps   
      
   But inside the intent, that same set of commands turns into something like   
    startActivity(new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,   
       Uri.parse("package:com.google.android.apps.maps")));   
      
   The adb shell form is useful for testing because it lets us simulate the   
   intent from a connected PC without writing any code. The startActivity form   
   is what an Android app would actually call inside its own process to launch   
   the same system activity.   
      
    Intent intent = new Intent(   
       Settings.ACTION_APPLICATION_DETAILS_SETTINGS,   
       Uri.parse("package:com.google.android.apps.maps")   
    );   
    startActivity(intent);   
      
   Muntashirakon App Manager (AM) can create shortcuts but this failed   
   because the shortcut needs "extras" that AM doesn't give to them.   
   1. In Muntashirakon App Manager, I searched for "settings"   
   2. There are many. I selected "com.android.settings".   
   3. I went to its Activities list top find these three.   
      com.android.settings.applications.InstalledAppDetails   
      com.android.settings.applications.InstalledAppDetailsTop   
      com.android.settings.applications.InstalledAppOpenByDefaultActivity   
   4. But when I press "Launch", it just blinks.   
   5. Likewise with the shortcut created by "Create shortcut".   
      
   So that failed.   
      
   We need a tool that lets us explicitly set both Action & Data.   
    Action: android.settings.APPLICATION_DETAILS_SETTINGS   
    Data:   package:com.google.android.apps.maps   
      
   It seems that QuickShortcutMaker, Activity Launcher, Intent Launcher &   
   Instant Intent can probably create a shortcut with Action & Data.   
      
   It turns out QuickShortcutMaker can make pinned or static shortcuts.   
   I prefer static because it works even if the creator is removed.   
      
   So I'll try that next.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca