How do you programmatically disable auto brightness?! - Android Software Development

I've been scouring the web for quite some time, but I can't find any examples of auto brightness being disabled programmatically. Some people are saying this functionality simply isn't built in to the Android SDK, but I find that hard to believe. Is there anyone out there that can explain how to do this or paste some sample code?

This is how I disable that functionality all together.
Code:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

Related

Direct access to CCD?

Hey all,
I want to write an app that basically uses the CCD's in the camera as a spectrometer; to get a readout of intensity vs wavelength and maybe later use the data to draw spectral lines. However, I can't find an API in the SDK to do get this info and nor can I find anything useful in /dev.
Is it possible to get this information from software? If it requires root, then I'm ok with that but obviously non-root is preferable. Any ideas?

[Q] How can i set/change Global Settings like Airplane Mode on/off

Hi XDA,
I'm in development of a widget app and want to provide several functions like toggle Airplane Mode, Data Roaming, GPS etc.
As of API Level 17 Airplane Mode and Data Roaming have been moved to protected Settings.Global* and i dont know how i can provide my users this functionality.
I heard of some permission "WRITE_SECURE_SETTINGS" but appearently this is not the problems solution yet. Is it? - didnt work in Emulator
Has anyone experience in this and can explain me how i can i provide these functions, which seem to be protected?
Thanks,
Wambo92
* I'm not allowed to link outside, but this is what i wanted to link to:
developer.android.com/reference/android/provider/Settings.Global.html
Settings.Global is read-only. The only way that special permission will work is if you build the OS yourself.
New Global Settings
The system settings have been updated to support multiple users with the addition of Settings.Global. This collection of settings is similar to Settings.Secure settings because they are read-only, but applies globally across all user spaces on the device.
Several existing settings were relocated here from either Settings.System or Settings.Secure. If your app is currently making changes to settings previously defined in Settings.System (such as AIRPLANE_MODE_ON), then you should expect that doing so will no longer work on a device running Android 4.2 or higher if those settings were moved to Settings.Global. You can continue to read settings that are in Settings.Global, but because the settings are no longer considered safe for apps to change, attempting to do so will fail silently and the system will write a warning to the system log when running your app on Android 4.2 or higher.
Click to expand...
Click to collapse
zalez said:
Settings.Global is read-only. The only way that special permission will work is if you build the OS yourself.
Click to expand...
Click to collapse
Okay, so I'm just going to link to the settings and display the state whether its on or off in API Level 17 or higher in my widgets.
Anyway, i don't like googles decision to strictly restrict developers changing these settings.

Free PDF API

Hey there,
I am creating an app, which runs in fullscreen mode and will always run in the foreground. Now I need a good way, to show PDF Files.
An external app is not really an option here -.-
And I can not find any free (commercial) APIs, which are still supported or in a good state to work with.
The device is on Android 4.4.2. , therefore Android L PDF Renderer does not work.
The device does not have Internet Access, therefore displaying the PDF with a webview and google docs does not work.
The only APIs I found are:
https://github.com/JoanZapata/android-pdfview --> very slow, blocks stay unrendered and no option to rotate the PDF
and
https://github.com/jblough/Android-Pdf-Viewer-Library --> only runs in activity, no options to configure the viewer
Does anyone know any other api?
The goal is to let the user choose a pdf file, which will then be displayed at a public place. So I thought PDF would be the best format and could not believe, that there is no real solution to this..
nice

Updated phone dialer app

Hey guys first time poster here.
Ive been trying to search around but cant find any real solutions.
I find the stock phone dialer app terrible as you cant have favourites and just the overall appearance of it aswell is a little plain.
I downloaded the app dialer and I like the look and functionality of it but when i press to call someone it goes to the stock dialer but it takes about 15 seconds to get there.
Someone please help!
The standard dialers you find on play store do not implement HFP-CLIENT.
To my knowledge, there are three hfp-client dialers available;
1) The binary only one that the thing ships with,
2) The new one added to AOSP8 here: https://android.googlesource.com/platform/packages/apps/Car/Dialer/
3) The qualcomm test application available on codeaurora.
There are problems with all of them for this application.
Specifically, as you note, option (1) is absolutely terrible.
A common problem with option (2) and (3) is that they don't interface with the chinese audio control hacks, which means that when you switch to a call, the audio won't come through.
An additional problem with option (2) is that it doesn't compile with less than Android 7.0 -- even though it actually specifies a minimum of 6.0, it depends on something with a minimum of 7.0.
An additional problem with option (3) is that it is a test application through and through, it doesn't implement the necessary background service to pop up a notification you can click on to answer a call. The application has to actually be *open* to do anything.
But aside from those problems with (2) and (3), the *good* thing about them, is that they are open source, which means that anybody who wants to adjust them so that they do work, can do so.
If I was going to pick somewhere to start with this, it would be with option (2). It is a dialer meant for end users, and would take a lot less work to adjust it to (a) compile, and (b) implement the needed audio hacks. Although technically, I do have option (3) working, as I mentioned, it has to actually be open in the foreground to do anything, and it doesn't implement the audio hacks.
Hi,
Apologies for the noob question but what do you do with the code in option 2 to install it on the headunit?
Thanks!
luciusfox said:
The standard dialers you find on play store do not implement HFP-CLIENT.
To my knowledge, there are three hfp-client dialers available;
1) The binary only one that the thing ships with,
2) The new one added to AOSP8 here: https://android.googlesource.com/platform/packages/apps/Car/Dialer/
3) The qualcomm test application available on codeaurora.
There are problems with all of them for this application.
Specifically, as you note, option (1) is absolutely terrible.
A common problem with option (2) and (3) is that they don't interface with the chinese audio control hacks, which means that when you switch to a call, the audio won't come through.
An additional problem with option (2) is that it doesn't compile with less than Android 7.0 -- even though it actually specifies a minimum of 6.0, it depends on something with a minimum of 7.0.
An additional problem with option (3) is that it is a test application through and through, it doesn't implement the necessary background service to pop up a notification you can click on to answer a call. The application has to actually be *open* to do anything.
But aside from those problems with (2) and (3), the *good* thing about them, is that they are open source, which means that anybody who wants to adjust them so that they do work, can do so.
If I was going to pick somewhere to start with this, it would be with option (2). It is a dialer meant for end users, and would take a lot less work to adjust it to (a) compile, and (b) implement the needed audio hacks. Although technically, I do have option (3) working, as I mentioned, it has to actually be open in the foreground to do anything, and it doesn't implement the audio hacks.
Click to expand...
Click to collapse
I just bought a Seicane unit. The model is listed as sp9853i in the settings screen. I haven't been able to find a lot of information anywhere about this unit. I have been trying to get a different HFP-enabled phone dialer, but no luck so far.
I did try installing FCC Launcher, which lists dialing through BT as a feature. However, it looks like the Seicane sp9853i provides the actual bluetooth functionality in the actual launcher. When I start FCC launcher, BT disconnects. Also, the BT properties are not available under Android settings, which is not terribly surprising, since it's a head unit, not a phone.

Auto open Apps.. Problem with multimedia Mazda CX9

Hello, I have the following problem, I would appreciate it if you could give me some guidance on how to solve it. After turning off the engine, the bluetooth application is activated and mute mode is activated
You're going to need to post a whole lot more details for help.
Have a read though forums
What else is needed? Multimedia work with android 10 canbus OD-Mazda (OUDI)
I want only stop this Apps
Do you know Tasker?
Perhaps you could make a Tasker script to kill the app.
I will try, but if anyone knows a way without additional applications, please share

Categories

Resources