Android shortcut to file

Create an Android folder shortcut on home screen

Android gives you the ability to create desktop (home screen) shortcuts to your favorite files or folders.

How to create an Android desktop shortcut to a folder?

To create a shortcut to a folder on your homescreen, you will have to use the File manager. Here are the steps to follow:

  • To create a shortcut, open the File Manager.
  • Browse for the folder of your choice.
  • Then, press and hold on the folder.
  • Tap the three dots in the upper right corner.
  • From there, select Add to homescreen.

How to create an Android desktop shortcut to an app?

Creating a shortcut to an app on your home screen is even easier as it doesn’t require you to use the File manager. Just follow these three steps:

  • Select the menu button.
  • Find the app of your choice, press and hold.
  • You will be able to drag and drop it to the homescreen.

How to create an Android keyboard shortcut?

In order to create a keyboard shortcut, you have to follow a different method. Here’s how:

  • Open Settings.
  • Scroll down and select Language & Input.
  • Select Personal dictionary.
  • Tap the + button.
  • Type the word or expression of your choice. Enter the associated shortcut.
  • Press back.
  • You will now be able to select the full expression from the suggestion field on your keyboard whenever you type the shortcut. For example, typing «brb» will suggest the full expression «be right back».

How to see the keyboard shortcuts on Android?

Here’s how to access the list of command keyboard shortcuts:

  • Open Settings.
  • Select Language &Input from the list.
  • Tap Physical keyboard.
  • Open Keyboard shortcuts helper.

Источник

Обзор Android Shortcuts

С версии ОС Android 7.1 (API 25) Google предлагает нам новый механизм работы с приложениями — Android Shortcuts. Мы написали краткий обзор этой фичи, созданной для удобства пользователей.

Общий обзор

В переводе с английского «shortcut» — кратчайший путь, такое название хорошо отражает основное предназначение шорткатов. Они позволяют нам попасть в какую-то определенную точку приложения и выполнить конкретное действие всего за пару нажатий. Шорткаты неплохо смотрятся, например, если пользователю надо:

• выбрать заранее определенный маршрут в навигаторе;
• начать беседу с другом в мессенджере;
• продолжить игру с последней точки сохранения.

Основные компоненты

Шорткат включает в себя:

1) интент или массив интентов, которые запускают конкретное действие;
2) идентификатор или ID, определяющий именно этот шорткат;
3) короткое и длинное сообщения, отображающиеся при его показе;
4) иконка слева от текста.

Чтобы лучше разобраться в механике работы с шорткатами, рассмотрим их классификацию.

Виды шорткатов

Android предлагает 2 вида шорткатов (на самом деле их три, но об этом ниже): статические и динамические. Далее рассмотрим каждый тип шорткатов с небольшими примерами и пояснениями.

Статические шорткаты

Описание статических шорткатов содержится в xml -файле. Они создаются один раз, их нельзя удалить, добавить и изменить без обновления приложения, но их достаточно просто создать.

Файл shortcuts.xml , содержащийся в res/xml/ :

И пара строк в AndroidManifest.xml :

Удалить шорткат или поменять его составляющие никак не получится, пока приложение не будет обновлено.

Статические шорткаты рекомендуется использовать для тех действий, которые точно никак не изменятся из-за пользовательских манипуляций с приложением и всегда будут доступны. Например, открыть новый поисковый запрос, перейти в настройки уведомлений, начать новую беседу. Однако использовать статический шорткат, к примеру, для того, чтобы отправлять пользователя сразу на экран авторизации — не очень хорошая идея. А что, если он уже авторизован? Тогда это действие не имеет смысла. В таких случаях нам пригодятся динамические шорткаты.

Читайте также:  Чат для стрима андроид

Динамические шорткаты

Их можно добавлять, удалять, изменять в режиме реального времени, то есть в зависимости от тех или иных событий. Вернемся к примеру с авторизацией: если пользователь не авторизован, то добавляем этот шорткат, как только авторизовался — удаляем.

Все взаимодействие с шорткатами программно происходит через класс ShortcutManager, доступный для 23 версии API, однако большинство его методов доступны только для 25 версии API. Операции с ними достаточно просты, но есть некоторые нюансы, которые будут подробно рассмотрены дальше.

Удалять и изменять динамические шорткаты также достаточно просто:

Закрепленные шорткаты

На самом деле есть еще один вид шорткатов — это, если дословно переводить, «приколотые» или «закрепленные» (pinned) шорткаты. Выглядят они так:

Создавать такие шорткаты программным образом нельзя, как и удалять. Это может сделать только сам пользователь. Но с помощью кода их можно отключить ( disableShortcuts() ). Можно закреплять как статические, так и динамические шорткаты.

При дизейбле любого шортката можно задать соответствующее сообщение, которое будет выведено пользователю при нажатии на него.

Мы ознакомились с шорткатами и основными принципами их работы в целом. Теперь можно перейти к деталям, особенностям и практическим советам.

Детали и тонкости применения

1. При добавлении шорткатов в большинстве случаев они будут отображаться от первого добавленного к последнему, первый добавленный будет ближе всех к иконке приложения. Сначала будут отображены статические, затем динамические.

2. При создании шортката необходимо установить длинное и короткое сообщения. Длинное сообщение указывается в списке, если оно не вмещается — то короткое. Google рекомендует устанавливать короткое сообщение не более 10 символов, а длинное — не более 25.

3. Несмотря на то, что можно добавить максимально пять шорткатов, Google рекомендует не добавлять более четырех. Да и в списке больше четырех шорткатов не отобразится (последний добавленный не покажется). Зачем нужен пятый шорткат — загадка, ведь на планшетах он тоже не отображается.

4. У атрибута targetPackage статических шорткатов есть одна особенность — он может иметь только хардкод-значение. Если у Вас для разных сборок приложения используются различные суффиксы applicationId , то при объявлении шортката указать значение targetPackage ссылкой, например, @string/shortcut_target_package , не получится. Придется создавать файл shortcuts.xml отдельно для каждого buildFlavour приложения и прописывать необходимый targetPackage вручную с нужным суффиксом applicationId .

5. Важно, что Android сам никак не регулирует количество добавляемых шорткатов. Если вы по какой-то причине захотите добавить шестой шорткат, приложение просто упадет, выбросив IllegalArgumentException: Max number of dynamic shortcuts exceeded . Самостоятельно следите за количеством добавляемых шорткатов.

6. Если не задать хотя бы одному интенту шортката атрибут action, то в случае динамического шортката приложение упадет при создании этого шортката, а в случае статического — шорткат просто не будет создан. Отметим, что в extras интентов шортката нельзя положить некоторые типы, например, Serializable , допустимые типы можно увидеть в исходниках PersistableBundle.

7. Если попытаться вызвать getSystemService(ShortcutManager.class) на устройстве ниже 23 API, то приложение упадет с ClassNotFoundException .

8. При добавлении нескольких интентов к шорткату, которые обрабатываются разными активностями, можно выстроить определенный стек активностей. Самой нижней в этом стеке будет активность, обработавшая первый добавленный интент.

9. Если пользователь заблокирован на устройстве, то воспользоваться шорткатами у него не получится — они содержатся в зашифрованном хранилище.

10. Если пользователь хочет поддерживать приложение на другом устройстве, то только «закрепленные» шорткаты будут воссозданы на нем. Динамические и статические не воссоздаются, однако статические будут заново определены при установке приложения. Если вас волнует поддержка приложения на разных устройствах, и вы не поставили флаг allowBackup = false в Манифесте, нужно заботиться только о ручном воссоздании динамических шорткатов.

11. Android developers также предлагают нам использовать метод reportShortcutUsed(String id) при выполнении действия из соответствующего шортката — как при нажатии на шорткат, так и локально в приложении, если действие то же самое. Как утверждают разработчики, должна быть статистика использования тех или иных действий из шорткатов, и на основе этой статистики пользователю могут предлагаться определенные шорткаты. Возможно, именно здесь должен раскрыться потенциал пятого шортката.

Читайте также:  Локатор для детей андроид

Напоследок парочка еще не упомянутых советов от Android developers.

1. Обновляйте шорткаты ( updateShortcuts() ), если их содержание и значение не изменилось, а изменилось только отображаемое сообщение или иконка. Если вы хотите убрать один шорткат и добавить другой, то не используйте обновление, выполните операции удаления, а затем добавления. Пренебрегая этим советом, можно получить разного рода казусы с «закрепленными» шорткатами.

2. Следуйте руководству по дизайну шорткатов. Это небольшой документ, которому нетрудно следовать.

Источник

Introduction

The Android mobile operating system has gotten much better over time at making it easy for users to download, load and store personal documents on their mobile device. However, if you need to access a particular file regularly, tapping through various layers to get to it can be a pain. Thankfully, Android makes it easy to create a shortcut directly on the home screen to files you access regularly. Examples of all instructions in the steps can be seen in both the YouTube video above and the image collection located beneath the steps.

Looking for a new portable Bluetooth speaker but you also want to save a few bucks? Click here to check out the discounted UE Boom 2, or click here to check out all of the great portable Bluetooth speaker deals on Amazon Renewed!

Steps to Create a Shortcut to a File on Android Home Screen

Navigate to the location on your Android device where the file is located that you want to create a shortcut to on your device’s home screen. In this example, because the file I want to create a shortcut to is in the Downloads folder, I’ll open My Files and navigate to the Downloads folder.

Perform a long press against the file you want to create a shortcut to to mark it as selected, and then tap the «Options» icon to open a menu.

Tap «Add Shortcut» in the menu. The Add Shortcut To menu is displayed.

Tap «Home Screen» in this menu. The Add to Home Screen menu is displayed.

Hold your finger against the icon in the menu and continue holding your finger against the icon. You’ll be routed back to the home screen. Place the shortcut icon that points to your file where you want to locate it on your Android home screen, and then remove your finger from the screen. You can tap that shortcut anytime going forward to open your file.

If you’re streaming video devices are a few years old it could mean you’re missing out on better video quality and great new features. Click here to check out the latest Roku Ultra model, or click here to visit the Roku store on Amazon.

Источник

How to Create File Shortcuts on Android Devices?

Shortcuts, jump-links, are the saviors when we talk about finding a needle in the haystack. Literally, we are talking about navigating to a specific file on the Android device. Piercing your way through, to find your favorite song before bed, an important document or a presentation file may be tedious at times.

To save you from the twiddling-through file navigation, Android has a built-in feature to create file and folder shortcuts. At times, however, there comes along an inability to create file shortcuts using the built-in feature. So, back to square one? I would say no. Because we have here a couple of apps that enable you to create shortcuts for files and folder. And, placing them on the home screen for your swift needs is just a matter of time.

Читайте также:  Nicehash miner для андроида

ES File Explorer File Manager

Creating file shortcuts is straightforward with the ES File Explorer. The app is free to grab in the Google PlayStore. You can download the app and create shortcuts for your files with few simple steps. Open the app to land on the home screen that is loaded with categories of files, recently used and the most used files. A feature that makes navigation quite intuitive.

Once you get the file of your choice, press and hold the file. A green checkbox opens up on the file icon, and a menu bar appears at bottom of the screen. Click the More icon with three vertical dots in the bottom-right corner. Select “Add to desktop” to add the shortcut icon to your home screen.

The file shortcut gets created on the home screen. You can now drag and drop the shortcut anywhere on your home screen. With this app, you will not be able to create shortcuts for media files. However, you can place your favorite media files in a folder, and create a shortcut for the folder that can be placed anywhere on the home screen.

File Widget

File Widget is one of the most powerful File Manager that is available for Android devices. This is a widget that creates shortcuts for all file types and folders. The installation is same as with the other apps. The twist comes in using the widget to create shortcuts. When you are done with the installation, double-tap or give a single long-tap on the home screen to open-up the Widgets menu. Add File Widget to the home screen. Instead, you may add Folder Widget if creating folder shortcut.

After the widget is added to the home screen, you are now ready to create a shortcut to file or folder. Open-up File or Folder Widget; both of them opens a widget settings screen. Browse through to select the target file or folder, and type in the name of the shortcut in the space provided. You can even select an icon for the shortcut. Now, Click the Create Shortcut icon.

The next thing you see is the File or Folder Widget on the home screen gets converted to the shortcut you just created. With this piece of software, anybody can create shortcuts to almost any type of file present in the Android device. The widget settings screen is sleek and intuitive.

Download from PlayStore: File Widget

Built-in File Browser

You may also want to try out the built-in feature with the latest Android devices that may suit your specific needs. The procedure is a simple one with couple of quick steps.

Open, File Browser> Tap and hold the file or folder > Click More > Add to desktop.

In addition to these list of shortcut apps, Android has its own tool to create folder shortcuts. However, the ability to create file shortcuts depends from device to device. You can create shortcuts and then place them on the home screen as you like. You can create shortcuts for folders to place a wide range of files for your easy pick-ups and screen organization.

Statistics show that use of hand-held mobile devices is on the rise, and with each stride, we do see an advancement in the features. Android is keeping up with the pace, and when we talk about the ease of use, Android devices are among the best players in the market. With the above-listed apps and the built-in file manager, you can create shortcuts easily for suiting specific needs in Android devices. Something again that gives the feel of using a PC!.

Disclosure: Mashtips is supported by its audience. As an Amazon Associate I earn from qualifying purchases.

Источник

Оцените статью