[how to] Creating a Run Configuration - Android Studio

Creating a Run Configuration
The run configuration specifies the module to run, package to deploy, Activity to start, target device, emulator settings, and Logcat options. Run configuration can be set at the project, default, and module levels. When you first run a module as an Android Application, Android Studio will automatically create a run configuration. The default run configuration will launch the default project Activity and use automatic target mode for device selection (with no preferred AVD). If the default settings don't suit your project or module, you can customize the run configuration or even create a new one.
To create or modify a run configuration, see the IntelliJ documentation on Run/Debug configurations.
The following steps highlight the important things you need to do for an Android project:
Open Edit Configurations from the Run Menu.
Expand the Android Application item and create a new configuration or open an existing one.
With the Run Configuration selected, adjust your desired run configuration settings:
In the General tab, specify the Module settings to launch. In Target tab, consider whether you'd like to use Manual or Automatic mode when selecting an AVD to run your application. See the following section on Automatic and manual target modes).
In the Emulator tab, specify any emulator options to the Additional Emulator Command Line Options field. For example, you could add -scale 96dpi to scale the AVD's screen to an accurate size, based on the dpi of your computer monitor. For a full list of emulator options, see the Android Emulator document.
In the Logcat tab, set the LogCat options for the application.

Related

[Q] Changing android:screenOrientation on AndroidManifest.xml

Hi all,
I would like to change the screenOrientation attribute of ALL layouts found in an apk.
What I want is making the application switch to portrait according the actual orientation of the device (ie: portrait -> sensorPortrait).
How can I accomplish this in my Xposed module?
Thanks.
You can't change the values in AndroidManifest.xml, but you can change how they are processed. What you want to do is one of App Settings' features, you can either use it (then you don't need to write a module yourself) or check out the source code.
Thanks for your reply, buddy.

Tasker - Facebook app enable when you want to use, task to disable when app closes

I was trying to find a way to completely disable all of the background stuff that runs with the andriod facebook app and couldn't find an elegant way of doing it. Greenify sort of works but the background process somehow always find a way to restart themselves.... With this you can simply launch a facebook tasker link task, tasker will enable or 'unfreeze' the facebook app. Then when your done with facebook, as soon as you close it, a task will run to automatically disable or 'freeze' it. I noticed after this my battery life definitely improved.
As this is actually my first post on xda, I can't post the links to the screenshots I took of the tasker screens If anyone wants I have it in an html page / word doc that shows step by step the tasker profile and 4 tasks. PM me.)
Requirements
-Tasker
-Root
-Secure Settings tasker plugin and Root item > Package State > enable
-If you cannot get secure settings to recognize root (whcih was the case for me) then you need to run the following (which I found on another post)
download a terminal emulator then run the commands below
Play store - Terminal Emulator for Android, Jack Palevich
su
mount -o remount,rw /system
touch /system/bin/su
mount -o remount,ro /system
reboot
1) Create Profile > Application > Facebook
2)Create a “Facebook start” task
TASK #1: 'Facebook start' > Launch app Facebook
3) Then on the “Facebook” profile click on the ‘facebook start’ and select Add Exit Task
Then choose the a task that you created called ‘Facebook disable’
TASK #2: 'Facebook disable' > Secure Settings plugin > Facebook app > disable
TASK #3: 'Facebook enable' (this is to be used as a generic way to enable facebook and also used in the TASK#4). > Secure Settings plugin > Facebook app > enabled
TASK #4: 'Facebook Launch' (this enables the facebook app then launches facebook).
>perform task 'facebook enable'
>Wait 5 seconds
>Flash 'launching facebook'
>Launch App > Facebook
For the Facebook Icon to show on this task #4, you can choose this by pressing on the bottom right of the task and application Icons
4) Then Create a Tasker Widget Shortcut (don’t use the native Facebook icon as it will disappear from your launcher when you disable the app then you will have to keep re-adding it to the screen…) and point it to Task #4 'facebook launch'
Place your tasker shortcut on your launch screen and you are good to go. Now when you launch it, it will enable facebook, then when you exit , it will disable it.
You can do this for virtually any app, but I found it most useful for Facebook as it drains the battery when its enabled
What about doze? Do I need this tasker profile if my Android use doze?
noorbertt said:
What about doze? Do I need this tasker profile if my Android use doze?
Click to expand...
Click to collapse
I have a Galaxy S5 and am on MarshMallow I find that even if doze is enabled, facebook always finds a way to run. It was constantly draining my battery and until I did this tasker thing my battery would run down quickly. I'd recommend downloading an app from the playstore called "OS Monitor" - it shows what apps are running and how much CPU they are consuming - you can set it to show in real time - similar to windows task manager
Which option do you use in secure settings. I am not able to find any app actions in mine.
iamronin said:
Which option do you use in secure settings. I am not able to find any app actions in mine.
Click to expand...
Click to collapse
Secure Settings tasker plugin and Root item > Package State > enable
-If you cannot get secure settings to recognize root (whcih was the case for me) then you need to run the following (which I found on another post)
download a terminal emulator then run the commands below
Play store - Terminal Emulator for Android, Jack Palevich
su
mount -o remount,rw /system
touch /system/bin/su
mount -o remount,ro /system
reboot
If someone is interested in this feature but doesn't want to mount their system and break SafetyNet here is what I did. Instead of using Secure Settings I use a shell command. I've edited the original post:
drum200910 said:
Requirements
– Tasker
– Root
1) Create Profile > Application > Facebook
2) Create a “Facebook start” task
TASK #1: 'Facebook start' > Launch app Facebook
3) Then on the “Facebook” profile click on the ‘facebook start’ and select Add Exit Task
Then choose the a task that you created called ‘Facebook disable’
TASK #2: 'Facebook disable' > Code > Run Shell > Command "pm disable com.facebook.katana" and select "Use Root"
This only work with permissive SELinux, though. If you have enforcing SELinux you might have to add this command before the main one "setenforce 0" (also with root) and if you want to still pass SafetyNet after the main command run "setenforce 1" (also with root).
TASK #3: 'Facebook enable' (this is to be used as a generic way to enable facebook and also used in the TASK#4). > Code > Run Shell > Command "pm enable com.facebook.katana". Again with the other two.
TASK #4: 'Facebook Launch' (this enables the facebook app then launches facebook).
>perform task 'facebook enable'
>Wait 5 seconds
>Flash 'launching facebook'
>Launch App > Facebook
For the Facebook Icon to show on this task #4, you can choose this by pressing on the bottom right of the task and application Icons
4) Then Create a Tasker Widget Shortcut (don’t use the native Facebook icon as it will disappear from your launcher when you disable the app then you will have to keep re-adding it to the screen…) and point it to Task #4 'facebook launch'
Place your tasker shortcut on your launch screen and you are good to go. Now when you launch it, it will enable facebook, then when you exit , it will disable it.
You can do this for virtually any app, but I found it most useful for Facebook as it drains the battery when its enabled
Click to expand...
Click to collapse
Filip013 said:
If someone is interested in this feature but doesn't want to mount their system and break SafetyNet here is what I did. Instead of using Secure Settings I use a shell command. I've edited the original post:
Click to expand...
Click to collapse
In this part above: TASK #3: 'Facebook enable' (this is to be used as a generic way to enable facebook and also used in the TASK#4). > Code > Run Shell > Command "pm disable com.facebook.katana". Again with the other two.
should the above be "pm enable com.facebook.katana" ? I tried enable and it did work. Just checking...
saxainpdx said:
In this part above: TASK #3: 'Facebook enable' (this is to be used as a generic way to enable facebook and also used in the TASK#4). > Code > Run Shell > Command "pm disable com.facebook.katana". Again with the other two.
should the above be "pm enable com.facebook.katana" ? I tried enable and it did work. Just checking...
Click to expand...
Click to collapse
Thanks. That was a typo.
Let me give you a better and quick way to freezing/de-freezing a app whenever required:
Requisites:
1. Root
2. Titanium Backup
3. Nova Launcher or any other launcher
Steps:
After installing Titanium backup successfully go to Launcher and add widget of Titanium Backup with type as Action (There will be two widgets, Select the first one)
In the screen, tap on the action and select Freeze/Defrost/Launch an app (Scroll up then you will see)
Tap on Filter by and select the target application
Done
You widget will be created and whenever you tap on it a. If the app is frozen then it will get defrosted and get launched b. If its not frozen then it will get frozen
I am using this method since a year already for Facebook and Messenger apps

Changing Display Mode (Galaxy S8+ Adaptive/AMOLED Photo) when launching an app?

I have a Galaxy S8+. I use AMOLED Photo display mode, mostly because when I tweak a photo in Instagram, Snapseed,or Lightroom, I like it to be a fairly accurate representation on my phone's display, as the default Adaptive mode is oversaturated. But at other times, the Adaptive mode can look rather nice.
So what I'd like to do is when I launch something like Instagram or Snapseed, is to have Tasker switch the display mode to AMOLED Photo, and change back to Adaptive when I close the app.
It's a basic setting. Settings > Display > Display Mode > and you choose from one of 4 options with a radio button for each.
I tried using AutoInput, by using it to open display settings, then clicking display mode, then clicking AMOLED Photo. This is clunky, and slow, and the settings windows show on screen. And I then have to dismiss the settings window. Is there a way I can toggle that specific setting directly using some kind of plugin, without having to simulate all the key presses? Or have it change behind the scenes, not actually on screen?
Perhaps a shell command would work, if it has a specific system shell command? Is there a way to determine or interrogate if there is any kind of shell command?
Thanks!
the_scotsman said:
I have a Galaxy S8+. I use AMOLED Photo display mode, mostly because when I tweak a photo in Instagram, Snapseed,or Lightroom, I like it to be a fairly accurate representation on my phone's display, as the default Adaptive mode is oversaturated. But at other times, the Adaptive mode can look rather nice.
So what I'd like to do is when I launch something like Instagram or Snapseed, is to have Tasker switch the display mode to AMOLED Photo, and change back to Adaptive when I close the app.
It's a basic setting. Settings > Display > Display Mode > and you choose from one of 4 options with a radio button for each.
I tried using AutoInput, by using it to open display settings, then clicking display mode, then clicking AMOLED Photo. This is clunky, and slow, and the settings windows show on screen. And I then have to dismiss the settings window. Is there a way I can toggle that specific setting directly using some kind of plugin, without having to simulate all the key presses? Or have it change behind the scenes, not actually on screen?
Perhaps a shell command would work, if it has a specific system shell command? Is there a way to determine or interrogate if there is any kind of shell command?
Thanks!
Click to expand...
Click to collapse
I dont know about plugins, but you can check if there is a setting or intent regarding the display mode.
Run the following commands in terminal to see if there is a setting regarding display mode.
Code:
[B][COLOR="Blue"]# You can also write something like: settings list system > tasker.txt[/COLOR][/B]
settings list system
settings list global
settings list secure
[/HIDE]
You can change the settings which youve got from previous commands by using those commands:
Code:
[B][COLOR="Blue"]# Get the value/status of a setting[/COLOR][/B]
settings get global name_of_setting — returns status of setting (such as 1 = enabled, 0 = disabled)
[B][COLOR="Blue"]# Change the value/status of a setting[/COLOR][/B]
settings put global name_of_setting 0 — disables setting
settings put global name_of_setting 1 — enables setting
settings put system ...
settings put secure ...
[/HIDE]
You can also check if there is any intent for display mode in Settings.apk by using Manifest Viewer which shows the AndroidManifest.xml of every apk (where the intents are defined or something).
If there is a setting for display mode or if there is a intent, then its quite easy to set up a Tasker profile to achieve what you want.
You can also try to ask on Reddit ( /r/tasker ) since there are some people with good knowledge and /r/tasker is more popular than here on xda.
Thanks for your reply. You were on the right track. I had also asked on the Tasker Reddit.
But I need root to do what I want, and I'm not prepared to lose the warranty on my S8+ just yet.
Thanks anyway

[Guide][OOS][Root][Tasker] Disable visual annoyances during night

Hello guys, i'm no tasker expert, but i'll try to share my setup in order to turn off automatically notification (pulse) led, charging led and new notification wake up screen (under ambiant display) using tasker.
Requirements:
OOS (most custom roms have these things natively, and commands may differ from rom to rom)
Root
tasker
If you're new to tasker and need more step by step guide to create a task, there are plenty of tutorials and videos for that :good:.
First thing to understand is that there are multiple commands, you can choose to merge all the ones to disable lights into one task, and all the ones to enable lights back into another task, that's the easier way, but you can choose to make individual tasks that will be called one by one in another "main task", that's up to you, but the second choice will ask some extra work.
All the tasks will be created the same way, so i'll just help you with the first, then simply redo the things with the other commands.
Let's start with charging led, I named it LightsOff but you can name any task like you want.
Go to thet tasks tab, hit the "+" in the lower right, then name your task (LightsOff ?), then hit again the "+", type shell in the search field and select the "run shell", then, you'll need to type the different commands to be ran, one by line, so it meens after each command, hit "enter"
Once you're done, don't forget to tick the root checkbox.
For example, to turn the charging led Off you'll need the following commands:
Code:
settings put system battery_light_full_color 00
settings put system battery_light_medium_color 00
settings put system battery_light_low_color 00
There are other commands to turn it off, but for some reason, turn it back on will require a reboot, so to avoid that, i simply changed the colors to black, so it's not really turned off, but black (which is, for us, exactly the same).
You'll find all the commands at the end of the post, if you want to merge all commands (recommanded) into one task, go there and just add them to the task before saving it.
Save the task.
Now let's make the task that will get your charging led back to normal (or whatever suits you).
It's almost a copy and paste as the only changes are the name of the task (LightsOn ?) and the values for the colors.
Commands to type:
Code:
settings put system battery_light_full_color 16711936
settings put system battery_light_medium_color 16842752
settings put system battery_light_low_color 16842752
Save the task (root ticked obviously).
These are the default values, you can try other values if you like, that's what i've done, i like dimmed lights for charging, so mines are
Code:
settings put system battery_light_full_color 4096
settings put system battery_light_medium_color 8126464
settings put system battery_light_low_color 8126464
Before you ask, i could not find how find the correct number for a wanted color, i just tried many and wrote down ones i could keep, if you have an idea let's share it
So, now, here are the other commands that you can choose to merge to the first task or just create more tasks for each.
Wake up screen on new notification (you can find it under the ambiant display menu)
Warning: not same command as before, this setting is stored in the secure settings, not the system settings
Disable:
Code:
settings put secure notification_wake_enabled 0
Enable:
Code:
settings put secure notification_wake_enabled 1
And for the pulsing notification light.
Disable:
Code:
settings put system notification_light_pulse 0
Enable:
Code:
settings put system notification_light_pulse 1
You can merge all the commands in one single task for enable and another for disable if you want, that will be easier to setup.
Now all you have to do is create a new profile for night based on time of the day that will trigger the lights off.
Go to profiles tab, hit the "+" then "time" and choose the hours that suits you.
then select the task you want to run (the one that will turn off everything), after that, long click on the selected tak and select "add exit task"
then select the task that will turn all back on.
If you merged all the commands you're done, if not, you'll need to crete two tasks that will group the different tasks you want, i don't thinks it's worth the extra work but for knowledge purpose here's what you have to do.
Go to Tasks Tab, hit "+", give a name, hit "+" type "perform" in the search field and then select "perform task", hit the magnifying glass (the search icon, sorry english isn't my native language) then select the task you want, repeat this for each task you want to add to the "main" task.
Do the same for the "exiting" task.
This way is better as you can add extra tasks like going to airplane mode or mute sounds or whatever you want, but i i told before, it's much more work.
Hope this will help some stock (or xXx :good users, if you have questions, i'll try to answer, but as i said earlier, i'm really no expert with tasker, but if i could manage to do it, you too !
Have a nice day XDA !

[Release][v2.0.1] Android Auto - XLauncher Unlocked (AAXLU)

Android Auto - XLauncher Unlocked v2.0.1
Custom Android Auto launcher, unleash your AA app, unlock more features!
- Source code
- Documentation
- Releases
- XDA Thread
Features
Name​DescriptionRoot required​Xposed required​Default​Set the next used launch option as default​​Classic​Launch the Android Auto settings, with the classic/stable style​​Material3​Launch the Android Auto settings, with the hidden/experimental Material3 style​​Debug​Launch various hidden Android Auto debug screens​​Xposed Module​Unlock more 3th party Android Auto apps! (e.g. Fermata, OsmAnd, S2A, ...)​​
Description
XLauncher Unlocked is a separate app, to unlock more features in your Android Auto app.
It can launch existing / hidden Android Auto screens with root / ADB commands.
Classic can be launched without root.
If using the Xposed module,
then it will also hook into an existing Android Auto function,
to run some additional code behind it,
to make some of the "installed as Google Play" checks always come back as valid,
which does not modify the AA app itself.
Due to the nature of the implementation of the features,
you should not have to be afraid of "having to wipe AA data to test".
Because no AA data is touched / no AA files are edited in a persistent way.
Default "launch option"
The "Set the next used launch option as default" check-mark can be used to
automatically launch the "launch option" behind the button you click after checking the check-mark.
After a default "launch option" is configured, the next times you open XLauncher Unlocked,
it will automatically open that "launch option" for you.
This works for every "launch option" (Classic, Material3, Debug options),
and can easily be re-configured by selecting another "launch option" with the check-mark still configured.
Clearing/resetting the usage of the default "launch option" is as easy as un-checking the check-mark
Credits
Credits for the hooks from Fermata by @AndreyPavlenko!
New v2.0 release is out which added a bunch of launcher functions!
You can download it from GitHub: https://github.com/Rikj000/Android-Auto-XLauncher-Unlocked/releases/tag/v2.0
Thank you. Interesting app, I will have to play and investigate
I use PlayStore and Play Protect did not let me to install.
I could have to disable Play Protect but I repackaged your app and installed pretending it as it was installed by PlayStore (screenshot).
Now it runs ok and Play protect does not complain
I have just an observation about the main screen. Buttons don't fit to my display (probably since I use enlarged text) and there is no way to scroll and to read the cut-off part on the right side.
Screenshot attached
The other Material screens I tried were ok
Thank you for the feedback @zgfg
Just reworked the installation instructions,
now pointing users to KingInstaller to install the app.
I'll try to figure out a fix to make the UI display correctly on enlarged screens.
However, scrolling up/down appears to work when I enlarge my screen
What's the difference between Classic, Default and Material3? Do you have screenshots?
SOFO888 said:
What's the difference between Classic, Default and Material3? Do you have screenshots?
Click to expand...
Click to collapse
Classic launches AA with the 'classic' design, Material3 with the Material 3 design - screenshots
I suppose Default can make Material to become default style for the future launches (not necessarily from this launcher) but I don't want to wipe AA data to test
SOFO888 said:
What's the difference between Classic, Default and Material3? Do you have screenshots?
Click to expand...
Click to collapse
Classic = The old / default user interface.
Material3 = The new / hidden / experimental user interface.
Check the attached files for comparison screenshots.
Rikj000 said:
I'll try to figure out a fix to make the UI display correctly on enlarged screens.
However, scrolling appears to work when I enlarge my screen
Click to expand...
Click to collapse
I cannot scroll left/right to read the cut-off text (yellow boxed on the screenshot), like Trouble..., Feedback repo ..
zgfg said:
I suppose Default can make Material to become default style for the future launches (not necessarily from this launcher) but I don't want to wipe AA data to test
Click to expand...
Click to collapse
XLauncher Unlocked is a separate app which doesn't modify any Android Auto related things (files/settings).
It simply launches existing / hidden Android Auto screens with root / ADB commands.
And if using the Xposed module, then it will also hook into an existing Android Auto function,
to run some additional code behind it, to make some of the "installed as Google Play" checks always come back as valid, which does not modify the AA app itself.
Due to the nature of the implementation of the features,
you should not have to be afraid of "having to wipe AA data to test".
Because no AA data is touched / no AA files are edited in a persistent way.
Additional Docs - AA - XLauncher Unlocked - Default "launch option"
The "Set the next used launch option as default" checkmark can be used to
automatically launch the "launch option" behind the button you click after checking the checkmark.
After a default "launch option" is configured, the next times you open XLauncher Unlocked,
it will automatically open that "launch option" for you.
This works for every "launch option" (Classic, Material3, Debug options),
and can easily be re-configured by selecting another "launch option" with the checkmark still configured.
Clearing/resetting the usage of the default "launch option" is as easy as un-checking the checkmark
zgfg said:
I cannot scroll left/right to read the cut-off text (yellow boxed on the screenshot), like Trouble..., Feedback repo ..
Click to expand...
Click to collapse
I know, you've reported this earlier, v2.0 is not optimized to handle screen enlargement.
Work Around - GUI cropped on enlarged screens
To make the GUI display correctly, please open your Settings app and go to:
Display => Display size and text => Display size => Reduce the size by a few clicks.
Restore the Display size again once you're done playing with XLauncher Unlocked
and once you have a default "launch option" configured.
GitHub Issue: https://github.com/Rikj000/Android-Auto-XLauncher-Unlocked/issues/1
Thank you very much for the screenshots.
I thought the app will change the Android Auto view in the car. But the app changes the Android Auto phone app. Thank you very much for the clarification.
Maybe I missed in the menus... Is it possible to have the option to switch on/off CoolWalk view in the car
It is possible by AA AIO Tweaker but I don't know is it just some setting for AA or AIO Tweaker has to tweak the AA db
New v2.0.1 release is out which fixed the non-scroll-able Debug "launch options" section on enlarged screens!
You can download it from GitHub: https://github.com/Rikj000/Android-Auto-XLauncher-Unlocked/releases/tag/v2.0.1
zgfg said:
Maybe I missed in the menus...
Is it possible to have the option to switch on/off CoolWalk view in the car
Click to expand...
Click to collapse
It's not possible with AAXLU (Android Auto XLauncher Unlocked),
but afaik it should be as simple as renaming following file at
/data/data/com.google.android.projection.gearhead/files/phenotype/shared/
- From: com.google.android.projection.gearhead.pb
- To: com.google.android.projection.gearhead.pb.bak (Or smth similar, al long as the original "doesn't exist")
Then close Android Auto / reboot.
That file is at least what was required to make CoolWalk / TaskBar-Widgets work / appear on MicroG.
Rikj000 said:
New v2.0.1 release is out which fixed the non-scroll-able Debug "launch options" section on enlarged screens!
You can download it from GitHub: https://github.com/Rikj000/Android-Auto-XLauncher-Unlocked/releases/tag/v2.0.1
Click to expand...
Click to collapse
Thanks. Fixed in this v2.0.1
Rikj000 said:
Android Auto - XLauncher Unlocked v2.0.1
Custom Android Auto launcher, unleash your AA app, unlock more features!
- Source code
- Documentation
- Releases
- XDA Thread
<snip>
Credits
Credits for the hooks from Fermata by @AndreyPavlenko!
Click to expand...
Click to collapse
Thanks a million for this app/ Xposed module. All I needed was to make "unauthorized apps" to work, and until recently, the only way to do that was cumbersome phenotype.db edits with triggers (battery drain!) and wiping AA data.
Working perfectly for me, count me in for a follower/ tester/ anything I can do to help!
News/update, only for MicroG users:
aaxlu (v2.0.1) now comes pre-included with aa4mg (v0.6)
If you manually installed aaxlu before,
then please uninstall aaxlu, before you install aa4mg v0.6.
ph03n!x said:
Thanks a million for this app/ Xposed module. All I needed was to make "unauthorized apps" to work, and until recently, the only way to do that was cumbersome phenotype.db edits with triggers (battery drain!) and wiping AA data.
Working perfectly for me, count me in for a follower/ tester/ anything I can do to help!
Click to expand...
Click to collapse
I think I must be missing something. I have root and the lsposed module installed etc. I have Screen2Auto installed but the app isn't visible in Android Auto. What are the steps to get third party apps to work? Thanks
Edit: more info. Have magisk, zygisk and lsposed module activated
FredQ said:
I think I must be missing something. I have root and the lsposed module installed etc. I have Screen2Auto installed but the app isn't visible in Android Auto. What are the steps to get third party apps to work? Thanks
Click to expand...
Click to collapse
S2A is by far the most restricted app.
I've posted all restrictions/by-passes which are within my knowledge in the S2A thread:
https://forum.xda-developers.com/t/...r-root-devices.4062787/page-147#post-88392893
With those steps I've been able to get S2A showing up reliably.
Maybe I've missed something but what is the purpose of this app, other than to change the look of AA settings? What other 'hidden' features does it show, other than to be found in Developer settings? Thanks.

Categories

Resources