- A little thing about Android module paths
- How to configure your module paths, instead of using Gradle’s default.
- If you cannot remove it, just rename it!
- Conclusion
- How to Change the Default App to Open a File in Android
- Ashish Mundhra
- Change Default Application for File Types in Android Phone
- Step 1:
- Step 2:
- Step 3:
- That’s All, Folks!
- Read Next
- How to Get Desktop Mode For Websites in Chrome for Android Permanently
- How to Change Default PDF Viewer on Android
- 2 Best Ways to Change Default Ringtone App on Android
- How to Lock and Protect Specific Apps on Android
- A Review of CCleaner for Android Beta: Good But Not Good Enough
- Top 10 Apple Files Tips and Tricks to Use It like a Pro
- Gmail vs Gmail Go: Comparing the Lite App with the Main One
- How to Change APK File Names and Icons Quickly and Easily
- Did You Know
- How to open Android Settings programmatically with Java
- Show system settings
- Access specific settings areas
- Constants of android.provider.Settings
- Add the permissions if required
A little thing about Android module paths
How to configure your module paths, instead of using Gradle’s default.
Working to make our Android application more modular, I ended up with a sample that included a set of on-demand features grouped inside a folder:
Pretty standard setup, all the on-demand modules, inside a “features” folder; clean.
These modules are included in the settings.gradle file as:
These setup works nicely with a single “minor” issue: an empty module named features in the Android view in Android Studio:
I can live with that, but I would much prefer to remove that empty module from my project!
If you cannot remove it, just rename it!
At I/O I was lucky enough to attend the “ Android Studio: Tips and Tricks” talk where Ivan Gravilovic, from Google, shared some amazing tips. One of these was a possible solution for my problem: setting a custom path for my modules.
In this particular case our settings.gradle becomes:
And the layout in Android Studio is now:
Conclusion
As the title says, this is really a small thing, but it helps keep my project in order and it shows how a small Gradle configuration can help keep your project tidy.
You can find this update in the latest version of the on-demand modules codelab.
Источник
How to Change the Default App to Open a File in Android
Ashish Mundhra
02 Aug 2012
Just like in Windows, we have multiple software to open a particular file type, we have a number of apps in Android to take care of a single file type. For example, we can have multiple audio/video players installed on the Android device that can play all types of media files.
Google Play Store has a plethrora of applications to better open different media files. Be it a new app to make calls, your new web browser, a swift messaging app or a swanky music player — an Android user is always on the lookout for a new app to adorn his or her home screen.
Now, let’s say you use different apps to play videos and listening to music but you accidentally hit Set default and created default action to use a player to play all the media files.
When you choose an app to be the default application to open a particular file type, it will do so whenever any third-party app is trying to access that particular file type as part of the default settings.
Change Default Application for File Types in Android Phone
Listen up Android users, if you have set a mistakenly default app to open a particular file type and want to undo the action, here’s what to do.
Step 1:
Open Android Apps settings. Android Ice Cream Sandwich (ICS) users can open Settings > Apps while the former builds can open Settings > Application > Manage applications.
Different versions of Android may also show different names of the tabs mentioned above. So, whether you are stuck with Android Marshmallow or are more upbeat Android Nougat, these instructions may vary.
Step 2:
Now search for the app you want to change the default settings for and tap on the app settings to open the info page of that application.
Step 3:
Scroll down the page to find the button Clear defaults. If the app is a default app for any of the file type on your device, the button will be enabled, otherwise disabled. Simply tap on the button to clear all the files associated with the app.
That’s All, Folks!
Next time you try to open the same file type, you will get all the suggestions to choose from again. Just make sure you make the right decision this time.
Last updated on 31 Aug, 2018
The above article may contain affiliate links which help support Guiding Tech. However, it does not affect our editorial integrity. The content remains unbiased and authentic.
Read Next
How to Get Desktop Mode For Websites in Chrome for Android Permanently
Learn How to Get Desktop Mode For Websites in # Chrome for # Android Permanently.
How to Change Default PDF Viewer on Android
Are you having trouble opening the # PDF files on your # Android phone? Follow our guide to change the default # PDF viewer and everything is going to be okay.
2 Best Ways to Change Default Ringtone App on Android
Did you accidentally select Always while choosing a # ringtone picker app on your # Android? Find out how to reset or change the default # ringtone app on Android.
How to Lock and Protect Specific Apps on Android
Find Out How to Lock and Protect Specific Apps on # Android Instead of Locking the Entire Phone.
A Review of CCleaner for Android Beta: Good But Not Good Enough
A Review of # CCleaner for # Android Beta: Good But Not Good Enough.
Top 10 Apple Files Tips and Tricks to Use It like a Pro
# Apple Files is more than a basic file manager for # iOS devices. Read the post to find the more about the excellent file manager from # Apple.
Gmail vs Gmail Go: Comparing the Lite App with the Main One
Wondering how # Gmail Go differs from the main Gmail app? Here we compare the two Gmail apps from # Google.
How to Change APK File Names and Icons Quickly and Easily
Learn How to Change APK File Names and Icons Quickly and Easily With APK Editor.
Did You Know
The B612 app is named after the B-612 asteroid which appears in ‘The Little Prince’ novella.
Источник
How to open Android Settings programmatically with Java
Carlos Delgado
Learn how to open dinamically the settings of Android in your app easily
In case your app needs that your user make some changes in the Settings menu i.e to set a default app to open a specific type of files etc, you may like to make this task easier for your user by starting the Settings menu of Android dinamically from your app.
Show system settings
To display the Settings page programmatically, you can use the startActivityForResult method with an Intent object and a constant of the Settings, the following example should open the general settings menu of Android:
The usage of the ACTION_SETTINGS constant with startActivityForResult will show system settings. The Settings provider contains global system-level device preferences.
Access specific settings areas
The following list contains all the constants that provide access to different areas of the settings menu:
Note: not all the constants are available on every Android version. In case you need more information visit the official documentation here.
Constants of android.provider.Settings
Activity Action: Show settings for accessibility modules.
Activity Action: Show add account screen for creating a new account.
Activity Action: Show settings to allow entering/exiting airplane mode.
Activity Action: Show settings to allow configuration of APNs.
Activity Action: Show screen of details about a particular application.
Activity Action: Show settings to allow configuration of application development-related settings.
Activity Action: Show settings to allow configuration of application-related settings.
Activity Action: Show battery saver settings.
Activity Action: Show settings to allow configuration of Bluetooth.
Activity Action: Show settings for video captioning.
Activity Action: Show settings to allow configuration of cast endpoints.
Activity Action: Show settings for selection of 2G/3G.
Activity Action: Show settings to allow configuration of date and time.
Activity Action: Show general device information settings (serial number, software version, phone number, etc.).
Activity Action: Show settings to allow configuration of display.
Activity Action: Show Daydream settings.
Activity Action: Show settings to configure the hardware keyboard.
Activity Action: Show Home selection settings.
Activity Action: Show screen for controlling background data restrictions for a particular application.
Activity Action: Show screen for controlling which apps can ignore battery optimizations.
Activity Action: Show settings to configure input methods, in particular allowing the user to enable input methods.
Activity Action: Show settings to enable/disable input method subtypes.
Activity Action: Show settings for internal storage.
Activity Action: Show settings to allow configuration of locale.
Activity Action: Show settings to allow configuration of current location sources.
Activity Action: Show settings to manage all applications.
Activity Action: Show settings to manage installed applications.
Activity Action: Show Default apps settings.
Activity Action: Show screen for controlling which apps can draw on top of other apps.
Activity Action: Show screen for controlling which apps are allowed to write/modify system settings.
Activity Action: Show settings for memory card storage.
Activity Action: Show settings for selecting the network operator.
Activity Action: Show NFC Sharing settings.
Activity Action: Show NFC Tap & Pay settings
This shows UI that allows the user to configure Tap&Pay settings.
Activity Action: Show NFC settings.
Activity Action: Show Notification listener settings.
Activity Action: Show Do Not Disturb access settings.
Activity Action: Show the top level print settings.
Activity Action: Show settings to allow configuration of privacy options.
Activity Action: Show settings to allow configuration of quick launch shortcuts.
Activity Action: Ask the user to allow an app to ignore battery optimizations (that is, put them on the whitelist of apps shown by ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS ).
Activity Action: Show settings for global search.
Activity Action: Show settings to allow configuration of security and location privacy.
Activity Action: Show system settings.
Activity Action: Show the regulatory information screen for the device.
Activity Action: Show settings to allow configuration of sound and volume.
Activity Action: Show settings to allow configuration of sync settings.
Activity Action: Show settings to control access to usage information.
Activity Action: Show settings to manage the user input dictionary.
Activity Action: Modify Airplane mode settings using a voice command.
Activity Action: Modify Battery Saver mode setting using a voice command.
Activity Action: Modify do not disturb mode settings.
Activity Action: Show settings to configure input methods, in particular allowing the user to enable input methods.
Activity Action: Show settings to allow configuration of VPN.
Activity Action: Show VR listener settings.
Activity Action: Allows user to select current webview implementation.
Activity Action: Show settings to allow configuration of a static IP address for Wi-Fi.
Activity Action: Show settings to allow configuration of Wi-Fi.
Activity Action: Show settings to allow configuration of wireless controls such as Wi-Fi, Bluetooth and Mobile networks.
Activity Extra: Limit available options in launched activity based on the given account types.
Activity Extra: Enable or disable Airplane Mode.
Activity Extra: Limit available options in launched activity based on the given authority.
Activity Extra: Enable or disable Battery saver mode.
Activity Extra: Enable or disable Do Not Disturb mode.
Activity Extra: How many minutes to enable do not disturb mode for.
Activity Category: Show application settings related to usage access.
Metadata key: Reason for needing usage access.
For example, you can open directly the Language Settings of the device (to change language) executing:
With the introduction of new Android APIs, there will be more settings available areas with different constants, read the official documentation of android provider settings here.
Add the permissions if required
For some special areas of the Android Settings, you will need permissions. For example, to open the bluetooth settings you’ll need to add the following bluetooth permissions in your app manifest:
And then you’ll be able to open the bluetooth settings:
Otherwise you’ll get the following exception:
Источник