Is it possible to write a B4A App to execute several clicks that I will usually do on my phone? e.g. When I am using Goggle Map, I will set the orientation of my phone to "Landscape", set voice Volume to "Maximum", and Brightness to "Auto", before turning on the Goggle Map.
Can I write an App to do the above 3 steps , i.e. Orientation, Volume and Brightness automatically?
Dim p As Phone
p.SetVolume(p.VOLUME_MUSIC, 15, True) 'Max Volume
p.SetScreenOrientation(0) ' Landscape
p.SetScreenBrightness(1) ' (-1 Auto did not work , 1 Brightest did work) should it be Adaptive now ???
just type "p." to display IntelliSense for Method Parameters
(you might need to read up on Permissions and requesting RuntimePermissions)
Have a play with the above, then start a separate new post for any problems you encounter.
Eventually you could also include Google Maps directly within your App.
i think op may find that the settings are temporary (valid for the duration of his app), the exception being for brightness, which requires a systems permission to work across apps.
As pointed out by drgottjr and showed in my test, the "p." settings are only applicable within the App itself, they do not change the global setting of my phone. e.g. the orientation is Landscape within the App, but it is still Portrait in the phone
Is there a way to effect the settings in the phone environment?
I think that common sense says that no app can force "the phone" to be in (say) landscape mode because that would completely disable apps that were fixed in portrait mode. Of course, common sense does not always work with Google.
As pointed out by drgottjr and showed in my test, the "p." settings are only applicable within the App itself, they do not change the global setting of my phone. e.g. the orientation is Landscape within the App, but it is still Portrait in the phone
Is there a way to effect the settings in the phone environment?
you're asking the same question. the phone library is not to blame. user-written app settings are user-written app-related.
what you want is not what google has in mind. i realize you may want simply to automate something
for your own personal use, but from google's point of view, allowing you to control system settings
from an app would allow you or any other developer to control what a user sees, hears and does in
spite of what they may want to see, hear or do. that level of arrogance is, of course, reserved
by google for its own personal use.
i think op may find that the settings are temporary (valid for the duration of his app), the exception being for brightness, which requires a systems permission to work across apps.
Using Personal Computer as a comparison, a few clicks of the keystrokes on the computer can be easily replaced by a batch file or auto-click software like "AutoIt". I am looking for an equivalent capability in B4X
The change in phone settings only affect my own phone, and I can of course reverse the settings back to default